From 81fb0a11593ed35361defb6b4f62051fe6e8df36 Mon Sep 17 00:00:00 2001 From: q00313334 Date: Tue, 16 Nov 2021 20:30:09 +0800 Subject: [PATCH] fixed b6fc8f0 from https://gitee.com/q00313334/xts_acts/pulls/1091 wifijs testcase modified2 Signed-off-by: q00313334 --- .../src/main/js/default/test/WifiSta.test.js | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js b/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js index f042520f9..04e202679 100755 --- a/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js +++ b/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js @@ -54,16 +54,23 @@ describe('ACTS_WifiTest', function () { afterEach(function () { }) - - /** + + /** * @tc.number wifi_native_js_unit_test_001 - * @tc.name Test wifi.isWifiActive. - * @tc.desc Test wifi.isWifiActive API functionality. + * @tc.name Test wifi.isWifiEnable. + * @tc.desc Test wifi.isWifiEnable API functionality. */ it('wifi_native_js_unit_test_001', 0, function () { - console.info("[wifi_test] wifi active test."); - var isactive = wifi.isWifiActive(); - expect(isactive).assertTrue(); + console.info("[wifi_test] wifi open test."); + var active = wifi.isWifiActive(); + 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 () { it('wifi_native_js_unit_test_007', 0, async function (done) { console.info('[wifi_test] wifi add device config test[1]'); var active = wifi.isWifiActive(); + sleep(30000); + console.log("[wifi_test] wifi active result: " + active); if(!active){ var enable = wifi.enableWifi(); + sleep(3000); except(enable).assertTrue(); - sleep(3000); + } wifi.addDeviceConfig(wifiConfig, (result) => { @@ -209,7 +219,10 @@ describe('ACTS_WifiTest', function () { var discon = wifi.disconnect(); except(discon).assertTrue(); sleep(3000); + var disable = wifi.disableWifi(); + sleep(30000); + console.log("[wifi_test] wifi active result: " + disable); except(disable).assertTrue(); }); done(); -- GitLab