Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b282aac9
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看板
提交
b282aac9
编写于
2月 17, 2022
作者:
Q
q00313334
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add wifi and bluetooth xts rk3568 testcase11
Signed-off-by:
N
q00313334
<
quanli1@huawei.com
>
上级
b8c592c7
变更
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
浏览文件 @
b282aac9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for bluetooth js api Tests"
,
"description"
:
"Configuration for bluetooth js api Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
18
00000"
,
"test-timeout"
:
"
6
00000"
,
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
b282aac9
此差异已折叠。
点击以展开。
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
b282aac9
...
@@ -86,13 +86,13 @@ describe('ACTS_WifiTest', function() {
...
@@ -86,13 +86,13 @@ describe('ACTS_WifiTest', function() {
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Scan_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Scan_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Scan_0001]
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Scan_0001]
"
);
if
(
!
wifi
.
isWifiActive
())
{
var
active1
=
wifi
.
isWifiActive
();
if
(
!
active1
)
{
var
enable
=
wifi
.
enableWifi
();
var
enable
=
wifi
.
enableWifi
();
sleep
(
3
000
);
sleep
(
5
000
);
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
console
.
log
(
"
[wifi_test] wifi open result:
"
+
enable
);
expect
(
enable
).
assertTrue
();
expect
(
enable
).
assertTrue
();
}
}
var
scan
=
wifi
.
scan
();
var
scan
=
wifi
.
scan
();
sleep
(
3000
);
sleep
(
3000
);
console
.
log
(
"
[wifi_test] open wifi scan result:
"
+
scan
);
console
.
log
(
"
[wifi_test] open wifi scan result:
"
+
scan
);
...
@@ -109,7 +109,10 @@ describe('ACTS_WifiTest', function() {
...
@@ -109,7 +109,10 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] Wifi getScanInfos callback test[2].
"
);
console
.
info
(
"
[wifi_test] Wifi getScanInfos callback test[2].
"
);
wifi
.
getScanInfos
(
wifi
.
getScanInfos
(
(
result
)
=>
{
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
log
(
"
[wifi_test] wifi getScanInfos failed
"
+
err
);
}
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
&&
i
<
3
))
{
...
@@ -129,7 +132,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -129,7 +132,6 @@ describe('ACTS_WifiTest', function() {
}
}
done
()
done
()
});
});
})
})
/**
/**
...
@@ -199,7 +201,11 @@ describe('ACTS_WifiTest', function() {
...
@@ -199,7 +201,11 @@ describe('ACTS_WifiTest', function() {
});
});
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
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
));
console
.
info
(
"
[wifi_test]add OPEN Deviceconfig callback :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
@@ -265,7 +271,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -265,7 +271,6 @@ describe('ACTS_WifiTest', function() {
* @tc.desc Test remove all wifi device config
* @tc.desc Test remove all wifi device config
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0005
'
,
0
,
async
function
(
done
)
{
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.
"
);
console
.
info
(
"
[wifi_test] create multiple valid wifi device config and add it.
"
);
var
wifiDeviceConfig1
=
{
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TESTWgr1
"
,
"
ssid
"
:
"
TESTWgr1
"
,
...
@@ -283,7 +288,9 @@ describe('ACTS_WifiTest', function() {
...
@@ -283,7 +288,9 @@ describe('ACTS_WifiTest', function() {
};
};
let
promiseOne
=
new
Promise
((
resolve
,
reject
)
=>
{
let
promiseOne
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
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
));
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
"
);
...
@@ -293,10 +300,11 @@ describe('ACTS_WifiTest', function() {
...
@@ -293,10 +300,11 @@ describe('ACTS_WifiTest', function() {
resolve
()
resolve
()
});
});
})
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
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
));
console
.
info
(
"
[wifi_test] wifi addDeviceconfig2 callback :
"
+
JSON
.
stringify
(
netWorkId2
));
expect
(
true
).
assertEqual
(
netWorkId2
!=
-
1
);
expect
(
true
).
assertEqual
(
netWorkId2
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
...
@@ -336,6 +344,12 @@ describe('ACTS_WifiTest', function() {
...
@@ -336,6 +344,12 @@ describe('ACTS_WifiTest', function() {
.
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
);
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
"
);
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
));
...
@@ -378,18 +392,26 @@ describe('ACTS_WifiTest', function() {
...
@@ -378,18 +392,26 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] getCountryCode ->
"
+
JSON
.
stringify
(
countryCode
));
console
.
info
(
"
[wifi_test] getCountryCode ->
"
+
JSON
.
stringify
(
countryCode
));
expect
(
JSON
.
stringify
(
countryCode
)).
assertEqual
(
'
"CN"
'
);
expect
(
JSON
.
stringify
(
countryCode
)).
assertEqual
(
'
"CN"
'
);
})
})
/**
/**
* @tc.number Conn_Info_0005
* @tc.number Config_0002
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0001
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0001
* @tc.desc Test get empty linked information
* @tc.desc Test cnnnection a PSK SecurityType wifi deviceconfig
*/
*/
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
async
function
()
{
it
(
'
SUB_Communication_WiFi_Sta_Conn_Info_0001
'
,
0
,
async
function
()
{
console
.
info
(
"
[wifi_test] get empty linked information and getIpInfo.
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0002]
"
);
var
discon2
=
wifi
.
disconnect
();
console
.
info
(
"
[wifi_test] create a PSK SecurityType wifi device config start.
"
);
console
.
log
(
"
[wifi_test] wifi disconnect result:
"
+
discon2
);
var
wifiDeviceConfigConn
=
{
expect
(
discon2
).
assertTrue
();
"
ssid
"
:
"
TEST_CONN
"
,
sleep
(
2000
);
"
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
();
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
expect
(
isConnected
).
assertFalse
();
...
@@ -398,8 +420,41 @@ describe('ACTS_WifiTest', function() {
...
@@ -398,8 +420,41 @@ describe('ACTS_WifiTest', function() {
return
console
.
error
(
'
failed to get link infos callback because
'
+
JSON
.
stringify
(
err
));
return
console
.
error
(
'
failed to get link infos callback because
'
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
info
(
"
[wifi_test] get wifi link [callback] ->
"
+
JSON
.
stringify
(
data
));
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.
"
);
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
));
...
@@ -412,5 +467,23 @@ describe('ACTS_WifiTest', function() {
...
@@ -412,5 +467,23 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
secondDns:
"
+
ipInfo
.
secondDns
);
console
.
info
(
"
secondDns:
"
+
ipInfo
.
secondDns
);
console
.
info
(
"
serverIp:
"
+
ipInfo
.
serverIp
);
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*************
"
);
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录