Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
28aa6075
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
28aa6075
编写于
3月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2321 【communication】add WIFI testcase1
Merge pull request !2321 from 权力/cherry-pick-1646884903
上级
6b17b167
c1118b18
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
420 addition
and
60 deletion
+420
-60
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
...uetooth_ble/src/main/js/default/test/BluetoothBle.test.js
+20
-15
communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
...bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
+21
-16
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
...tooth_standard/src/main/js/default/test/Bluetooth.test.js
+20
-3
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
.../wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
+10
-6
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+349
-20
未找到文件。
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
浏览文件 @
28aa6075
...
@@ -80,24 +80,29 @@ describe('bluetoothhostTest', function() {
...
@@ -80,24 +80,29 @@ describe('bluetoothhostTest', function() {
*/
*/
it
(
'
bluetooth_classic_enable_bluetooth_001
'
,
0
,
async
function
(
done
)
{
it
(
'
bluetooth_classic_enable_bluetooth_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] enable start
'
);
console
.
info
(
'
[bluetooth_js] enable start
'
);
var
enable
=
bluetooth
.
enableBluetooth
();
var
sta
=
bluetooth
.
getState
();
expect
(
enable
).
assertEqual
(
true
);
switch
(
sta
){
console
.
info
(
'
[bluetooth_js] enable On =
'
+
JSON
.
stringify
(
enable
));
case
0
:
var
enable
=
bluetooth
.
enableBluetooth
();
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
expect
(
enable
).
assertEqual
(
true
);
break
;
case
1
:
console
.
info
(
'
[bluetooth_js] bt turning on:
'
+
JSON
.
stringify
(
sta
));
break
;
case
2
:
console
.
info
(
'
[bluetooth_js] state is On:
'
+
JSON
.
stringify
(
sta
));
break
;
case
3
:
var
enable
=
bluetooth
.
enableBluetooth
();
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
break
;
default
:
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
await
sleep
(
2000
);
await
sleep
(
2000
);
var
state
=
bluetooth
.
getState
();
var
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
console
.
info
(
'
[bluetooth_js]state on:
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_ON
));
console
.
info
(
'
[bluetooth_js]off :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_OFF
));
console
.
info
(
'
[bluetooth_js] turning on :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_TURNING_ON
));
console
.
info
(
'
[bluetooth_js] turning off :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_TURNING_OFF
));
console
.
info
(
'
[bluetooth_js] ble turning on :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_TURNING_ON
));
console
.
info
(
'
[bluetooth_js] ble on:
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_ON
));
console
.
info
(
'
[bluetooth_js] ble turning off :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_TURNING_OFF
));
console
.
info
(
'
bluetooth enable done
'
);
console
.
info
(
'
bluetooth enable done
'
);
done
();
done
();
})
})
...
...
communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
浏览文件 @
28aa6075
...
@@ -66,22 +66,27 @@ describe('bluetoothhostTest', function() {
...
@@ -66,22 +66,27 @@ describe('bluetoothhostTest', function() {
done
();
done
();
}
}
}
}
console
.
info
(
'
[bluetooth_js]state on:
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_ON
));
var
sta
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js]off :
'
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_OFF
));
switch
(
sta
){
console
.
info
(
'
[bluetooth_js] turning on :
'
case
0
:
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_TURNING_ON
));
var
enable
=
bluetooth
.
enableBluetooth
();
console
.
info
(
'
[bluetooth_js] turning off :
'
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_TURNING_OFF
));
expect
(
enable
).
assertEqual
(
true
);
console
.
info
(
'
[bluetooth_js] ble turning on :
'
break
;
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_TURNING_ON
));
case
1
:
console
.
info
(
'
[bluetooth_js] ble on:
'
console
.
info
(
'
[bluetooth_js] bt turning on:
'
+
JSON
.
stringify
(
sta
));
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_ON
));
break
;
console
.
info
(
'
[bluetooth_js] ble turning off :
'
case
2
:
+
JSON
.
stringify
(
bluetooth
.
BluetoothState
.
STATE_BLE_TURNING_OFF
));
console
.
info
(
'
[bluetooth_js] state is On:
'
+
JSON
.
stringify
(
sta
));
var
enable
=
bluetooth
.
enableBluetooth
();
break
;
expect
(
enable
).
assertEqual
(
true
);
case
3
:
console
.
info
(
'
[bluetooth_js] enable On =
'
+
JSON
.
stringify
(
enable
));
var
enable
=
bluetooth
.
enableBluetooth
();
await
sleep
(
4000
);
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
break
;
default
:
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
await
sleep
(
2000
);
var
state
=
bluetooth
.
getState
();
var
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
await
bluetooth
.
off
(
'
stateChange
'
,
result
=>
{
await
bluetooth
.
off
(
'
stateChange
'
,
result
=>
{
...
...
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
28aa6075
...
@@ -73,9 +73,26 @@ describe('bluetoothhostTest', function() {
...
@@ -73,9 +73,26 @@ describe('bluetoothhostTest', function() {
*/
*/
it
(
'
bluetooth_classic_enable_bluetooth_001
'
,
0
,
async
function
(
done
)
{
it
(
'
bluetooth_classic_enable_bluetooth_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] enable start
'
);
console
.
info
(
'
[bluetooth_js] enable start
'
);
var
enable
=
bluetooth
.
enableBluetooth
();
var
sta
=
bluetooth
.
getState
();
expect
(
enable
).
assertEqual
(
true
);
switch
(
sta
){
console
.
info
(
'
[bluetooth_js] enable On =
'
+
JSON
.
stringify
(
enable
));
case
0
:
var
enable
=
bluetooth
.
enableBluetooth
();
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
expect
(
enable
).
assertEqual
(
true
);
break
;
case
1
:
console
.
info
(
'
[bluetooth_js] bt turning on:
'
+
JSON
.
stringify
(
sta
));
break
;
case
2
:
console
.
info
(
'
[bluetooth_js] state is On:
'
+
JSON
.
stringify
(
sta
));
break
;
case
3
:
var
enable
=
bluetooth
.
enableBluetooth
();
console
.
info
(
'
[bluetooth_js] enable0 =
'
+
JSON
.
stringify
(
enable
));
break
;
default
:
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
await
sleep
(
2000
);
await
sleep
(
2000
);
var
state
=
bluetooth
.
getState
();
var
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
console
.
info
(
'
[bluetooth_js] getState On =
'
+
JSON
.
stringify
(
state
));
...
...
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
浏览文件 @
28aa6075
...
@@ -137,7 +137,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -137,7 +137,7 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0003
* @tc.number CONFIG_0003
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0003
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0003
* @tc.desc Test set a invalid hotspot config
* @tc.desc Test set a invalid
band
hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
it
(
'
SUB_Communication_WiFi_Hotspot_Config_0003
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Hotspot_Config_0003
'
,
0
,
async
function
(
done
)
{
...
@@ -200,6 +200,10 @@ describe('ACTS_WifiTest', function() {
...
@@ -200,6 +200,10 @@ describe('ACTS_WifiTest', function() {
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigM1
);
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigM1
);
console
.
log
(
"
[wifi_test] set 65 preSharedKey invalid hotspot config result:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set 65 preSharedKey invalid hotspot config result:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertFalse
();
expect
(
isSuccess1
).
assertFalse
();
console
.
info
(
"
[wifi_test] check band of current band should be 5G.
"
);
var
hotspotConfigS
=
wifi
.
getHotspotConfig
();
console
.
log
(
"
[wifi_test] getHotspotConfig result:
"
+
JSON
.
stringify
(
hotspotConfigS
));
expect
(
hotspotConfigS
.
preSharedKey
.
length
).
assertEqual
(
63
);
done
();
done
();
})
})
...
@@ -296,7 +300,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -296,7 +300,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
();
...
@@ -566,10 +570,10 @@ describe('ACTS_WifiTest', function() {
...
@@ -566,10 +570,10 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] set a psk preSharedKey hotspot config result1:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set a psk preSharedKey hotspot config result1:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
expect
(
isSuccess1
).
assertTrue
();
console
.
log
(
"
[wifi_test] check current hotspot config preSharedKey is 8bit
"
);
console
.
log
(
"
[wifi_test] check current hotspot config preSharedKey is 8bit
"
);
var
config
s
=
wifi
.
getHotspotConfig
();
var
config
=
wifi
.
getHotspotConfig
();
console
.
info
(
"
[wifi_test] getHotspotConfig result ->
"
+
JSON
.
stringify
(
config
s
));
console
.
info
(
"
[wifi_test] getHotspotConfig result ->
"
+
JSON
.
stringify
(
config
));
console
.
info
(
"
ssid:
"
+
config
s
.
ssid
);
console
.
info
(
"
ssid:
"
+
config
.
ssid
);
expect
(
config
s
.
ssid
).
assertEqual
(
'
WIFITEST
'
);
expect
(
config
.
ssid
).
assertEqual
(
'
WIFITEST
'
);
done
();
done
();
})
})
...
...
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
28aa6075
...
@@ -309,8 +309,8 @@ describe('ACTS_WifiTest', function() {
...
@@ -309,8 +309,8 @@ describe('ACTS_WifiTest', function() {
})
})
/**
/**
* @tc.number Config_000
2
* @tc.number Config_000
3
* @tc.name SUB_Communication_WiFi_Sta_Config_000
2
* @tc.name SUB_Communication_WiFi_Sta_Config_000
3
* @tc.desc Test create a PSK SecurityType wifi device config
* @tc.desc Test create a PSK SecurityType wifi device config
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0003
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Config_0003
'
,
0
,
async
function
(
done
)
{
...
@@ -384,7 +384,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -384,7 +384,7 @@ describe('ACTS_WifiTest', function() {
if
(
err
)
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig1 callback:
"
+
JSON
.
stringify
(
netWorkId1
));
console
.
info
(
"
[wifi_test] wifi addDeviceconfig1 callback:
"
+
JSON
.
stringify
(
netWorkId1
));
expect
(
true
).
assertEqual
(
netWorkId1
!=
-
1
);
expect
(
true
).
assertEqual
(
netWorkId1
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
@@ -394,7 +394,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -394,7 +394,6 @@ describe('ACTS_WifiTest', function() {
resolve
()
resolve
()
});
});
})
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
(
err
,
netWorkId2
)
=>
{
(
err
,
netWorkId2
)
=>
{
...
@@ -422,15 +421,15 @@ describe('ACTS_WifiTest', function() {
...
@@ -422,15 +421,15 @@ describe('ACTS_WifiTest', function() {
})
})
/**
/**
* @tc.number Config_000
7
* @tc.number Config_000
5
* @tc.name SUB_Communication_WiFi_Sta_Config_000
7
* @tc.name SUB_Communication_WiFi_Sta_Config_000
5
* @tc.desc Test
update wifi
device config
* @tc.desc Test
disableNetwork
device config
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0007
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Config_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_000
7
]
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_000
5
]
"
);
console
.
info
(
"
[wifi_test] create a valid wifi device config start.
"
);
console
.
info
(
"
[wifi_test] create a valid wifi device config start.
"
);
var
wifiDeviceConfig
1
=
{
var
wifiDeviceConfig
D
=
{
"
ssid
"
:
"
TEST
"
,
"
ssid
"
:
"
TEST
D
"
,
"
bssid
"
:
""
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
isHiddenSsid
"
:
false
,
...
@@ -443,8 +442,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -443,8 +442,7 @@ describe('ACTS_WifiTest', function() {
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
};
await
wifi
.
addDeviceConfig
(
wifiDeviceConfigD
)
await
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
)
.
then
(
netWorkId
=>
{
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add PSK Deviceconfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
console
.
info
(
"
[wifi_test]add PSK Deviceconfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
...
@@ -454,19 +452,61 @@ describe('ACTS_WifiTest', function() {
...
@@ -454,19 +452,61 @@ describe('ACTS_WifiTest', function() {
var
disconNet
=
wifi
.
disableNetwork
(
netWorkId
);
var
disconNet
=
wifi
.
disableNetwork
(
netWorkId
);
console
.
log
(
"
[wifi_test] wifi disableNetwork result:
"
+
disconNet
);
console
.
log
(
"
[wifi_test] wifi disableNetwork result:
"
+
disconNet
);
expect
(
disconNet
).
assertTrue
();
expect
(
disconNet
).
assertTrue
();
console
.
info
(
"
[wifi_test] check device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi device config result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
[
0
].
ssid
==
wifiDeviceConfigD
.
ssid
);
console
.
info
(
"
[wifi_test] remove config
"
);
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test]remove config,current get Config :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
});
done
()
})
/**
* @tc.number Config_0006
* @tc.name SUB_Communication_WiFi_Sta_Config_0006
* @tc.desc Test update wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0006
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0006]
"
);
console
.
info
(
"
[wifi_test] create a valid wifi device config start.
"
);
var
wifiDeviceConfigU
=
{
"
ssid
"
:
"
TEST
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
await
wifi
.
addDeviceConfig
(
wifiDeviceConfigU
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add PSK Deviceconfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result1 :
"
+
JSON
.
stringify
(
configs
));
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result1 :
"
+
JSON
.
stringify
(
configs
));
wifiDeviceConfig
1
.
ssid
=
"
UPDATE
"
;
wifiDeviceConfig
U
.
ssid
=
"
UPDATE
"
;
wifiDeviceConfig
1
.
preSharedKey
=
"
1234567890
"
;
wifiDeviceConfig
U
.
preSharedKey
=
"
1234567890
"
;
console
.
info
(
"
[wifi_test] wifi new wifiDeviceConfig1:
"
+
wifi
.
updateNetwork
(
wifiDeviceConfig
1
));
console
.
info
(
"
[wifi_test] wifi new wifiDeviceConfig1:
"
+
wifi
.
updateNetwork
(
wifiDeviceConfig
U
));
console
.
info
(
"
[wifi_test] check update device configs successfully
"
);
console
.
info
(
"
[wifi_test] check update device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] updated wifi device config result :
"
+
JSON
.
stringify
(
configs
));
console
.
info
(
"
[wifi_test] updated wifi device config result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
[
1
].
ssid
==
wifiDeviceConfig
1
.
ssid
);
expect
(
true
).
assertEqual
(
configs
[
1
].
ssid
==
wifiDeviceConfig
U
.
ssid
);
expect
(
true
).
assertEqual
(
configs
[
1
].
preSharedKey
==
wifiDeviceConfig
1
.
preSharedKey
);
expect
(
true
).
assertEqual
(
configs
[
1
].
preSharedKey
==
wifiDeviceConfig
U
.
preSharedKey
);
console
.
info
(
"
[wifi_test] remove config
"
);
console
.
info
(
"
[wifi_test] remove config
"
);
var
isRemoved
=
wifi
.
removeAllNetwork
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
...
@@ -484,7 +524,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -484,7 +524,6 @@ describe('ACTS_WifiTest', function() {
* @tc.name SSUB_Communication_WiFi_Sta_Conn_SSID_0001
* @tc.name SSUB_Communication_WiFi_Sta_Conn_SSID_0001
* @tc.desc Test SSID wifi device config
* @tc.desc Test SSID wifi device config
*/
*/
it
(
'
SSUB_Communication_WiFi_Sta_Conn_SSID_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SSUB_Communication_WiFi_Sta_Conn_SSID_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SSUB_Communication_WiFi_Sta_Conn_SSID_0001]
"
);
console
.
info
(
"
[wifi_test][SSUB_Communication_WiFi_Sta_Conn_SSID_0001]
"
);
console
.
info
(
"
[wifi_test] create a contains chinese SSID wifi device config start.
"
);
console
.
info
(
"
[wifi_test] create a contains chinese SSID wifi device config start.
"
);
...
@@ -625,6 +664,51 @@ describe('ACTS_WifiTest', function() {
...
@@ -625,6 +664,51 @@ describe('ACTS_WifiTest', function() {
done
()
done
()
})
})
/**
* @tc.number Config_SSID_0007
* @tc.name SSUB_Communication_WiFi_Sta_Conn_SSID_0007
* @tc.desc Test SSID wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_SSID_0007
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SSUB_Communication_WiFi_Sta_Conn_SSID_0007]
"
);
console
.
info
(
"
[wifi_test] create a kongge SSID wifi device config start.
"
);
var
wifiDeviceConfigT
=
{
"
ssid
"
:
"
test
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
true
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
await
wifi
.
addDeviceConfig
(
wifiDeviceConfigT
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add contains chinese Deviceconfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
console
.
info
(
"
[wifi_test]connectdevice result:
"
+
wifi
.
connectToNetwork
(
netWorkId
));
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result1 :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
[
0
].
ssid
==
wifiDeviceConfigT
.
ssid
);
expect
(
true
).
assertEqual
(
configs
[
0
].
isHiddenSsid
==
wifiDeviceConfigT
.
isHiddenSsid
);
console
.
info
(
"
[wifi_test] remove config
"
);
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test]remove config,current get Config :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
});
done
()
})
/**
/**
* @tc.number SUB_Communication_WiFi_Sta_info_0001
* @tc.number SUB_Communication_WiFi_Sta_info_0001
* @tc.name testgetMacAddress
* @tc.name testgetMacAddress
...
@@ -685,7 +769,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -685,7 +769,7 @@ describe('ACTS_WifiTest', function() {
expect
(
wifi
.
isFeatureSupported
(
result
)).
assertTrue
();
expect
(
wifi
.
isFeatureSupported
(
result
)).
assertTrue
();
})
})
/**
/**
* @tc.number SUB_Communication_WiFi_Sta_info_0005
* @tc.number SUB_Communication_WiFi_Sta_info_0005
* @tc.name testHotspotDualBandSupported
* @tc.name testHotspotDualBandSupported
* @tc.desc Test HotspotDualBandSupported api.
* @tc.desc Test HotspotDualBandSupported api.
...
@@ -800,6 +884,251 @@ describe('ACTS_WifiTest', function() {
...
@@ -800,6 +884,251 @@ describe('ACTS_WifiTest', function() {
await
sleep
(
2000
);
await
sleep
(
2000
);
})
})
/**
* @tc.number Conn_Security_0001
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0001
* @tc.desc Test connectToDevice 10 bits WEP Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0001]
"
);
console
.
info
(
"
[wifi_test] create WEP SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST10
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
ABCDEF1234
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_WEP
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0003
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0003
* @tc.desc Test connectToDevice 26 bits WEP Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0003]
"
);
console
.
info
(
"
[wifi_test] create WEP SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST26
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678901234567890123456
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_WEP
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0005
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0005
* @tc.desc Test connectToDevice 5bits ASCLL WEP Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0005]
"
);
console
.
info
(
"
[wifi_test] create WEP SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST5
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
aB1@g
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_WEP
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0007
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0007
* @tc.desc Test connectToDevice 13bits ASCLL WEP Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0007
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0007]
"
);
console
.
info
(
"
[wifi_test] create WEP SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST7
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
1234aA@fFgGzZ
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_WEP
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0013
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0013
* @tc.desc Test connectToDevice 63bits ASCLL PSK Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0013
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0013]
"
);
console
.
info
(
"
[wifi_test] create 63bits PSK SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST13
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH1234567
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0014
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0014
* @tc.desc Test connectToDevice 8bits ASCLL PSK Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0014
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0014]
"
);
console
.
info
(
"
[wifi_test] create 8bits PSK SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST13
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
ABCDEFGH
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
* @tc.number Conn_Security_0015
* @tc.name SUB_Communication_WiFi_Sta_Conn_Security_0015
* @tc.desc Test connectToDevice 63bits ASCLL PSK Deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Security_0015
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Security_0015]
"
);
console
.
info
(
"
[wifi_test] create 63bits PSK SecurityType wifi device config start.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST13
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH1234567
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
done
()
})
/**
/**
* @tc.number Conn_Info_0003
* @tc.number Conn_Info_0003
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0003
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0003
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录