Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6cdd25de
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看板
未验证
提交
6cdd25de
编写于
3月 02, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2123 【communication】修改暂不执行P2P的用例
Merge pull request !2123 from 权力/myfeature1
上级
74c8062f
18a6f0b6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
144 addition
and
412 deletion
+144
-412
communication/wifi_standard/src/main/js/default/test/List.test.js
...ation/wifi_standard/src/main/js/default/test/List.test.js
+1
-0
communication/wifi_standard/src/main/js/default/test/WifiP2P.test.js
...on/wifi_standard/src/main/js/default/test/WifiP2P.test.js
+6
-6
communication/wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
...wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
+69
-188
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+68
-218
未找到文件。
communication/wifi_standard/src/main/js/default/test/List.test.js
浏览文件 @
6cdd25de
...
@@ -16,3 +16,4 @@ require('./WifiSta.test.js')
...
@@ -16,3 +16,4 @@ require('./WifiSta.test.js')
require
(
'
./WifiSoftAP.test.js
'
)
require
(
'
./WifiSoftAP.test.js
'
)
require
(
'
./WifiP2P.test.js
'
)
require
(
'
./WifiP2P.test.js
'
)
communication/wifi_standard/src/main/js/default/test/WifiP2P.test.js
浏览文件 @
6cdd25de
...
@@ -262,7 +262,8 @@ describe('ACTS_WifiTest', function () {
...
@@ -262,7 +262,8 @@ describe('ACTS_WifiTest', function () {
expect
(
true
).
assertEqual
(
data
.
length
!=
0
);
expect
(
true
).
assertEqual
(
data
.
length
!=
0
);
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test]getP2pLinkedInfo promise then error.
"
+
JSON
.
stringify
(
error
));
console
.
info
(
"
[wifi_test]getP2pLinkedInfo promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
expect
(
error
).
assertFail
();
});
});
wifi
.
getP2pLinkedInfo
((
err
,
result
)
=>
{
wifi
.
getP2pLinkedInfo
((
err
,
result
)
=>
{
if
(
err
)
{
if
(
err
)
{
...
@@ -273,12 +274,11 @@ describe('ACTS_WifiTest', function () {
...
@@ -273,12 +274,11 @@ describe('ACTS_WifiTest', function () {
console
.
info
(
"
connectState:
"
+
result
.
connectState
);
console
.
info
(
"
connectState:
"
+
result
.
connectState
);
console
.
info
(
"
isGroupOwner:
"
+
result
.
isGroupOwner
);
console
.
info
(
"
isGroupOwner:
"
+
result
.
isGroupOwner
);
console
.
info
(
"
groupOwnerAddr:
"
+
result
.
groupOwnerAddr
);
console
.
info
(
"
groupOwnerAddr:
"
+
result
.
groupOwnerAddr
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
CONNECTED
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
CONNECTED
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
DISCONNECTED
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
DISCONNECTED
);
done
();
});
});
done
();
})
})
/**
/**
...
...
communication/wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
浏览文件 @
6cdd25de
...
@@ -69,49 +69,16 @@ describe('ACTS_WifiTest', function() {
...
@@ -69,49 +69,16 @@ describe('ACTS_WifiTest', function() {
}
}
var
close
=
wifi
.
isWifiActive
();
var
close
=
wifi
.
isWifiActive
();
console
.
info
(
"
[wifi_test] wifi status result:
"
+
close
);
console
.
info
(
"
[wifi_test] wifi status result:
"
+
close
);
expect
(
close
).
assertTrue
();
expect
(
close
).
assertFalse
();
if
(
wifi
.
isHotspotActive
())
{
if
(
!
wifi
.
isHotspotActive
())
{
var
off
=
wifi
.
disableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
expect
(
off
).
assertTrue
();
}
console
.
info
(
'
[wifi_test] test enableHotspot and disableHotspot
'
);
var
enHot
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
enHot
);
expect
(
wifi
.
isHotspotActive
()).
assertTrue
();
var
disHot
=
wifi
.
disableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
disHot
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
wifi
.
isHotspotActive
());
expect
(
wifi
.
isHotspotActive
()).
assertFalse
();
console
.
info
(
"
[wifi_test] enableHotspot and disableHotspot test end.
"
);
})
/**
* @tc.number OPEN_0003
* @tc.name SUB_Communication_WiFi_Hotspot_Open_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test open Hotspot after open wifi
* @tc.level Level 1
*/
it
(
'
SUB_Communication_WiFi_Hotspot_Open_0003
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] SUB_Communication_WiFi_Hotspot_Open_0003
"
);
if
(
wifi
.
isHotspotActive
())
{
console
.
info
(
"
[wifi_test] close Hotspot test start.
"
);
var
off
=
wifi
.
disableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
expect
(
off
).
assertTrue
();
}
console
.
info
(
'
[wifi_test] test close wifi and enableHotspot start
'
);
var
on
=
wifi
.
enableHotspot
();
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
info
(
"
[wifi_test] AP status result ->
"
+
wifi
.
isHotspotActive
());
expect
(
wifi
.
isHotspotActive
()).
assertTrue
();
expect
(
wifi
.
isHotspotActive
()).
assertTrue
();
expect
(
wifi
.
isWifiActive
()).
assertFalse
();
console
.
info
(
"
[wifi_test] enableHotspot and close wifi test end.
"
);
})
})
/**
/**
...
@@ -130,23 +97,12 @@ describe('ACTS_WifiTest', function() {
...
@@ -130,23 +97,12 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
expect
(
off
).
assertTrue
();
expect
(
off
).
assertTrue
();
}
}
console
.
info
(
"
[wifi_test] AP status result ->
"
+
wifi
.
isHotspotActive
());
expect
(
wifi
.
isHotspotActive
()).
assertFalse
();
var
isSuccess
=
wifi
.
setHotspotConfig
(
HotspotConfig
);
var
isSuccess
=
wifi
.
setHotspotConfig
(
HotspotConfig
);
console
.
log
(
"
[wifi_test] set 2.4G hotspot config result:
"
+
isSuccess
);
console
.
log
(
"
[wifi_test] set 2.4G hotspot config result:
"
+
isSuccess
);
expect
(
isSuccess
).
assertTrue
();
expect
(
isSuccess
).
assertTrue
();
console
.
info
(
"
[wifi_test] check the state of hotspot, if it's inactive, open it.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
console
.
info
(
"
[wifi_test] open Hotspot test start.
"
);
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_js] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
info
(
"
[wifi_test] check band of current band should be 2.4G.
"
);
console
.
info
(
"
[wifi_test] check band of current band should be 2.4G.
"
);
var
hotspotConfig
=
wifi
.
getHotspotConfig
();
var
hotspotConfig
=
wifi
.
getHotspotConfig
();
console
.
log
(
"
[wifi_test] getHotspotConfig result:
"
+
JSON
.
stringify
(
hotspotConfig
));
console
.
log
(
"
[wifi_test] getHotspotConfig result:
"
+
JSON
.
stringify
(
hotspotConfig
));
...
@@ -156,7 +112,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -156,7 +112,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0002
* @tc.number CONFIG_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid 5G hotspot config
* @tc.desc Test set a valid 5G hotspot config
* @tc.level Level 1
* @tc.level Level 1
*/
*/
...
@@ -179,18 +134,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -179,18 +134,6 @@ describe('ACTS_WifiTest', function() {
var
isSuccess5
=
wifi
.
setHotspotConfig
(
HotspotConfig5G
);
var
isSuccess5
=
wifi
.
setHotspotConfig
(
HotspotConfig5G
);
console
.
log
(
"
[wifi_test] set 5G hotspot config result1:
"
+
isSuccess5
);
console
.
log
(
"
[wifi_test] set 5G hotspot config result1:
"
+
isSuccess5
);
expect
(
isSuccess5
).
assertFalse
();
expect
(
isSuccess5
).
assertFalse
();
console
.
info
(
"
[wifi_test] check the state of hotspot, if it's inactive, open it.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
console
.
info
(
"
[wifi_test] open Hotspot test start.
"
);
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
info
(
"
[wifi_test] check band of current band should be 5G.
"
);
console
.
info
(
"
[wifi_test] check band of current band should be 5G.
"
);
var
hotspotConfig5
=
wifi
.
getHotspotConfig
();
var
hotspotConfig5
=
wifi
.
getHotspotConfig
();
console
.
log
(
"
[wifi_test] getHotspotConfig result:
"
+
JSON
.
stringify
(
hotspotConfig5
));
console
.
log
(
"
[wifi_test] getHotspotConfig result:
"
+
JSON
.
stringify
(
hotspotConfig5
));
...
@@ -200,7 +143,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -200,7 +143,6 @@ 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.author wudangping wwx1075776
* @tc.desc Test set a invalid hotspot config
* @tc.desc Test set a invalid hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -208,7 +150,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -208,7 +150,7 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] set a invalid hotspot config start.
"
);
console
.
info
(
"
[wifi_test] set a invalid hotspot config start.
"
);
if
(
wifi
.
isHotspotActive
())
{
if
(
wifi
.
isHotspotActive
())
{
var
off
=
wifi
.
disableHotspot
();
var
off
=
wifi
.
disableHotspot
();
sleep
(
5
000
);
sleep
(
10
000
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
console
.
info
(
"
[wifi_test] disableHotspot result ->
"
+
off
);
expect
(
off
).
assertTrue
();
expect
(
off
).
assertTrue
();
}
}
...
@@ -228,7 +170,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -228,7 +170,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0004
* @tc.number CONFIG_0004
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0004
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0004
* @tc.author wudangping wwx1075776
* @tc.desc Test set a max preSharedKey is hotspot config
* @tc.desc Test set a max preSharedKey is hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -252,17 +193,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -252,17 +193,6 @@ describe('ACTS_WifiTest', function() {
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigM
);
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigM
);
console
.
log
(
"
[wifi_test] set max preSharedKey valid hotspot config result:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set max preSharedKey valid hotspot config result:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
expect
(
isSuccess1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check the state of hotspot, if it's inactivated, open it.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
log
(
"
[wifi_test] set 65 preSharedKey invalid hotspot config
"
);
console
.
log
(
"
[wifi_test] set 65 preSharedKey invalid hotspot config
"
);
var
HotspotConfigM1
=
{
var
HotspotConfigM1
=
{
"
ssid
"
:
"
testWgr
"
,
"
ssid
"
:
"
testWgr
"
,
...
@@ -279,7 +209,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -279,7 +209,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0005
* @tc.number CONFIG_0005
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0005
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0005
* @tc.author wudangping wwx1075776
* @tc.desc Test set a min preSharedKey is hotspot config
* @tc.desc Test set a min preSharedKey is hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -328,7 +257,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -328,7 +257,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0006
* @tc.number CONFIG_0006
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0006
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0006
* @tc.author wudangping wwx1075776
* @tc.desc Test set a max ssid for hotspot config
* @tc.desc Test set a max ssid for hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -337,9 +265,13 @@ describe('ACTS_WifiTest', function() {
...
@@ -337,9 +265,13 @@ describe('ACTS_WifiTest', function() {
if
(
wifi
.
isHotspotActive
())
{
if
(
wifi
.
isHotspotActive
())
{
var
off
=
wifi
.
disableHotspot
();
var
off
=
wifi
.
disableHotspot
();
sleep
(
5000
);
sleep
(
5000
);
console
.
info
(
"
[wifi_
js
] disableHotspot result ->
"
+
off
);
console
.
info
(
"
[wifi_
test
] disableHotspot result ->
"
+
off
);
expect
(
on2
).
assertTrue
();
expect
(
on2
).
assertTrue
();
}
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertFalse
();
console
.
log
(
"
[wifi_test] set max ssid invalid hotspot config
"
);
console
.
log
(
"
[wifi_test] set max ssid invalid hotspot config
"
);
var
HotspotConfigS
=
{
var
HotspotConfigS
=
{
"
ssid
"
:
"
testWgr123testWgr123testWgr12356
"
,
"
ssid
"
:
"
testWgr123testWgr123testWgr12356
"
,
...
@@ -351,13 +283,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -351,13 +283,7 @@ describe('ACTS_WifiTest', function() {
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigS
);
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigS
);
console
.
log
(
"
[wifi_test] set 32bit ssid invalid hotspot config result:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set 32bit ssid invalid hotspot config result:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
expect
(
isSuccess1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check the state of hotspot, if it's inactivated, open it.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
var
on2
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on2
);
expect
(
on2
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] set 33bit ssid invalid hotspot config
"
);
console
.
log
(
"
[wifi_test] set 33bit ssid invalid hotspot config
"
);
var
HotspotConfigS1
=
{
var
HotspotConfigS1
=
{
"
ssid
"
:
"
testWgr123testWgr123testWgr123567
"
,
"
ssid
"
:
"
testWgr123testWgr123testWgr123567
"
,
...
@@ -370,17 +296,11 @@ describe('ACTS_WifiTest', function() {
...
@@ -370,17 +296,11 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] set 33bit ssid invalid hotspot config result:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set 33bit ssid invalid hotspot config result:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertFalse
();
expect
(
isSuccess1
).
assertFalse
();
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
})
})
/**
/**
* @tc.number CONFIG_0007
* @tc.number CONFIG_0007
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0007
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0007
* @tc.author wudangping wwx1075776
* @tc.desc Test set a null ssid invalid hotspot config
* @tc.desc Test set a null ssid invalid hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -406,7 +326,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -406,7 +326,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0008
* @tc.number CONFIG_0008
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0008
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0008
* @tc.author wudangping wwx1075776
* @tc.desc Test set a contains Chinese.special.digits valid hotspot config
* @tc.desc Test set a contains Chinese.special.digits valid hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -423,22 +342,15 @@ describe('ACTS_WifiTest', function() {
...
@@ -423,22 +342,15 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] set a valid hotspot config result1:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set a valid hotspot config result1:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
expect
(
isSuccess1
).
assertTrue
();
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
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
);
expect
(
isHotspotActive
).
assert
Tru
e
();
expect
(
isHotspotActive
).
assert
Fals
e
();
})
})
/**
/**
* @tc.number CONFIG_0009
* @tc.number CONFIG_0009
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0009
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0009
* @tc.author wudangping wwx1075776
* @tc.desc Test set a invalid preSharedKey hotspot config
* @tc.desc Test set a invalid preSharedKey hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -489,7 +401,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -489,7 +401,6 @@ describe('ACTS_WifiTest', function() {
/**
/**
* @tc.number CONFIG_0010
* @tc.number CONFIG_0010
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0010
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0010
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid PSK preSharedKey hotspot config
* @tc.desc Test set a valid PSK preSharedKey hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -514,25 +425,16 @@ describe('ACTS_WifiTest', function() {
...
@@ -514,25 +425,16 @@ describe('ACTS_WifiTest', function() {
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigPSK
);
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigPSK
);
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
();
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
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
);
expect
(
isHotspotActive
).
assert
Tru
e
();
expect
(
isHotspotActive
).
assert
Fals
e
();
})
})
/**
/**
* @tc.number CONFIG_0011
* @tc.number CONFIG_0011
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0011
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0011
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid OPEN preSharedKey hotspot config
* @tc.desc Test set a valid OPEN preSharedKey hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -556,71 +458,11 @@ describe('ACTS_WifiTest', function() {
...
@@ -556,71 +458,11 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] set a open preSharedKey hotspot config result1:
"
+
isSuccess1
);
console
.
log
(
"
[wifi_test] set a open preSharedKey hotspot config result1:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
expect
(
isSuccess1
).
assertTrue
();
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
})
/**
* @tc.number CONFIG_0012
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0012
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid hotspot config after open Hotspot
* @tc.level Level 2
*/
it
(
'
SUB_Communication_WiFi_Hotspot_Config_0012
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] wifi enableHotspot start.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
info
(
"
[wifi_test] open Hotspot, set valid hotspot config start.
"
);
var
HotspotConfigO
=
{
"
ssid
"
:
"
测试3@%&*
"
,
"
band
"
:
1
,
"
preSharedKey
"
:
"
12345678
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
maxConn
"
:
8
}
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigO
);
console
.
log
(
"
[wifi_test] set a PSK preSharedKey hotspot config result1:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check the current config.
"
);
var
config
=
wifi
.
getHotspotConfig
();
console
.
info
(
"
[wifi_test] getHotspotConfig result ->
"
+
JSON
.
stringify
(
config
));
console
.
info
(
"
ssid:
"
+
config
.
ssid
);
console
.
info
(
"
band:
"
+
config
.
band
);
console
.
info
(
"
preSharedKey:
"
+
config
.
preSharedKey
);
console
.
info
(
"
securityType:
"
+
config
.
securityType
);
console
.
info
(
"
maxConn:
"
+
config
.
maxConn
);
console
.
info
(
"
[wifi_test] check the current config is same with set before.
"
);
expect
(
config
.
ssid
).
assertEqual
(
'
测试3@%&*
'
);
expect
(
config
.
band
).
assertEqual
(
1
);
expect
(
config
.
preSharedKey
).
assertEqual
(
'
12345678
'
);
expect
(
config
.
securityType
).
assertEqual
(
3
);
expect
(
config
.
maxConn
).
assertEqual
(
8
);
console
.
info
(
"
[wifi_test] check the state of hotspot, if it's inactivated, open it.
"
);
expect
(
wifi
.
isHotspotActive
()).
assertTrue
();
})
})
/**
/**
* @tc.number CONN_0001
* @tc.number CONN_0001
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0001
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test set a maxConn and more maxConn hotspot config
* @tc.desc Test set a maxConn and more maxConn hotspot config
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -668,10 +510,56 @@ describe('ACTS_WifiTest', function() {
...
@@ -668,10 +510,56 @@ describe('ACTS_WifiTest', function() {
expect
(
config
.
maxConn
).
assertEqual
(
8
);
expect
(
config
.
maxConn
).
assertEqual
(
8
);
})
})
/**
* @tc.number CONFIG_0012
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0012
* @tc.desc Test set a valid hotspot config after open Hotspot
* @tc.level Level 2
*/
it
(
'
SUB_Communication_WiFi_Hotspot_Config_0012
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] wifi enableHotspot start.
"
);
console
.
info
(
"
[wifi_test] SUB_Communication_WiFi_Hotspot_Config_0012.
"
);
if
(
!
wifi
.
isHotspotActive
())
{
var
on
=
wifi
.
enableHotspot
();
sleep
(
5000
);
console
.
info
(
"
[wifi_test] enableHotspot result ->
"
+
on
);
expect
(
on
).
assertTrue
();
}
console
.
log
(
"
[wifi_test] check the state of Hotspot
"
);
var
isHotspotActive
=
wifi
.
isHotspotActive
();
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
info
(
"
[wifi_test] open Hotspot, set valid hotspot config start.
"
);
var
HotspotConfigO
=
{
"
ssid
"
:
"
测试3@%&*
"
,
"
band
"
:
1
,
"
preSharedKey
"
:
"
12345678
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
maxConn
"
:
8
}
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigO
);
console
.
log
(
"
[wifi_test] set a PSK preSharedKey hotspot config result1:
"
+
isSuccess1
);
expect
(
isSuccess1
).
assertTrue
();
console
.
info
(
"
[wifi_test] check the current config.
"
);
var
config
=
wifi
.
getHotspotConfig
();
console
.
info
(
"
[wifi_test] getHotspotConfig result ->
"
+
JSON
.
stringify
(
config
));
console
.
info
(
"
ssid:
"
+
config
.
ssid
);
console
.
info
(
"
band:
"
+
config
.
band
);
console
.
info
(
"
preSharedKey:
"
+
config
.
preSharedKey
);
console
.
info
(
"
securityType:
"
+
config
.
securityType
);
console
.
info
(
"
maxConn:
"
+
config
.
maxConn
);
console
.
info
(
"
[wifi_test] check the current config is same with set before.
"
);
expect
(
config
.
ssid
).
assertEqual
(
'
测试3@%&*
'
);
expect
(
config
.
band
).
assertEqual
(
1
);
expect
(
config
.
preSharedKey
).
assertEqual
(
'
12345678
'
);
expect
(
config
.
securityType
).
assertEqual
(
3
);
expect
(
config
.
maxConn
).
assertEqual
(
8
);
})
/**
/**
* @tc.number CONN_0002
* @tc.number CONN_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test Obtains the list of clients that are connected to a Wi-Fi hotspot.
* @tc.desc Test Obtains the list of clients that are connected to a Wi-Fi hotspot.
* @tc.level Level 2
* @tc.level Level 2
*/
*/
...
@@ -694,14 +582,12 @@ describe('ACTS_WifiTest', function() {
...
@@ -694,14 +582,12 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
ssid:
"
+
stationInfo
.
name
);
console
.
info
(
"
ssid:
"
+
stationInfo
.
name
);
console
.
info
(
"
macAddress:
"
+
stationInfo
.
macAddress
);
console
.
info
(
"
macAddress:
"
+
stationInfo
.
macAddress
);
console
.
info
(
"
ipAddress:
"
+
stationInfo
.
ipAddress
);
console
.
info
(
"
ipAddress:
"
+
stationInfo
.
ipAddress
);
expect
(
config
).
assertEqual
(
8
);
})
})
/**
/**
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0001
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0001
* @tc.name testhotspotStateChangeOn
* @tc.name testhotspotStateChangeOn
* @tc.author wudangping wwx1075776
* @tc.desc Test hotspotStateChangeOn api.
* @tc.desc Test hotspotStateChangeOn api.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
...
@@ -725,7 +611,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -725,7 +611,6 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0002
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0002
* @tc.name testhotspotStateChangeOff
* @tc.name testhotspotStateChangeOff
* @tc.desc Test hotspotStateChange api.
* @tc.desc Test hotspotStateChange api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
...
@@ -748,7 +633,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -748,7 +633,6 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0003
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0003
* @tc.name testhotspotStaJoinOn
* @tc.name testhotspotStaJoinOn
* @tc.desc Test hotspotStaJoinOn api.
* @tc.desc Test hotspotStaJoinOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
...
@@ -771,7 +655,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -771,7 +655,6 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0004
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0004
* @tc.name testhotspotStaJoinOff
* @tc.name testhotspotStaJoinOff
* @tc.desc Test hotspotStaJoin api.
* @tc.desc Test hotspotStaJoin api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
...
@@ -794,7 +677,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -794,7 +677,6 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0005
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0005
* @tc.name testhotspotStaLeaveOn
* @tc.name testhotspotStaLeaveOn
* @tc.desc Test hotspotStaLeaveOn api.
* @tc.desc Test hotspotStaLeaveOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
...
@@ -817,7 +699,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -817,7 +699,6 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0006
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0006
* @tc.name testhotspotStaLeaveOff
* @tc.name testhotspotStaLeaveOff
* @tc.desc Test hotspotStaLeave api.
* @tc.desc Test hotspotStaLeave api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
...
...
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
6cdd25de
...
@@ -98,13 +98,10 @@ describe('ACTS_WifiTest', function() {
...
@@ -98,13 +98,10 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
expect
(
enable
).
assertTrue
();
expect
(
enable
).
assertTrue
();
}
}
console
.
info
(
"
[wifi_test] close wifi test start.
"
);
var
disable
=
wifi
.
disableWifi
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi close result:
"
+
disable
);
expect
(
disable
).
assertTrue
();
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertFalse
();
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
sleep
(
3000
);
})
})
/**
/**
...
@@ -123,7 +120,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -123,7 +120,7 @@ describe('ACTS_WifiTest', function() {
expect
(
enable
).
assertTrue
();
expect
(
enable
).
assertTrue
();
}
}
var
scan
=
wifi
.
scan
();
var
scan
=
wifi
.
scan
();
sleep
(
3
000
);
sleep
(
5
000
);
console
.
log
(
"
[wifi_test] open wifi scan result:
"
+
scan
);
console
.
log
(
"
[wifi_test] open wifi scan result:
"
+
scan
);
expect
(
scan
).
assertTrue
();
expect
(
scan
).
assertTrue
();
...
@@ -144,7 +141,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -144,7 +141,7 @@ describe('ACTS_WifiTest', function() {
}
}
var
clen
=
Object
.
keys
(
result
).
length
;
var
clen
=
Object
.
keys
(
result
).
length
;
console
.
log
(
"
[wifi_test] wifi getScanInfos callback result length:
"
+
clen
);
console
.
log
(
"
[wifi_test] wifi getScanInfos callback result length:
"
+
clen
);
if
(
!
(
clen
==
0
&&
i
<
3
))
{
if
(
!
(
clen
==
0
))
{
expect
(
clen
).
assertLarger
(
0
);
expect
(
clen
).
assertLarger
(
0
);
console
.
info
(
"
[wifi_test] getScanInfos callback result:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_test] getScanInfos callback result:
"
+
JSON
.
stringify
(
result
));
for
(
var
j
=
0
;
j
<
clen
;
++
j
)
{
for
(
var
j
=
0
;
j
<
clen
;
++
j
)
{
...
@@ -211,6 +208,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -211,6 +208,7 @@ describe('ACTS_WifiTest', function() {
it
(
'
SUB_Communication_WiFi_Sta_Config_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Config_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0001]
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0001]
"
);
console
.
info
(
"
[wifi_test] create a OPEN SecurityType wifi device config start.
"
);
console
.
info
(
"
[wifi_test] create a OPEN SecurityType wifi device config start.
"
);
wifi
.
removeAllNetwork
();
var
wifiDeviceConfig1
=
{
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST_OPEN
"
,
"
ssid
"
:
"
TEST_OPEN
"
,
"
bssid
"
:
""
,
"
bssid
"
:
""
,
...
@@ -484,6 +482,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -484,6 +482,7 @@ describe('ACTS_WifiTest', function() {
* @tc.desc Test reconnect wifi
* @tc.desc Test reconnect wifi
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
function
()
{
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Info_0001]
"
);
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
var
wifiDeviceConfigConn
=
{
var
wifiDeviceConfigConn
=
{
"
ssid
"
:
"
TESTCONN
"
,
"
ssid
"
:
"
TESTCONN
"
,
...
@@ -509,10 +508,9 @@ describe('ACTS_WifiTest', function() {
...
@@ -509,10 +508,9 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
expect
(
isConnected
).
assertFalse
();
console
.
info
(
"
[wifi_test] reconnect wifi
"
);
console
.
info
(
"
[wifi_test] reconnect wifi
"
);
var
result
=
wifi
.
reconnect
();
var
reconn
=
wifi
.
reconnect
();
sleep
(
5000
);
console
.
log
(
"
[wifi_test] wifi reconnect result:
"
+
reconn
);
console
.
log
(
"
[wifi_test] wifi reconnect result:
"
+
result
);
expect
(
reconn
).
assertTrue
();
expect
(
result
).
assertTrue
();
console
.
info
(
"
[wifi_test] remove config
"
);
console
.
info
(
"
[wifi_test] remove config
"
);
var
isRemoved
=
wifi
.
removeAllNetwork
();
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
...
@@ -529,41 +527,44 @@ describe('ACTS_WifiTest', function() {
...
@@ -529,41 +527,44 @@ describe('ACTS_WifiTest', function() {
* @tc.author wudangping wwx1075776
* @tc.author wudangping wwx1075776
* @tc.desc Test getLinkedInfo information
* @tc.desc Test getLinkedInfo information
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_000
1
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_000
2
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Info_000
1
]
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Info_000
2
]
"
);
console
.
info
(
'
console.info("[wifi_
js] Wifi get link infos
test[1]."
'
);
console
.
info
(
'
console.info("[wifi_
test] Wifi getlink infos
test[1]."
'
);
wifi
.
getLinkedInfo
()
await
wifi
.
getLinkedInfo
()
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
console
.
info
(
"
[wifi_
js] get wifi
link [promise] ->
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_
test] get wifi
link [promise] ->
"
+
JSON
.
stringify
(
result
));
expect
(
JSON
.
stringify
(
result
)).
assertContain
(
'
band
'
);
expect
(
JSON
.
stringify
(
result
)).
assertContain
(
'
band
'
);
console
.
info
(
"
[wifi_
js
] get wifi link [promise].
"
);
console
.
info
(
"
[wifi_
test
] get wifi link [promise].
"
);
done
();
done
();
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_
js
] promise then error.
"
+
JSON
.
stringify
(
error
));
console
.
info
(
"
[wifi_
test
] promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
expect
().
assertFail
();
});
});
wifi
.
getLinkedInfo
((
err
,
result
)
=>
{
wifi
.
getLinkedInfo
(
if
(
err
)
{
(
err
,
result
)
=>
{
return
console
.
error
(
'
failed to getlink infos callback because
'
+
JSON
.
stringify
(
err
));
if
(
err
)
{
}
else
{
console
.
error
(
'
failed to getlink infos callback because
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
[wifi_test] get wifi link [callback] ->
"
+
JSON
.
stringify
(
result
));
for
(
var
j
=
0
;
j
<
JSON
.
stringify
(
result
).
length
;
++
j
)
{
console
.
info
(
"
ssid:
"
+
result
[
j
].
ssid
);
console
.
info
(
"
bssid:
"
+
result
[
j
].
bssid
);
console
.
info
(
"
band:
"
+
result
[
j
].
band
);
console
.
info
(
"
isHidden:
"
+
result
[
j
].
isHidden
);
console
.
info
(
"
isRestricted:
"
+
result
[
j
].
isRestricted
);
console
.
info
(
"
chload:
"
+
result
[
j
].
chload
);
console
.
info
(
"
rssi
"
+
result
[
j
].
rssi
);
console
.
info
(
"
netWorkId:
"
+
result
[
j
].
netWorkId
);
console
.
info
(
"
linkSpeed:
"
+
result
[
j
].
linkSpeed
);
console
.
info
(
"
frequency:
"
+
result
[
j
].
frequency
);
console
.
info
(
"
snr:
"
+
result
[
j
].
snr
);
console
.
info
(
"
macAddress:
"
+
result
[
j
].
macAddress
);
console
.
info
(
"
ipAddress:
"
+
result
[
j
].
ipAddress
);
console
.
info
(
"
suppState:
"
+
result
[
j
].
suppState
);
console
.
info
(
"
connState:
"
+
result
[
j
].
connState
);
}
}
var
clen
=
Object
.
key
(
result
).
length
;
console
.
info
(
"
[wifi_test] get wifilink callback result length ->
"
+
clen
);
if
(
!
(
clen
==
0
))
{
console
.
info
(
"
[wifi_test] get wifi link [callback] ->
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
ssid:
"
+
result
.
ssid
);
console
.
info
(
"
bssid:
"
+
result
.
bssid
);
console
.
info
(
"
band:
"
+
result
.
band
);
console
.
info
(
"
isHidden:
"
+
result
.
isHidden
);
console
.
info
(
"
isRestricted:
"
+
result
.
isRestricted
);
console
.
info
(
"
chload:
"
+
result
.
chload
);
console
.
info
(
"
rssi
"
+
result
.
rssi
);
console
.
info
(
"
netWorkId:
"
+
result
.
netWorkId
);
console
.
info
(
"
linkSpeed:
"
+
result
.
linkSpeed
);
console
.
info
(
"
frequency:
"
+
result
.
frequency
);
console
.
info
(
"
snr:
"
+
result
.
snr
);
console
.
info
(
"
macAddress:
"
+
result
.
macAddress
);
console
.
info
(
"
ipAddress:
"
+
result
.
ipAddress
);
console
.
info
(
"
suppState:
"
+
result
.
suppState
);
console
.
info
(
"
connState:
"
+
result
.
connState
);
}
}
done
();
done
();
});
});
...
@@ -575,7 +576,8 @@ describe('ACTS_WifiTest', function() {
...
@@ -575,7 +576,8 @@ describe('ACTS_WifiTest', function() {
* @tc.author wudangping wwx1075776
* @tc.author wudangping wwx1075776
* @tc.desc Test get IpInfo information
* @tc.desc Test get IpInfo information
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0002
'
,
0
,
function
()
{
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0003
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Conn_Info_0003]
"
);
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
var
wifiDeviceConfigIp
=
{
var
wifiDeviceConfigIp
=
{
"
ssid
"
:
"
TEST1
"
,
"
ssid
"
:
"
TEST1
"
,
...
@@ -593,10 +595,9 @@ describe('ACTS_WifiTest', function() {
...
@@ -593,10 +595,9 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
expect
(
isConnected
).
assertFalse
();
console
.
info
(
"
[wifi_test] reassociate wifi
"
);
console
.
info
(
"
[wifi_test] reassociate wifi
"
);
var
result
=
wifi
.
reassociate
();
var
reassoc
=
wifi
.
reassociate
();
sleep
(
5000
);
console
.
log
(
"
[wifi_test] wifi reassociate result:
"
+
reassoc
);
console
.
log
(
"
[wifi_test] wifi reassociate result:
"
+
result
);
expect
(
reassoc
).
assertTrue
();
expect
(
result
).
assertTrue
();
console
.
info
(
"
[wifi_test] get IpInfo.
"
);
console
.
info
(
"
[wifi_test] get IpInfo.
"
);
var
ipInfo
=
wifi
.
getIpInfo
();
var
ipInfo
=
wifi
.
getIpInfo
();
console
.
info
(
"
[wifi_test] getIpInfo ->
"
+
JSON
.
stringify
(
ipInfo
));
console
.
info
(
"
[wifi_test] getIpInfo ->
"
+
JSON
.
stringify
(
ipInfo
));
...
@@ -608,29 +609,14 @@ describe('ACTS_WifiTest', function() {
...
@@ -608,29 +609,14 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
primaryDns:
"
+
ipInfo
.
primaryDns
);
console
.
info
(
"
primaryDns:
"
+
ipInfo
.
primaryDns
);
console
.
info
(
"
secondDns:
"
+
ipInfo
.
secondDns
);
console
.
info
(
"
secondDns:
"
+
ipInfo
.
secondDns
);
console
.
info
(
"
serverIp:
"
+
ipInfo
.
serverIp
);
console
.
info
(
"
serverIp:
"
+
ipInfo
.
serverIp
);
})
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
);
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0001
* @tc.name testwifiStateChangeOn
* @tc.desc Test wifiStateChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_ON_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test] wifiStateChange On test
"
);
try
{
wifi
.
on
(
'
wifiStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiStateChangeOn ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
})
/**
/**
...
@@ -642,156 +628,20 @@ describe('ACTS_WifiTest', function() {
...
@@ -642,156 +628,20 @@ describe('ACTS_WifiTest', function() {
* @tc.type Function
* @tc.type Function
* @tc.level Level 3
* @tc.level Level 3
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0002
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_ON_0002
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
wifiStateChange
'
,
function
(
data
)
{
console
.
info
(
"
[wifi_test] wifiStateChangeOff ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiStateChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0003
* @tc.name testwifiConnectionChnageOn
* @tc.desc Test wifiConnectionChnageOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_ON_0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test] wifiConnectionChange On test
"
);
console
.
info
(
"
[wifi_test] wifiConnectionChange On test
"
);
try
{
wifi
.
on
(
'
wifiConnectionChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiConnectionChange On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
await
wifi
.
on
(
'
wifiConnectionChange
'
,
function
(
data
)
{
* @tc.number SUB_Communication_WiFi_Sta_Off_0004
console
.
info
(
"
[wifi_test] wifiConnectionChangeOn ->
"
+
data
);
* @tc.name testwifiConnectionChangeOff
* @tc.desc Test wifiConnectionChangeOff api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0004
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
wifiConnectionChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiConnectionChange Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiConnectionChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0005
* @tc.name testwifiScanStateChangeOn
* @tc.desc Test wifiwifiScanStateChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_ON_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test]wifiScanStateChange On test
"
);
try
{
wifi
.
on
(
'
wifiScanStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiScanStateChange On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
});
await
(
3000
);
wifi
.
off
(
'
wifiConnectionChange
'
,
function
(
data
)
{
}
catch
(
e
)
{
console
.
info
(
"
[wifi_test] wifiConnectionChangeOff ->
"
+
data
);
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0006
* @tc.name testwifiScanStateChangeOff
* @tc.desc Test wifiScanStateChangeOff api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0006
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
wifiScanStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiScanStateChange Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiScanStateChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0007
* @tc.name testwifiRssiChangeOn
* @tc.desc Test wifiRssiChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_ON_0007
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test]wifiRssiChange On test
"
);
try
{
wifi
.
on
(
'
wifiRssiChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiRssiChange On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0008
* @tc.name testwifiRssiChangeOff
* @tc.desc Test wifiRssiChange api
* @tc.author wudangping wwx1075776.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0008
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
wifiRssiChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] wifiRssiChange Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiRssiChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
})
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录