未验证 提交 81b05579 编写于 作者: O openharmony_ci 提交者: Gitee

!9864 测试用例优化

Merge pull request !9864 from lixiangpeng5/master-lxp
...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_4", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled')
vibrator.stop("preset");
vibrator.stop("time");
console.info('afterEach called') console.info('afterEach called')
}) })
...@@ -80,6 +77,7 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -80,6 +77,7 @@ describe("VibratorJsTest_misc_4", function () {
}, 500); }, 500);
} }
vibrator.vibrate(10, vibrateCallback); vibrator.vibrate(10, vibrateCallback);
await vibrator.stopVibration();
}) })
/* /*
...@@ -143,6 +141,7 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -143,6 +141,7 @@ describe("VibratorJsTest_misc_4", function () {
}, 500); }, 500);
} }
vibrator.vibrate(1800000, vibrateCallback); vibrator.vibrate(1800000, vibrateCallback);
await vibrator.stopVibration();
}) })
/* /*
...@@ -206,6 +205,7 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -206,6 +205,7 @@ describe("VibratorJsTest_misc_4", function () {
}, 500); }, 500);
} }
vibrator.vibrate("haptic.clock.timer", vibrateCallback); vibrator.vibrate("haptic.clock.timer", vibrateCallback);
await vibrator.stopVibration();
}) })
/* /*
...@@ -329,6 +329,7 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -329,6 +329,7 @@ describe("VibratorJsTest_misc_4", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -392,6 +393,7 @@ describe("VibratorJsTest_misc_4", function () { ...@@ -392,6 +393,7 @@ describe("VibratorJsTest_misc_4", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
......
...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_5", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled')
vibrator.stop("preset");
vibrator.stop("time");
console.info('afterEach called') console.info('afterEach called')
}) })
...@@ -84,6 +81,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -84,6 +81,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -140,6 +138,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -140,6 +138,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -237,6 +236,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -237,6 +236,7 @@ describe("VibratorJsTest_misc_5", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -283,6 +283,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -283,6 +283,7 @@ describe("VibratorJsTest_misc_5", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -410,6 +411,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -410,6 +411,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest031 reject"); console.info("VibratorJsTest031 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -462,6 +464,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -462,6 +464,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest032 reject"); console.info("VibratorJsTest032 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -514,6 +517,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -514,6 +517,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest033 reject"); console.info("VibratorJsTest033 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -567,6 +571,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -567,6 +571,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest034 reject"); console.info("VibratorJsTest034 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -619,6 +624,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -619,6 +624,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest035 reject"); console.info("VibratorJsTest035 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -671,6 +677,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -671,6 +677,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest036 reject"); console.info("VibratorJsTest036 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -724,6 +731,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -724,6 +731,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest037 reject"); console.info("VibratorJsTest037 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -777,6 +785,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -777,6 +785,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest038 reject"); console.info("VibratorJsTest038 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -830,6 +839,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -830,6 +839,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest039 reject"); console.info("VibratorJsTest039 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
/* /*
...@@ -856,6 +866,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -856,6 +866,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -914,6 +925,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -914,6 +925,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -971,6 +983,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -971,6 +983,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -1027,6 +1040,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1027,6 +1040,7 @@ describe("VibratorJsTest_misc_5", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -1121,6 +1135,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1121,6 +1135,7 @@ describe("VibratorJsTest_misc_5", function () {
console.info("VibratorJsTest050 error :" + error); console.info("VibratorJsTest050 error :" + error);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1171,6 +1186,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1171,6 +1186,7 @@ describe("VibratorJsTest_misc_5", function () {
console.info("VibratorJsTest052 error :" + error); console.info("VibratorJsTest052 error :" + error);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1307,6 +1323,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1307,6 +1323,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest056 reject"); console.info("VibratorJsTest056 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1363,6 +1380,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1363,6 +1380,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest057 reject"); console.info("VibratorJsTest057 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1418,6 +1436,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1418,6 +1436,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest058 reject"); console.info("VibratorJsTest058 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1472,6 +1491,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1472,6 +1491,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest059 reject"); console.info("VibratorJsTest059 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1525,6 +1545,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1525,6 +1545,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest060 reject"); console.info("VibratorJsTest060 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1577,6 +1598,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1577,6 +1598,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest061 reject"); console.info("VibratorJsTest061 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1630,6 +1652,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1630,6 +1652,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest062 reject"); console.info("VibratorJsTest062 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
/* /*
...@@ -1682,6 +1705,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1682,6 +1705,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest063 reject"); console.info("VibratorJsTest063 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -1736,6 +1760,7 @@ describe("VibratorJsTest_misc_5", function () { ...@@ -1736,6 +1760,7 @@ describe("VibratorJsTest_misc_5", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest064 reject"); console.info("VibratorJsTest064 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
......
...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -47,9 +47,6 @@ describe("VibratorJsTest_misc_3", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach called')
vibrator.stop("preset");
vibrator.stop("time");
console.info('afterEach called') console.info('afterEach called')
}) })
...@@ -84,6 +81,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -84,6 +81,7 @@ describe("VibratorJsTest_misc_3", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -179,6 +177,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -179,6 +177,7 @@ describe("VibratorJsTest_misc_3", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -304,6 +303,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -304,6 +303,7 @@ describe("VibratorJsTest_misc_3", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest023 reject"); console.info("VibratorJsTest023 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -331,6 +331,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -331,6 +331,7 @@ describe("VibratorJsTest_misc_3", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -420,6 +421,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -420,6 +421,7 @@ describe("VibratorJsTest_misc_3", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -517,6 +519,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -517,6 +519,7 @@ describe("VibratorJsTest_misc_3", function () {
console.info("VibratorJsTest031 error :" + error); console.info("VibratorJsTest031 error :" + error);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await vibrator.stopVibration();
done(); done();
}) })
...@@ -651,6 +654,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -651,6 +654,7 @@ describe("VibratorJsTest_misc_3", function () {
}, ()=>{ }, ()=>{
console.info("VibratorJsTest035 reject"); console.info("VibratorJsTest035 reject");
}) })
await vibrator.stopVibration();
done(); done();
}) })
......
...@@ -51,9 +51,6 @@ describe("VibratorJsTest_misc_6", function () { ...@@ -51,9 +51,6 @@ describe("VibratorJsTest_misc_6", function () {
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled') console.info('afterEach caled')
vibrator.stop("preset");
vibrator.stop("time");
console.info('afterEach called')
}) })
const OPERATION_FAIL_CODE = 14600101; const OPERATION_FAIL_CODE = 14600101;
......
...@@ -46,8 +46,6 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -46,8 +46,6 @@ describe("VibratorJsTest_misc_7", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
vibrator.stop("preset");
vibrator.stop("time");
console.info('afterEach called') console.info('afterEach called')
}) })
...@@ -78,6 +76,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -78,6 +76,7 @@ describe("VibratorJsTest_misc_7", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -99,6 +98,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -99,6 +98,7 @@ describe("VibratorJsTest_misc_7", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -120,6 +120,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -120,6 +120,7 @@ describe("VibratorJsTest_misc_7", function () {
done(); done();
}, 500); }, 500);
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -168,6 +169,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -168,6 +169,7 @@ describe("VibratorJsTest_misc_7", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -217,6 +219,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -217,6 +219,7 @@ describe("VibratorJsTest_misc_7", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -266,6 +269,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -266,6 +269,7 @@ describe("VibratorJsTest_misc_7", function () {
}).catch((error)=>{ }).catch((error)=>{
expect(false).assertTrue(); expect(false).assertTrue();
}) })
await vibrator.stopVibration();
done(); done();
}) })
...@@ -324,6 +328,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -324,6 +328,7 @@ describe("VibratorJsTest_misc_7", function () {
fail: undefined, fail: undefined,
complete: undefined complete: undefined
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -342,6 +347,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -342,6 +347,7 @@ describe("VibratorJsTest_misc_7", function () {
fail: null, fail: null,
complete: null complete: null
}); });
await vibrator.stopVibration();
}) })
/* /*
...@@ -360,6 +366,7 @@ describe("VibratorJsTest_misc_7", function () { ...@@ -360,6 +366,7 @@ describe("VibratorJsTest_misc_7", function () {
fail: 123, fail: 123,
complete: 123 complete: 123
}); });
await vibrator.stopVibration();
}) })
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册