diff --git a/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupplement_common.test.js b/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupplement_common.test.js index d803ff4c872807ea6d1a1cac0ea0d6947da518f4..e059cd199e77bbedd2462954ffba1a2cb337e142 100644 --- a/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupplement_common.test.js +++ b/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupplement_common.test.js @@ -67,7 +67,7 @@ describe("VibratorJsTest_misc_3", function () { * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0290 */ it("VibratorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { - vibrator.vibrate({ + vibrator.startVibration({ type: "time", duration: 1000 }, { @@ -93,7 +93,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: "", duration: 1000 }, { @@ -123,7 +123,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest017", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: "preset", effectId: "", count: 3, @@ -155,7 +155,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest018", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate(null, null); + vibrator.startVibration(null, null); } catch (error) { console.info(error); expect(true).assertTrue(); @@ -169,7 +169,7 @@ describe("VibratorJsTest_misc_3", function () { * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0350 */ it("VibratorJsTest019", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { - await vibrator.vibrate({ + await vibrator.startVibration({ type: "time", duration: 1000, }, { @@ -189,7 +189,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest020", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - await vibrator.vibrate({ + await vibrator.startVibration({ type: "", duration: 1000 }, { @@ -215,7 +215,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest021", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: "preset", effectId: "", count: 3, @@ -243,7 +243,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest022", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: 1, count: 3, }, { @@ -264,7 +264,7 @@ describe("VibratorJsTest_misc_3", function () { it("VibratorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { function vibratePromise() { return new Promise((resolve, reject) => { - vibrator.vibrate({ + vibrator.startVibration({ type: "time", duration: 100 }, { @@ -283,7 +283,7 @@ describe("VibratorJsTest_misc_3", function () { } let promise = new Promise((resolve, reject) => { - vibrator.vibrate({ + vibrator.startVibration({ type: "time", duration: 100 }, { @@ -313,7 +313,7 @@ describe("VibratorJsTest_misc_3", function () { * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0500 */ it("VibratorJsTest024", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { - vibrator.vibrate({ + vibrator.startVibration({ type: "time", duration: 1000 }, { @@ -340,7 +340,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: "", duration: 1000 }, { @@ -371,7 +371,7 @@ describe("VibratorJsTest_misc_3", function () { */ it("VibratorJsTest026", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { try { - vibrator.vibrate({ + vibrator.startVibration({ type: "preset", effectId: "", count: 3, diff --git a/sensors/miscdevice_standard/src/main/js/test/Vibrator_old.test.js b/sensors/miscdevice_standard/src/main/js/test/Vibrator_old.test.js index 5b9ccedda00cc2d945f3f01c43ee5384ad8f7190..78c2e38cd9958fe485f065eeb360a3b9eafa0b82 100644 --- a/sensors/miscdevice_standard/src/main/js/test/Vibrator_old.test.js +++ b/sensors/miscdevice_standard/src/main/js/test/Vibrator_old.test.js @@ -187,21 +187,13 @@ describe("VibratorJsTest_misc_1", function () { */ it("SubVibratorJsTest0007", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { console.info('----------------------SubVibratorJsTest0007---------------------------'); - try { - vibrator.vibrate({ - mode: 'short', - success: function () { - console.info("SubVibratorJsTest0007 success"); - expect(false).assertTrue(); - done(); - }, - }, 25); - } catch (error) { - console.info('SubVibratorJsTest0007 error:' + error); - expect(error.code).assertEqual(PARAMETER_ERROR_CODE); - expect(error.message).assertEqual(PARAMETER_ERROR_MSG); - done(); - } + vibrator.vibrate({ + mode: 'short', + success: function () { + console.info("SubVibratorJsTest0007 success"); + done(); + }, + }, 25); }) /* @@ -243,14 +235,10 @@ describe("VibratorJsTest_misc_1", function () { */ it("SubVibratorJsTest0009", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { console.info('----------------------SubVibratorJsTest0009---------------------------'); - try { - vibrator.vibrate(); - } catch (error) { - console.info('SubVibratorJsTest0009 error:' + error); - expect(error.code).assertEqual(PARAMETER_ERROR_CODE); - expect(error.message).assertEqual(PARAMETER_ERROR_MSG); + vibrator.vibrate(); + setTimeout(() => { done(); - } + }, 500); }) /* @@ -260,23 +248,13 @@ describe("VibratorJsTest_misc_1", function () { */ it("SubVibratorJsTest0010", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { console.info('----------------------SubVibratorJsTest0010---------------------------'); - try { - vibrator.vibrate({ - mode: 'short', - success: function () { - console.info("SubVibratorJsTest0010 success"); - expect(false).assertTrue(); - done(); - }, - }, function () { - }, 25); - } catch (error) { - console.info('SubVibratorJsTest0010 error:' + error); - expect(error.code).assertEqual(PARAMETER_ERROR_CODE); - expect(error.message).assertEqual(PARAMETER_ERROR_MSG); - done(); - } + vibrator.vibrate({ + mode: 'short', + success: function () { + console.info("SubVibratorJsTest0010 success"); + done(); + }, + }, 25); }) }) - - } +}