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

!2261 【communication】修改WIFI、BT JS L2测试用例

Merge pull request !2261 from 权力/myfeature1
......@@ -121,7 +121,6 @@ describe('bluetoothhostTest', function() {
});
console.info('[bluetooth_js] discovery end');
done();
await sleep(2000);
})
......
......@@ -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');
})
})
......@@ -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" );
......
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册