Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a06b3953
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看板
未验证
提交
a06b3953
编写于
2月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1968 【communication】修改WIFI Rk3568 L2测试用例和补充蓝牙用例
Merge pull request !1968 from 权力/myfeature
上级
57c8eb6f
b282aac9
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
669 addition
and
73 deletion
+669
-73
communication/bluetooth_standard/Test.json
communication/bluetooth_standard/Test.json
+1
-1
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
...tooth_standard/src/main/js/default/test/Bluetooth.test.js
+574
-51
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+94
-21
未找到文件。
communication/bluetooth_standard/Test.json
浏览文件 @
a06b3953
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for bluetooth js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
18
00000"
,
"test-timeout"
:
"
6
00000"
,
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"shell-timeout"
:
"60000"
},
...
...
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
a06b3953
此差异已折叠。
点击以展开。
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
a06b3953
...
...
@@ -86,13 +86,13 @@ describe('ACTS_WifiTest', function() {
*/
it
(
'
SUB_Communication_WiFi_Sta_Scan_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Scan_0001]
"
);
if
(
!
wifi
.
isWifiActive
())
{
var
active1
=
wifi
.
isWifiActive
();
if
(
!
active1
)
{
var
enable
=
wifi
.
enableWifi
();
sleep
(
3
000
);
sleep
(
5
000
);
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
expect
(
enable
).
assertTrue
();
}
var
scan
=
wifi
.
scan
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] open wifi scan result:
"
+
scan
);
...
...
@@ -109,7 +109,10 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] Wifi getScanInfos callback test[2].
"
);
wifi
.
getScanInfos
(
(
result
)
=>
{
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
log
(
"
[wifi_test] wifi getScanInfos failed
"
+
err
);
}
var
clen
=
Object
.
keys
(
result
).
length
;
console
.
log
(
"
[wifi_test] wifi getScanInfos callback result length:
"
+
clen
);
if
(
!
(
clen
==
0
&&
i
<
3
))
{
...
...
@@ -129,7 +132,6 @@ describe('ACTS_WifiTest', function() {
}
done
()
});
})
/**
...
...
@@ -199,7 +201,11 @@ describe('ACTS_WifiTest', function() {
});
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
(
netWorkId
)
=>
{
(
err
,
netWorkId
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add OPEN callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test]add OPEN Deviceconfig callback :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
...
@@ -265,7 +271,6 @@ describe('ACTS_WifiTest', function() {
* @tc.desc Test remove all wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0005]
"
);
console
.
info
(
"
[wifi_test] create multiple valid wifi device config and add it.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TESTWgr1
"
,
...
...
@@ -283,7 +288,9 @@ describe('ACTS_WifiTest', function() {
};
let
promiseOne
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
(
netWorkId1
)
=>
{
(
err
,
netWorkId1
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig1 callback:
"
+
JSON
.
stringify
(
netWorkId1
));
expect
(
true
).
assertEqual
(
netWorkId1
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
...
@@ -293,10 +300,11 @@ describe('ACTS_WifiTest', function() {
resolve
()
});
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
(
netWorkId2
)
=>
{
(
err
,
netWorkId2
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig2 callback :
"
+
JSON
.
stringify
(
netWorkId2
));
expect
(
true
).
assertEqual
(
netWorkId2
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
...
@@ -336,6 +344,12 @@ describe('ACTS_WifiTest', function() {
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add PSK Deviceconfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
console
.
info
(
"
[wifi_test]connectdevice result:
"
+
wifi
.
connectToNetwork
(
netWorkId
));
expect
(
wifi
.
connectToNetwork
(
netWorkId
)).
assertTrue
();
console
.
info
(
"
[wifi_test] get empty linked information and getIpInfo.
"
);
var
disconNet
=
wifi
.
disableNetwork
(
netWorkId
);
console
.
log
(
"
[wifi_test] wifi disableNetwork result:
"
+
disconNet
);
expect
(
disconNet
).
assertTrue
();
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result1 :
"
+
JSON
.
stringify
(
configs
));
...
...
@@ -378,18 +392,26 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] getCountryCode ->
"
+
JSON
.
stringify
(
countryCode
));
expect
(
JSON
.
stringify
(
countryCode
)).
assertEqual
(
'
"CN"
'
);
})
/**
* @tc.number Conn_Info_0005
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0001
* @tc.desc Test get empty linked information
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
async
function
()
{
console
.
info
(
"
[wifi_test] get empty linked information and getIpInfo.
"
);
var
discon2
=
wifi
.
disconnect
();
console
.
log
(
"
[wifi_test] wifi disconnect result:
"
+
discon2
);
expect
(
discon2
).
assertTrue
();
sleep
(
2000
);
* @tc.number Config_0002
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0001
* @tc.desc Test cnnnection a PSK SecurityType wifi deviceconfig
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
async
function
()
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0002]
"
);
console
.
info
(
"
[wifi_test] create a PSK SecurityType wifi device config start.
"
);
var
wifiDeviceConfigConn
=
{
"
ssid
"
:
"
TEST_CONN
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
};
console
.
info
(
"
[wifi_test] connect wifi start.
"
);
var
conn1
=
wifi
.
connectToDevice
(
wifiDeviceConfigConn
);
sleep
(
5000
);
console
.
info
(
"
[wifi_test] isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
...
...
@@ -398,8 +420,41 @@ describe('ACTS_WifiTest', function() {
return
console
.
error
(
'
failed to get link infos callback because
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"
[wifi_test] get wifi link [callback] ->
"
+
JSON
.
stringify
(
data
));
for
(
var
j
=
0
;
j
<
JSON
.
stringify
(
data
).
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
);
}
}
});
console
.
info
(
"
[wifi_test] get empty linked information and getIpInfo.
"
);
var
discon2
=
wifi
.
disconnect
();
console
.
log
(
"
[wifi_test] wifi disconnect result:
"
+
discon2
);
expect
(
discon2
).
assertTrue
();
})
/**
* @tc.number Conn_Info_0002
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0002
* @tc.desc Test get IpInfo information
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0002
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] get IpInfo.
"
);
var
ipInfo
=
wifi
.
getIpInfo
();
console
.
info
(
"
[wifi_test] getIpInfo ->
"
+
JSON
.
stringify
(
ipInfo
));
...
...
@@ -412,5 +467,23 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
secondDns:
"
+
ipInfo
.
secondDns
);
console
.
info
(
"
serverIp:
"
+
ipInfo
.
serverIp
);
})
/**
* @tc.number SUB_Communication_WiFi_Sta_info_0004
* @tc.name testFeatureSupported
* @tc.desc Test FeatureSupported api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_info_0004
'
,
0
,
function
()
{
console
.
info
(
'
[wifi_test]FeatureSupported test start ...
'
);
var
result
=
wifi
.
getSupportedFeatures
();
console
.
info
(
"
[wifi_test] getFeatureSupported ->
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_test] isFeatureSupported:
"
+
result
+
"
->
"
+
wifi
.
isFeatureSupported
(
result
));
expect
(
wifi
.
isFeatureSupported
(
result
)).
assertTrue
();
})
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录