Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bfc91772
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看板
未验证
提交
bfc91772
编写于
2月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1990 【communication】add WIFI testcase
Merge pull request !1990 from 权力/myfeature
上级
bfa07e98
bfefdab5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
343 addition
and
3 deletion
+343
-3
communication/wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
...wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
+133
-0
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+210
-3
未找到文件。
communication/wifi_standard/src/main/js/default/test/WifiSoftAP.test.js
浏览文件 @
bfc91772
...
...
@@ -682,5 +682,138 @@ describe('ACTS_WifiTest', function() {
expect
(
config
).
assertEqual
(
8
);
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0001
* @tc.name testhotspotStateChangeOn
* @tc.desc Test hotspotStateChangeOn api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Hotspot_ON_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test]hotspotStateChange On test
"
);
try
{
wifi
.
on
(
'
hotspotStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStateChange On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0002
* @tc.name testhotspotStateChangeOff
* @tc.desc Test hotspotStateChange api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0002
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
hotspotStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStateChange Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiRssiChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0003
* @tc.name testhotspotStaJoinOn
* @tc.desc Test hotspotStaJoinOn api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Hotspot_ON_0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test]hotspotStaJoin On test
"
);
try
{
wifi
.
on
(
'
hotspotStaJoin
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStaJoin On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0004
* @tc.name testhotspotStaJoinOff
* @tc.desc Test hotspotStaJoin api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0004
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
hotspotStaJoin
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStaJoin Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiRssiChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0005
* @tc.name testhotspotStaLeaveOn
* @tc.desc Test hotspotStaLeaveOn api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Hotspot_ON_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test]hotspotStaLeave On test
"
);
try
{
wifi
.
on
(
'
hotspotStaLeave
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStaLeave On ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0006
* @tc.name testhotspotStaLeaveOff
* @tc.desc Test hotspotStaLeave api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_0006
'
,
0
,
async
function
(
done
)
{
try
{
wifi
.
off
(
'
hotspotStaLeave
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStaLeave Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] hotspotStaLeave unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
})
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
bfc91772
...
...
@@ -271,6 +271,7 @@ 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
"
,
...
...
@@ -290,7 +291,9 @@ describe('ACTS_WifiTest', function() {
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
(
err
,
netWorkId1
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
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
"
);
...
...
@@ -300,11 +303,14 @@ describe('ACTS_WifiTest', function() {
resolve
()
});
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
(
err
,
netWorkId2
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
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
"
);
...
...
@@ -408,10 +414,14 @@ describe('ACTS_WifiTest', function() {
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
};
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result1 :
"
+
JSON
.
stringify
(
configs
));
console
.
info
(
"
[wifi_test] connect wifi start.
"
);
var
conn1
=
wifi
.
connectToDevice
(
wifiDeviceConfigConn
);
sleep
(
5000
);
console
.
info
(
"
[wifi_test] isconnected wifi
"
);
console
.
log
(
"
[wifi_test] wifi Connected result:
"
+
conn1
);
console
.
info
(
"
[wifi_test] check isconnected wifi
"
);
var
isConnected
=
wifi
.
isConnected
();
console
.
log
(
"
[wifi_test] wifi isConnected result:
"
+
isConnected
);
expect
(
isConnected
).
assertFalse
();
...
...
@@ -483,6 +493,203 @@ describe('ACTS_WifiTest', function() {
console
.
info
(
"
[wifi_test] isFeatureSupported:
"
+
result
+
"
->
"
+
wifi
.
isFeatureSupported
(
result
));
expect
(
wifi
.
isFeatureSupported
(
result
)).
assertTrue
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_info_0001
* @tc.name testgetMacAddress
* @tc.desc Test getMacAddress api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_info_0001
'
,
0
,
function
()
{
if
(
!
wifi
.
isWifiActive
())
{
var
enable
=
wifi
.
enableWifi
();
sleep
(
3000
);
expect
(
enable
).
assertTrue
();
}
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
console
.
info
(
'
[wifi_test] getDeviceMacAddress test start ...
'
);
var
result
=
wifi
.
getDeviceMacAddress
();
console
.
info
(
"
[wifi_test] getDeviceMacAddress ->
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
.
length
>=
1
)
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0001
* @tc.name testwifiStateChangeOn
* @tc.desc Test wifiStateChangeOn api.
* @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
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0002
* @tc.name testwifiStateChangeOff
* @tc.desc Test wifiStateChangeOff api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_Communication_WiFi_Sta_Off_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.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
"
);
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
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0004
* @tc.name testwifiConnectionChangeOff
* @tc.desc Test wifiConnectionChangeOff api.
* @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
);
console
.
info
(
"
[wifi_test] wifiConnectionChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0005
* @tc.name testwifiScanStateChangeOn
* @tc.desc Test wifiwifiScanStateChangeOn api.
* @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
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0006
* @tc.name testwifiScanStateChangeOff
* @tc.desc Test wifiScanStateChangeOff api.
* @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
);
console
.
info
(
"
[wifi_test] wifiScanStateChange unregister end
"
);
});
await
(
3000
);
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_Sta_ON_0007
* @tc.name testwifiRssiChangeOn
* @tc.desc Test wifiRssiChangeOn api.
* @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.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*************
"
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录