From a2114b4664e368f0bbe6508a2f597a3bdb0954fb Mon Sep 17 00:00:00 2001 From: lixiangpeng5 Date: Fri, 25 Aug 2023 03:40:08 +0000 Subject: [PATCH] fix stop afterEach testcase Signed-off-by: lixiangpeng5 Change-Id: Iedd9d02574e56727e6454bbe7669fe8e0f05bac1 --- .../js/test/Vibrator_newSupplement_common.test.js | 10 +++++++--- .../src/main/js/test/Vibrator_newSupportTest.test.js | 3 --- .../src/main/js/test/Vibrator_options.test.js | 11 +++++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) 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 e059cd199..4251ab3c5 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 @@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_3", function () { /* * @tc.teardown: teardown invoked after each testcases */ - console.info('afterEach called') - vibrator.stop("preset"); - vibrator.stop("time"); console.info('afterEach called') }) @@ -84,6 +81,7 @@ describe("VibratorJsTest_misc_3", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -179,6 +177,7 @@ describe("VibratorJsTest_misc_3", function () { }).catch((error)=>{ expect(false).assertTrue(); }); + await vibrator.stopVibration(); done(); }) @@ -304,6 +303,7 @@ describe("VibratorJsTest_misc_3", function () { }, ()=>{ console.info("VibratorJsTest023 reject"); }) + await vibrator.stopVibration(); done(); }) @@ -331,6 +331,7 @@ describe("VibratorJsTest_misc_3", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -420,6 +421,7 @@ describe("VibratorJsTest_misc_3", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -517,6 +519,7 @@ describe("VibratorJsTest_misc_3", function () { console.info("VibratorJsTest031 error :" + error); expect(false).assertTrue(); }); + await vibrator.stopVibration(); done(); }) @@ -651,6 +654,7 @@ describe("VibratorJsTest_misc_3", function () { }, ()=>{ console.info("VibratorJsTest035 reject"); }) + await vibrator.stopVibration(); done(); }) diff --git a/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupportTest.test.js b/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupportTest.test.js index 136cdf441..0676c57cf 100644 --- a/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupportTest.test.js +++ b/sensors/miscdevice_standard/src/main/js/test/Vibrator_newSupportTest.test.js @@ -51,9 +51,6 @@ describe("VibratorJsTest_misc_6", function () { * @tc.teardown: teardown invoked after each testcases */ console.info('afterEach caled') - vibrator.stop("preset"); - vibrator.stop("time"); - console.info('afterEach called') }) const OPERATION_FAIL_CODE = 14600101; diff --git a/sensors/miscdevice_standard/src/main/js/test/Vibrator_options.test.js b/sensors/miscdevice_standard/src/main/js/test/Vibrator_options.test.js index d7ce0df58..db70dec3a 100644 --- a/sensors/miscdevice_standard/src/main/js/test/Vibrator_options.test.js +++ b/sensors/miscdevice_standard/src/main/js/test/Vibrator_options.test.js @@ -46,8 +46,6 @@ describe("VibratorJsTest_misc_7", function () { /* * @tc.teardown: teardown invoked after each testcases */ - vibrator.stop("preset"); - vibrator.stop("time"); console.info('afterEach called') }) @@ -78,6 +76,7 @@ describe("VibratorJsTest_misc_7", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -99,6 +98,7 @@ describe("VibratorJsTest_misc_7", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -120,6 +120,7 @@ describe("VibratorJsTest_misc_7", function () { done(); }, 500); }); + await vibrator.stopVibration(); }) /* @@ -168,6 +169,7 @@ describe("VibratorJsTest_misc_7", function () { }).catch((error)=>{ expect(false).assertTrue(); }) + await vibrator.stopVibration(); done(); }) @@ -217,6 +219,7 @@ describe("VibratorJsTest_misc_7", function () { }).catch((error)=>{ expect(false).assertTrue(); }) + await vibrator.stopVibration(); done(); }) @@ -266,6 +269,7 @@ describe("VibratorJsTest_misc_7", function () { }).catch((error)=>{ expect(false).assertTrue(); }) + await vibrator.stopVibration(); done(); }) @@ -324,6 +328,7 @@ describe("VibratorJsTest_misc_7", function () { fail: undefined, complete: undefined }); + await vibrator.stopVibration(); }) /* @@ -342,6 +347,7 @@ describe("VibratorJsTest_misc_7", function () { fail: null, complete: null }); + await vibrator.stopVibration(); }) /* @@ -360,6 +366,7 @@ describe("VibratorJsTest_misc_7", function () { fail: 123, complete: 123 }); + await vibrator.stopVibration(); }) /* -- GitLab