提交 da3fd4df 编写于 作者: O openharmony_ci 提交者: Gitee

!1091 【communication】补充WIFI JS L2测试用例

Merge pull request !1091 from 权力/myfeature
...@@ -57,13 +57,20 @@ describe('ACTS_WifiTest', function () { ...@@ -57,13 +57,20 @@ describe('ACTS_WifiTest', function () {
/** /**
* @tc.number wifi_native_js_unit_test_001 * @tc.number wifi_native_js_unit_test_001
* @tc.name Test wifi.isWifiActive. * @tc.name Test wifi.isWifiEnable.
* @tc.desc Test wifi.isWifiActive API functionality. * @tc.desc Test wifi.isWifiEnable API functionality.
*/ */
it('wifi_native_js_unit_test_001', 0, function () { it('wifi_native_js_unit_test_001', 0, function () {
console.info("[wifi_test] wifi active test."); console.info("[wifi_test] wifi open test.");
var isactive = wifi.isWifiActive(); var active = wifi.isWifiActive();
expect(isactive).assertTrue(); if(!active){
var enable = wifi.enableWifi();
sleep(3000);
console.log("[wifi_test] wifi open result: " + enable);
expect(enable).assertTrue();
}
sleep(300000);
}) })
/** /**
...@@ -148,10 +155,13 @@ describe('ACTS_WifiTest', function () { ...@@ -148,10 +155,13 @@ describe('ACTS_WifiTest', function () {
it('wifi_native_js_unit_test_007', 0, async function (done) { it('wifi_native_js_unit_test_007', 0, async function (done) {
console.info('[wifi_test] wifi add device config test[1]'); console.info('[wifi_test] wifi add device config test[1]');
var active = wifi.isWifiActive(); var active = wifi.isWifiActive();
sleep(30000);
console.log("[wifi_test] wifi active result: " + active);
if(!active){ if(!active){
var enable = wifi.enableWifi(); var enable = wifi.enableWifi();
except(enable).assertTrue();
sleep(3000); sleep(3000);
except(enable).assertTrue();
} }
wifi.addDeviceConfig(wifiConfig, wifi.addDeviceConfig(wifiConfig,
(result) => { (result) => {
...@@ -209,7 +219,10 @@ describe('ACTS_WifiTest', function () { ...@@ -209,7 +219,10 @@ describe('ACTS_WifiTest', function () {
var discon = wifi.disconnect(); var discon = wifi.disconnect();
except(discon).assertTrue(); except(discon).assertTrue();
sleep(3000); sleep(3000);
var disable = wifi.disableWifi(); var disable = wifi.disableWifi();
sleep(30000);
console.log("[wifi_test] wifi active result: " + disable);
except(disable).assertTrue(); except(disable).assertTrue();
}); });
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册