Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2c2aa141
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看板
提交
2c2aa141
编写于
11月 26, 2021
作者:
Q
q00313334
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wifijs testcase modified
Signed-off-by:
N
q00313334
<
quanli1@huawei.com
>
上级
06843333
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
114 addition
and
9 deletion
+114
-9
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+114
-9
未找到文件。
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
2c2aa141
...
...
@@ -13,7 +13,6 @@
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
wifi
from
'
@ohos.wifi_native_js
'
...
...
@@ -25,6 +24,7 @@ function sleep(delay) {
}
}
var
WifiSecurityType
=
{
WIFI_SEC_TYPE_INVALID
:
0
,
WIFI_SEC_TYPE_OPEN
:
1
,
...
...
@@ -38,8 +38,8 @@ var wifiDeviceConfig = {
"
bssid
"
:
"
A1:B1:C1:D1:E1:F1
"
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
"
false
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_
SAE
,
"
netId
"
:
0
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_
PSK
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
...
...
@@ -227,15 +227,120 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] wifi discon2 result:
"
+
discon2
);
expect
(
discon2
).
assertTrue
();
sleep
(
3000
);
var
disable
=
wifi
.
disableWifi
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi disable result:
"
+
disable
);
expect
(
disable
).
assertTrue
();
});
done
();
})
})
/**
* @tc.number wifi_native_js_unit_test_009
* @tc.name Test wifi.connectToDevice.
* @tc.desc Test wifi.connectToDevice API functionality.
*/
it
(
'
wifi_native_js_unit_test_009
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST
"
,
"
bssid
"
:
"
A1:B1:C1:D1:E1:F1
"
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
"
false
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_INVALID
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
active
=
wifi
.
isWifiActive
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi active result2:
"
+
active
);
if
(
!
active
){
var
enable
=
wifi
.
enableWifi
();
expect
(
enable
).
assertTrue
();
sleep
(
3000
);
}
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig1
);
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
log
(
"
[wifi_test] wifi disconnect() result:
"
+
wifi
.
disconnect
());
expect
(
wifi
.
disconnect
()).
assertTrue
();
sleep
(
3000
);
})
/**
* @tc.number wifi_native_js_unit_test_010
* @tc.name Test wifi.connectToDevice.
* @tc.desc Test wifi.connectToDevice API functionality.
*/
it
(
'
wifi_native_js_unit_test_010
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
var
wifiDeviceConfig2
=
{
"
ssid
"
:
"
TEST
"
,
"
bssid
"
:
"
A1:B1:C1:D1:E1:F1
"
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
"
false
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_OPEN
,
"
netId
"
:
-
1
,
"
ipType
"
:
1
,
"
creatorUid
"
:
7
,
"
disableReason
"
:
0
,
"
randomMacType
"
:
0
,
"
randomMacAddr
"
:
"
11:22:33:44:55:66
"
,
"
staticIp
"
:
{
"
ipAddress
"
:
1284752956
,
"
gateway
"
:
1284752936
},
};
var
active
=
wifi
.
isWifiActive
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi active result3:
"
+
active
);
if
(
!
active
){
var
enable
=
wifi
.
enableWifi
();
expect
(
enable
).
assertTrue
();
sleep
(
3000
);
}
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig2
);
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result1:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
log
(
"
[wifi_test] wifi disconnect() result1:
"
+
wifi
.
disconnect
());
expect
(
wifi
.
disconnect
()).
assertTrue
();
sleep
(
3000
);
})
/**
* @tc.number wifi_native_js_unit_test_011
* @tc.name Test wifi.connectToDevice.
* @tc.desc Test wifi.connectToDevice API functionality.
*/
it
(
'
wifi_native_js_unit_test_011
'
,
0
,
function
()
{
console
.
info
(
"
[wifi_test] wifi connectToDevice test.
"
);
var
active
=
wifi
.
isWifiActive
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi active result2:
"
+
active
);
if
(
!
active
){
var
enable
=
wifi
.
enableWifi
();
expect
(
enable
).
assertTrue
();
sleep
(
3000
);
}
var
result1
=
wifi
.
connectToDevice
(
wifiDeviceConfig
);
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi connectToDevice result:
"
+
result1
);
expect
(
result1
).
assertTrue
();
console
.
log
(
"
[wifi_test] wifi disconnect() result:
"
+
wifi
.
disconnect
());
expect
(
wifi
.
disconnect
()).
assertTrue
();
sleep
(
3000
);
var
disable
=
wifi
.
disableWifi
();
sleep
(
3000
);
console
.
log
(
"
[wifi_test] wifi disable result:
"
+
disable
);
expect
(
disable
).
assertTrue
();
})
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
})
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
f7556642
·
11月 27, 2021
mentioned in commit
f7556642
mentioned in commit f75566429eca0779a6be4512169b73c063d8312a
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录