未验证 提交 41331d8a 编写于 作者: O openharmony_ci 提交者: Gitee

!2262 【communication】add WIF、BT JS L2 testcase

Merge pull request !2262 from 权力/cherry-pick-1646724011
...@@ -121,7 +121,6 @@ describe('bluetoothhostTest', function() { ...@@ -121,7 +121,6 @@ describe('bluetoothhostTest', function() {
}); });
console.info('[bluetooth_js] discovery end'); console.info('[bluetooth_js] discovery end');
done(); done();
await sleep(2000);
}) })
......
...@@ -820,6 +820,7 @@ describe('bluetoothhostTest', function() { ...@@ -820,6 +820,7 @@ describe('bluetoothhostTest', function() {
console.info('[bluetooth_js] setLocalName end'); console.info('[bluetooth_js] setLocalName end');
}) })
/** /**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_SET_LOCAL_NAME_00014 * @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_SET_LOCAL_NAME_00014
* @tc.name testsetLocalName * @tc.name testsetLocalName
...@@ -829,7 +830,7 @@ describe('bluetoothhostTest', function() { ...@@ -829,7 +830,7 @@ describe('bluetoothhostTest', function() {
* @tc.type Function * @tc.type Function
* @tc.level Level 2 * @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'); console.info('[bluetooth_js] set localname start');
var name = bluetooth.setLocalName('0123456789012345678901234567890123456789012345678901' var name = bluetooth.setLocalName('0123456789012345678901234567890123456789012345678901'
+'23456789012345678901234567890123456789012345678901234567890123456789012345678012' +'23456789012345678901234567890123456789012345678901234567890123456789012345678012'
...@@ -838,14 +839,29 @@ describe('bluetoothhostTest', function() { ...@@ -838,14 +839,29 @@ describe('bluetoothhostTest', function() {
expect(name).assertTrue(); expect(name).assertTrue();
var localName = bluetooth.getLocalName(); var localName = bluetooth.getLocalName();
console.info('[bluetooth_js] getLocalName result14 = ' + JSON.stringify(localName)); 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(); let disable = bluetooth.disableBluetooth();
console.info('[bluetooth_js] disable:' + JSON.stringify(disable)); console.info('[bluetooth_js] disable:' + JSON.stringify(disable));
expect(disable).assertTrue(); expect(disable).assertTrue();
await sleep(2000); var state = bluetooth.getState();
console.info('[bluetooth_js] setLocalName end'); console.info('[bluetooth_js] bt state:' + JSON.stringify(state));
done(); console.info('[bluetooth_js] disable end');
}) })
}) })
...@@ -296,7 +296,7 @@ describe('ACTS_WifiTest', function() { ...@@ -296,7 +296,7 @@ describe('ACTS_WifiTest', function() {
console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" );
var config = wifi.getHotspotConfig(); var config = wifi.getHotspotConfig();
console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); 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); expect(config.ssid.length).assertEqual(32);
done(); done();
...@@ -355,7 +355,7 @@ describe('ACTS_WifiTest', function() { ...@@ -355,7 +355,7 @@ describe('ACTS_WifiTest', function() {
console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" );
var config = wifi.getHotspotConfig(); var config = wifi.getHotspotConfig();
console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); 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); expect(true).assertEqual(config.ssid==HotspotConfigC.ssid);
}) })
...@@ -440,8 +440,8 @@ describe('ACTS_WifiTest', function() { ...@@ -440,8 +440,8 @@ describe('ACTS_WifiTest', function() {
console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" );
var config = wifi.getHotspotConfig(); var config = wifi.getHotspotConfig();
console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config));
console.info("preSharedKey: " + config.ssid); console.info("ssid: " + config.ssid);
expect(config.preSharedKey).assertEqual(3); expect(config.securityType).assertEqual(3);
console.log("[wifi_test] check the state of Hotspot" ); console.log("[wifi_test] check the state of Hotspot" );
var isHotspotActive = wifi.isHotspotActive(); var isHotspotActive = wifi.isHotspotActive();
console.info("[wifi_test] isHotspotActive -> " + isHotspotActive); console.info("[wifi_test] isHotspotActive -> " + isHotspotActive);
...@@ -478,8 +478,8 @@ describe('ACTS_WifiTest', function() { ...@@ -478,8 +478,8 @@ describe('ACTS_WifiTest', function() {
console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" ); console.log("[wifi_test] check current hotspot config preSharedKey is 8bit" );
var config = wifi.getHotspotConfig(); var config = wifi.getHotspotConfig();
console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config));
console.info("preSharedKey: " + config.ssid); console.info("ssid: " + config.ssid);
expect(config.preSharedKey).assertEqual(1); expect(config.securityType).assertEqual(1);
done(); done();
}) })
...@@ -513,7 +513,7 @@ describe('ACTS_WifiTest', function() { ...@@ -513,7 +513,7 @@ describe('ACTS_WifiTest', function() {
console.log("[wifi_test] check current hotspot config maxConn is 8 " ); console.log("[wifi_test] check current hotspot config maxConn is 8 " );
var config = wifi.getHotspotConfig(); var config = wifi.getHotspotConfig();
console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config)); console.info("[wifi_test] getHotspotConfig result -> " + JSON.stringify(config));
console.info("ssid: " + config.maxConn); console.info("maxConn: " + config.maxConn);
expect(config.maxConn).assertEqual(8); expect(config.maxConn).assertEqual(8);
console.log("[wifi_test] set more maxConn invalid hotspot config" ); console.log("[wifi_test] set more maxConn invalid hotspot config" );
......
...@@ -753,7 +753,6 @@ describe('ACTS_WifiTest', function() { ...@@ -753,7 +753,6 @@ describe('ACTS_WifiTest', function() {
"staticIp": {"ipAddress": 1284752956,"gateway": 1284752936}, "staticIp": {"ipAddress": 1284752956,"gateway": 1284752936},
}; };
var result1 = wifi.connectToDevice(wifiDeviceConfigIp); var result1 = wifi.connectToDevice(wifiDeviceConfigIp);
await sleep(2000);
console.log("[wifi_test] wifi connectToDevice result: " + result1); console.log("[wifi_test] wifi connectToDevice result: " + result1);
expect(result1).assertTrue(); expect(result1).assertTrue();
console.info("[wifi_test] check isconnected wifi"); console.info("[wifi_test] check isconnected wifi");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册