Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1e45a1fa
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1e45a1fa
编写于
3月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2292 【communication】修改WiFi失败测试用例
Merge pull request !2292 from 权力/myfeature1
上级
4363a6fa
dd7f1afc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
127 addition
and
60 deletion
+127
-60
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
...uetooth_ble/src/main/js/default/test/BluetoothBle.test.js
+19
-16
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
.../wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
+16
-24
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
...ication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
+12
-9
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+80
-11
未找到文件。
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
浏览文件 @
1e45a1fa
...
...
@@ -662,6 +662,25 @@ describe('bluetoothhostTest', function() {
}
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GATT_DISCONNRCT_0001
* @tc.name testDisConnect
* @tc.desc Test DisConnect api.
* @tc.author quanli 00313334
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
bluetooth_gatt_disconnect
'
,
0
,
function
()
{
console
.
info
(
'
[bluetooth_js] gatt disconnect start
'
);
let
ret
=
gattClient
.
disconnect
();
console
.
info
(
'
[bluetooth_js] gatt disconnect ret:
'
+
ret
);
expect
(
ret
).
assertEqual
(
false
);
console
.
info
(
'
[bluetooth_js] gatt disconnect end
'
);
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GATT_CLIENT_CLOSE_0001
* @tc.name testGattClientClose
...
...
@@ -689,22 +708,6 @@ describe('bluetoothhostTest', function() {
}
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GATT_DISCONNRCT_0001
* @tc.name testDisConnect
* @tc.desc Test DisConnect api.
* @tc.author quanli 00313334
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
bluetooth_gatt_disconnect
'
,
0
,
function
()
{
console
.
info
(
'
[bluetooth_js] gatt disconnect start
'
);
let
ret
=
gattClient
.
disconnect
();
console
.
info
(
'
[bluetooth_js] gatt disconnect ret:
'
+
ret
);
expect
(
ret
).
assertEqual
(
false
);
console
.
info
(
'
[bluetooth_js] gatt disconnect end
'
);
})
})
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
浏览文件 @
1e45a1fa
...
...
@@ -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
(
"
ssid
:
"
+
config
.
ssid
);
console
.
info
(
"
preSharedKey
:
"
+
config
.
ssid
);
expect
(
config
.
ssid
.
length
).
assertEqual
(
32
);
done
();
...
...
@@ -421,7 +421,7 @@ describe('ACTS_WifiTest', function() {
if
(
wifi
.
isHotspotActive
())
{
var
off
=
wifi
.
disableHotspot
();
await
sleep
(
5000
);
console
.
info
(
"
[wifi_test]
en
ableHotspot result ->
"
+
off
);
console
.
info
(
"
[wifi_test]
dis
ableHotspot result ->
"
+
off
);
expect
(
off
).
assertTrue
();
}
...
...
@@ -555,31 +555,23 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] isHotspotActive ->
"
+
isHotspotActive
);
expect
(
isHotspotActive
).
assertTrue
();
console
.
info
(
"
[wifi_test] open Hotspot, set valid hotspot config start.
"
);
var
HotspotConfigW
=
{
"
ssid
"
:
"
WIFI
_
TEST
"
,
var
HotspotConfigW
O
=
{
"
ssid
"
:
"
WIFITEST
"
,
"
band
"
:
1
,
"
preSharedKey
"
:
"
12345678
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
preSharedKey
"
:
"
12345678
9
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
maxConn
"
:
8
}
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigW
);
console
.
log
(
"
[wifi_test] set a
PSK preSharedKey hotspot config
result1:
"
+
isSuccess1
);
var
isSuccess1
=
wifi
.
setHotspotConfig
(
HotspotConfigW
O
);
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
(
'
WIFI_TEST
'
);
expect
(
config
.
band
).
assertEqual
(
1
);
expect
(
config
.
preSharedKey
).
assertEqual
(
'
12345678
'
);
expect
(
config
.
securityType
).
assertEqual
(
3
);
expect
(
config
.
maxConn
).
assertEqual
(
8
);
console
.
log
(
"
[wifi_test] check current hotspot config preSharedKey is 8bit
"
);
var
configs
=
wifi
.
getHotspotConfig
();
console
.
info
(
"
[wifi_test] getHotspotConfig result ->
"
+
JSON
.
stringify
(
configs
));
console
.
info
(
"
ssid:
"
+
configs
.
ssid
);
expect
(
configs
.
ssid
).
assertEqual
(
'
WIFITEST
'
);
done
();
})
...
...
@@ -608,7 +600,7 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
ssid:
"
+
stationInfo
.
name
);
console
.
info
(
"
macAddress:
"
+
stationInfo
.
macAddress
);
console
.
info
(
"
ipAddress:
"
+
stationInfo
.
ipAddress
);
expect
(
stationInfo
.
length
).
assertEqual
();
expect
(
stationInfo
.
length
).
assertEqual
(
0
);
done
();
})
...
...
@@ -731,7 +723,7 @@ describe('ACTS_WifiTest', function() {
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_
Sta
_Off_0006
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_
Hotspot
_Off_0006
'
,
0
,
async
function
(
done
)
{
try
{
await
wifi
.
off
(
'
hotspotStaLeave
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStaLeave Off ->
"
+
data
);
...
...
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
浏览文件 @
1e45a1fa
...
...
@@ -79,8 +79,9 @@ describe('ACTS_WifiTest', function () {
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
.
length
!=
0
);
var
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_js]getCurrentGroup promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
...
...
@@ -144,9 +145,9 @@ describe('ACTS_WifiTest', function () {
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
.
length
!=
0
);
expect
(
true
).
assertEqual
(
data
.
goBand
==
WifiP2PConfig2
.
goBand
);
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test]getCurrentGroup promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertFail
();
...
...
@@ -189,9 +190,10 @@ describe('ACTS_WifiTest', function () {
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
.
l
ength
!=
0
);
expect
(
true
).
assertEqual
(
data
.
goBand
==
WifiP2PConfig
.
goBand
);
expect
(
true
).
assertEqual
(
resultL
ength
!=
0
);
console
.
info
(
"
[wifi_test] test start deletePersistentGroup
"
);
var
removePConfig
=
wifi
.
deletePersistentGroup
(
data
.
networkId
);
console
.
info
(
"
[wifi_test] test start deletePersistentGroup
"
+
removePConfig
);
...
...
@@ -256,8 +258,9 @@ describe('ACTS_WifiTest', function () {
};
await
wifi
.
getP2pLinkedInfo
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getP2pLinkedInfo [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
.
l
ength
!=
0
);
expect
(
true
).
assertEqual
(
resultL
ength
!=
0
);
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test]getP2pLinkedInfo promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertFail
();
...
...
@@ -272,7 +275,6 @@ describe('ACTS_WifiTest', function () {
console
.
info
(
"
isGroupOwner:
"
+
result
.
isGroupOwner
);
console
.
info
(
"
groupOwnerAddr:
"
+
result
.
groupOwnerAddr
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
CONNECTED
);
expect
(
false
).
assertEqual
(
result
.
connectState
==
P2pConnectState
.
DISCONNECTED
);
});
done
();
...
...
@@ -328,8 +330,9 @@ describe('ACTS_WifiTest', function () {
expect
(
scanConfig
).
assertTrue
();
await
wifi
.
getP2pPeerDevices
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getP2pPeerDevices [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
.
l
ength
!=
0
);
expect
(
true
).
assertEqual
(
resultL
ength
!=
0
);
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test]getP2pPeerDevices promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
...
...
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
1e45a1fa
...
...
@@ -97,9 +97,13 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
expect
(
enable
).
assertTrue
();
}
console
.
info
(
"
[wifi_test] close wifi test start.
"
);
var
disable
=
wifi
.
disableWifi
();
await
sleep
(
5000
);
console
.
log
(
"
[wifi_test] wifi close result:
"
+
disable
);
expect
(
disable
).
assertTrue
();
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assert
Tru
e
();
expect
(
wifi
.
isWifiActive
()).
assert
Fals
e
();
done
();
})
...
...
@@ -351,7 +355,71 @@ describe('ACTS_WifiTest', function() {
});
done
()
})
/**
* @tc.number Config_0004
* @tc.name SUB_Communication_WiFi_Sta_Config_0004
* @tc.desc Test remove all wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0004]
"
);
console
.
info
(
"
[wifi_test] create multiple valid wifi device config and add it.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TESTWgr1
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
123456789
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
};
var
wifiDeviceConfig2
=
{
"
ssid
"
:
"
TESTWgr2
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
""
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_OPEN
,
};
let
promiseOne
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
(
err
,
netWorkId1
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig1 callback:
"
+
JSON
.
stringify
(
netWorkId1
));
expect
(
true
).
assertEqual
(
netWorkId1
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
>=
1
);
resolve
()
});
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
(
err
,
netWorkId2
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig2 callback :
"
+
JSON
.
stringify
(
netWorkId2
));
expect
(
true
).
assertEqual
(
netWorkId2
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
>=
1
);
console
.
info
(
"
[wifi_test] remove all configs
"
);
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 configs,current get Configs :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
resolve
()
});
})
Promise
.
all
([
promiseOne
,
promiseTwo
]).
then
(
done
)
})
/**
* @tc.number Config_0007
...
...
@@ -417,7 +485,7 @@ describe('ACTS_WifiTest', function() {
* @tc.desc Test SSID wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_SSID_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
S
S
UB_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] create a contains chinese SSID wifi device config start.
"
);
var
wifiDeviceConfigZ
=
{
...
...
@@ -467,7 +535,7 @@ describe('ACTS_WifiTest', function() {
* @tc.name SSUB_Communication_WiFi_Sta_Conn_SSID_0002
* @tc.desc Test SSID wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_SSID_0002
'
,
0
,
async
function
(
done
)
{
it
(
'
S
S
UB_Communication_WiFi_Sta_Conn_SSID_0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SSUB_Communication_WiFi_Sta_Conn_SSID_0002]
"
);
console
.
info
(
"
[wifi_test] create a kongge SSID wifi device config start.
"
);
var
wifiDeviceConfigK
=
{
...
...
@@ -517,7 +585,7 @@ describe('ACTS_WifiTest', function() {
* @tc.name SSUB_Communication_WiFi_Sta_Conn_SSID_0003
* @tc.desc Test SSID wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_SSID_0003
'
,
0
,
async
function
(
done
)
{
it
(
'
S
S
UB_Communication_WiFi_Sta_Conn_SSID_0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SSUB_Communication_WiFi_Sta_Conn_SSID_0003]
"
);
console
.
info
(
"
[wifi_test] create a kongge SSID wifi device config start.
"
);
var
wifiDeviceConfigT
=
{
...
...
@@ -539,7 +607,8 @@ describe('ACTS_WifiTest', function() {
.
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
);
...
...
@@ -616,7 +685,7 @@ describe('ACTS_WifiTest', function() {
expect
(
wifi
.
isFeatureSupported
(
result
)).
assertTrue
();
})
/**
/**
* @tc.number SUB_Communication_WiFi_Sta_info_0005
* @tc.name testHotspotDualBandSupported
* @tc.desc Test HotspotDualBandSupported api.
...
...
@@ -728,7 +797,7 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
connState:
"
+
result
.
connState
);
done
();
});
await
sleep
(
2000
);
})
/**
...
...
@@ -741,8 +810,8 @@ describe('ACTS_WifiTest', function() {
var
wifiDeviceConfigIp
=
{
"
ssid
"
:
"
TEST1
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
"
false
"
,
"
preSharedKey
"
:
"
12345678
9
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录