diff --git a/communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js b/communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js index 86ee62e76d659923eb6ca4e9eb047f4154b7500d..fd574f87c4b18d194c232a5c93864cc519f6d2ab 100644 --- a/communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js +++ b/communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js @@ -121,7 +121,6 @@ describe('bluetoothhostTest', function() { }); console.info('[bluetooth_js] discovery end'); done(); - await sleep(2000); }) diff --git a/communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js b/communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js index e0b02c9c808d206c6cfb58094fd1218b4a14025d..fa7583e1efdf4113a892f06c8b66b8fb704ae56f 100644 --- a/communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js +++ b/communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js @@ -820,6 +820,7 @@ describe('bluetoothhostTest', function() { console.info('[bluetooth_js] setLocalName end'); }) + /** * @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_SET_LOCAL_NAME_00014 * @tc.name testsetLocalName @@ -829,7 +830,7 @@ describe('bluetoothhostTest', function() { * @tc.type Function * @tc.level Level 2 */ - it('bluetooth_classic_set_local_name14', 0, async function (done) { + it('bluetooth_classic_set_local_name14', 0, function () { console.info('[bluetooth_js] set localname start'); var name = bluetooth.setLocalName('0123456789012345678901234567890123456789012345678901' +'23456789012345678901234567890123456789012345678901234567890123456789012345678012' @@ -838,14 +839,29 @@ describe('bluetoothhostTest', function() { expect(name).assertTrue(); var localName = bluetooth.getLocalName(); console.info('[bluetooth_js] getLocalName result14 = ' + JSON.stringify(localName)); + console.info('[bluetooth_js] setLocalName end'); + }) + + + /** + * @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_DISABLE_0001 + * @tc.name testdisablebluetooth + * @tc.desc Test disablebluetooth api. + * @tc.author zhangyujie zwx1079266 + * @tc.size MEDIUM + * @tc.type Function + * @tc.level Level 2 + */ + + it('bluetooth_classic_disable_bluetooth', 0, function () { + console.info('[bluetooth_js] disable test start'); let disable = bluetooth.disableBluetooth(); console.info('[bluetooth_js] disable:' + JSON.stringify(disable)); expect(disable).assertTrue(); - await sleep(2000); - console.info('[bluetooth_js] setLocalName end'); - done(); + var state = bluetooth.getState(); + console.info('[bluetooth_js] bt state:' + JSON.stringify(state)); + console.info('[bluetooth_js] disable end'); }) - }) diff --git a/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js b/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js index bf0012f1496f1e19c59328347dfb05432cc2de73..130eca64741a3be398bffc612f7ad35eae0f132e 100644 --- a/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js +++ b/communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js @@ -296,7 +296,7 @@ describe('ACTS_WifiTest', function() { console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); var config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); - console.info("preSharedKey: " + config.ssid); + console.info("ssid: " + config.ssid); expect(config.ssid.length).assertEqual(32); done(); @@ -355,7 +355,7 @@ describe('ACTS_WifiTest', function() { console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); var config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); - console.info("preSharedKey: " + config.ssid); + console.info("ssid: " + config.ssid); expect(true).assertEqual(config.ssid==HotspotConfigC.ssid); }) @@ -440,8 +440,8 @@ describe('ACTS_WifiTest', function() { console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); var config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); - console.info("preSharedKey: " + config.ssid); - expect(config.preSharedKey).assertEqual(3); + console.info("ssid: " + config.ssid); + expect(config.securityType).assertEqual(3); console.log("[wifi_test] check the state of Hotspot" ); var isHotspotActive = wifi.isHotspotActive(); console.info("[wifi_test] isHotspotActive -> " + isHotspotActive); @@ -478,8 +478,8 @@ describe('ACTS_WifiTest', function() { console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); var config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); - console.info("preSharedKey: " + config.ssid); - expect(config.preSharedKey).assertEqual(1); + console.info("ssid: " + config.ssid); + expect(config.securityType).assertEqual(1); done(); }) @@ -513,7 +513,7 @@ describe('ACTS_WifiTest', function() { console.log("[wifi_test] check current hotspot config maxConn is 8 " ); var config = wifi.getHotspotConfig(); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); - console.info("ssid: " + config.maxConn); + console.info("maxConn: " + config.maxConn); expect(config.maxConn).assertEqual(8); console.log("[wifi_test] set more maxConn invalid hotspot config" ); 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 6c92dcc4235b8c08dabb993ad5521476d5bb65d6..2714f67c6a41f22863cb96e502cb4afd0b6ee0e9 100644 --- a/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js +++ b/communication/wifi_standard/src/main/js/default/test/WifiSta.test.js @@ -753,7 +753,6 @@ describe('ACTS_WifiTest', function() { "staticIp": {"ipAddress": 1284752956,"gateway": 1284752936}, }; var result1 = wifi.connectToDevice(wifiDeviceConfigIp); - await sleep(2000); console.log("[wifi_test] wifi connectToDevice result: " + result1); expect(result1).assertTrue(); console.info("[wifi_test] check isconnected wifi");