提交 c9535866 编写于 作者: Q quanli

quanli1@huawei.com

Signed-off-by: Nquanli <quanli1@huawei.com>
上级 40b9ce27
......@@ -447,10 +447,10 @@ export default function actsWifiErrorCode202Test() {
it('SUB_Communication_WiFi_XTS_ErrorCode_0096', 0, async function (done) {
try {
let hotSpotConfig = {
"ssid": "HotspotTest",
"band": 2,
"preSharedKey": null,
"securityType": wifiMg.WifiSecurityType.WIFI_SEC_TYPE_OPEN,
"ssid": "test202",
"band": 1,
"preSharedKey": "12345678",
"securityType": wifiMg.WifiSecurityType.WIFI_SEC_TYPE_PSK,
"maxConn": 8,
};
let setHotspotConfig = wifiMg.setHotspotConfig(hotSpotConfig);
......
......@@ -130,7 +130,6 @@ export default function actsWifiManagerFunctionsTest() {
let countrylenth = getCountryCodeResult.length;
console.info("[wifi_test]getCountryCode.length :" + JSON.stringify(countrylenth));
expect(true).assertEqual(countrylenth == 2);
let WIDTH_20MHZ = wifiMg.WifiChannelWidth .WIDTH_20MHZ;
console.info("[wifi_test]WIDTH_20MHZ : " + JSON.stringify(WIDTH_20MHZ));
expect(true).assertEqual( WIDTH_20MHZ == 0);
......@@ -220,7 +219,6 @@ export default function actsWifiManagerFunctionsTest() {
console.info("[wifi_test]promise then error." + JSON.stringify(error));
expect().assertFail();
});
function getLinked(){
return new Promise((resolve, reject) => {
wifiMg.getLinkedInfo(
......@@ -238,7 +236,35 @@ export default function actsWifiManagerFunctionsTest() {
+ result.frequency + "snr:" + result.snr +
"macAddress: " + result.macAddress + "ipAddress: " + result.ipAddress +
"suppState: " + result.suppState + "connState: " + result.connState
+ "macType: " + result.macType);
+ "macType: " + result.macType + "rxLinkSpeed: " + result.rxLinkSpeed
+ "maxSupportedTxLinkSpeed: " + result.maxSupportedTxLinkSpeed
+ "maxSupportedRxLinkSpeed: " + result.maxSupportedRxLinkSpeed
+ "wifiStandard: " + result.wifiStandard);
let standard = wifiMg.getLinkedInfo().WifiStandard;
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_UNDEFINED) {
expect(true).assertEqual(standard == 0);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11A) {
expect(true).assertEqual(standard == 1);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11B) {
expect(true).assertEqual(standard == 2);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11G) {
expect(true).assertEqual(standard == 3);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11N) {
expect(true).assertEqual(standard == 4);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11AC) {
expect(true).assertEqual(standard == 5);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11AX) {
expect(true).assertEqual(standard == 6);
}
if (standard == wifiMg.WifiStandard.WIFI_STANDARD_11AD) {
expect(true).assertEqual(standard == 7);
}
let state = wifiMg.getLinkedInfo().ConnState;
if (state == wifiMg.ConnState.SCANNING) {
expect(true).assertEqual(state == 0);
......@@ -279,7 +305,7 @@ export default function actsWifiManagerFunctionsTest() {
* @tc.type Function
* @tc.level Level 0
*/
it('SUB_Communication_WiFi_XTS_Sta_0034', 0, async function (done) {
it('SUB_Communication_WiFi_XTS_Sta_0034', 0, async function(done) {
let scanResult = wifiMg.scan();
await sleep(3000);
let getScanInfoListResult = wifiMg.getScanInfoList();
......@@ -302,6 +328,36 @@ export default function actsWifiManagerFunctionsTest() {
}
done();
})
/**
* @tc.number SUB_Communication_WiFi_XTS_Sta_0035
* @tc.name testisBandTypeSupported
* @tc.desc Test isBandTypeSupported API functionality.
* @tc.type Function
* @tc.level Level 0
*/
it('SUB_Communication_WiFi_XTS_Sta_0035', 0, async function(done) {
try {
let isBandTypeSupported = wifiMg.isBandTypeSupported(wifiMg.WifiBandType.WIFI_BAND_NONE);
console.info("[wifi_test]isBandTypeSupported." + JSON.stringify(isBandTypeSupported));
} catch (error) {
console.error(`isBandTypeSupported failed, code is ${error.code}, message is ${error.message}`);
expect(error.code).assertEqual("401");
}
let isBandTypeSupported1 = wifiMg.isBandTypeSupported(wifiMg.WifiBandType.WIFI_BAND_2G);
console.info("[wifi_test]isBandTypeSupported1." + JSON.stringify(isBandTypeSupported1));
expect(typeof (isBandTypeSupported1)).assertEqual('boolean');
let isBandTypeSupported2 = wifiMg.isBandTypeSupported(wifiMg.WifiBandType.WIFI_BAND_5G);
console.info("[wifi_test]isBandTypeSupported2." + JSON.stringify(isBandTypeSupported2));
expect(typeof (isBandTypeSupported2)).assertEqual('boolean');
let isBandTypeSupported3 = wifiMg.isBandTypeSupported(wifiMg.WifiBandType.WIFI_BAND_6G);
console.info("[wifi_test]isBandTypeSupported3." + JSON.stringify(isBandTypeSupported3));
expect(typeof (isBandTypeSupported3)).assertEqual('boolean');
let isBandTypeSupported4 = wifiMg.isBandTypeSupported(wifiMg.WifiBandType.WIFI_BAND_60G);
console.info("[wifi_test]isBandTypeSupported4." + JSON.stringify(isBandTypeSupported4));
expect(typeof (isBandTypeSupported4)).assertEqual('boolean');
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.
先完成此消息的编辑!
想要评论请 注册