未验证 提交 ce459836 编写于 作者: O openharmony_ci 提交者: Gitee

!2063 【communication】增加WIFI P2P JS L2测试用例

Merge pull request !2063 from 权力/myfeature1
......@@ -14,4 +14,5 @@
*/
require('./WifiSta.test.js')
require('./WifiSoftAP.test.js')
require('./WifiP2P.test.js')
......@@ -55,6 +55,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number OPEN_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Open_0002
* @tc.desc Test wifi.enableHotspot and wifi.disableHotspot API functionality1.
* @tc.author wudangping wwx1075776
* @tc.level Level 0
*/
it('SUB_Communication_WiFi_Hotspot_Open_0002', 0, function () {
......@@ -91,6 +92,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number OPEN_0003
* @tc.name SUB_Communication_WiFi_Hotspot_Open_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test open Hotspot after open wifi
* @tc.level Level 1
*/
......@@ -115,6 +117,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0001
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid 2.4G hotspot config
* @tc.level Level 0
*/
......@@ -153,6 +156,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid 5G hotspot config
* @tc.level Level 1
*/
......@@ -196,6 +200,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0003
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test set a invalid hotspot config
* @tc.level Level 2
*/
......@@ -220,10 +225,10 @@ describe('ACTS_WifiTest', function() {
})
/**
* @tc.number CONFIG_0004
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0004
* @tc.author wudangping wwx1075776
* @tc.desc Test set a max preSharedKey is hotspot config
* @tc.level Level 2
*/
......@@ -274,6 +279,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0005
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0005
* @tc.author wudangping wwx1075776
* @tc.desc Test set a min preSharedKey is hotspot config
* @tc.level Level 2
*/
......@@ -322,6 +328,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0006
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0006
* @tc.author wudangping wwx1075776
* @tc.desc Test set a max ssid for hotspot config
* @tc.level Level 2
*/
......@@ -373,6 +380,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0007
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0007
* @tc.author wudangping wwx1075776
* @tc.desc Test set a null ssid invalid hotspot config
* @tc.level Level 2
*/
......@@ -398,6 +406,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0008
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0008
* @tc.author wudangping wwx1075776
* @tc.desc Test set a contains Chinese.special.digits valid hotspot config
* @tc.level Level 2
*/
......@@ -429,6 +438,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0009
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0009
* @tc.author wudangping wwx1075776
* @tc.desc Test set a invalid preSharedKey hotspot config
* @tc.level Level 2
*/
......@@ -479,6 +489,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0010
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0010
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid PSK preSharedKey hotspot config
* @tc.level Level 2
*/
......@@ -521,6 +532,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0011
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0011
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid OPEN preSharedKey hotspot config
* @tc.level Level 2
*/
......@@ -560,6 +572,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONFIG_0012
* @tc.name SUB_Communication_WiFi_Hotspot_Config_0012
* @tc.author wudangping wwx1075776
* @tc.desc Test set a valid hotspot config after open Hotspot
* @tc.level Level 2
*/
......@@ -607,6 +620,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONN_0001
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test set a maxConn and more maxConn hotspot config
* @tc.level Level 2
*/
......@@ -657,6 +671,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number CONN_0002
* @tc.name SUB_Communication_WiFi_Hotspot_Conn_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test Obtains the list of clients that are connected to a Wi-Fi hotspot.
* @tc.level Level 2
*/
......@@ -686,6 +701,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0001
* @tc.name testhotspotStateChangeOn
* @tc.author wudangping wwx1075776
* @tc.desc Test hotspotStateChangeOn api.
* @tc.size MEDIUM
* @tc.type Function
......@@ -709,6 +725,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0002
* @tc.name testhotspotStateChangeOff
* @tc.desc Test hotspotStateChange api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -731,6 +748,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0003
* @tc.name testhotspotStaJoinOn
* @tc.desc Test hotspotStaJoinOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -753,6 +771,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0004
* @tc.name testhotspotStaJoinOff
* @tc.desc Test hotspotStaJoin api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -775,6 +794,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_ON_0005
* @tc.name testhotspotStaLeaveOn
* @tc.desc Test hotspotStaLeaveOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -797,6 +817,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Hotspot_Off_0006
* @tc.name testhotspotStaLeaveOff
* @tc.desc Test hotspotStaLeave api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......
......@@ -27,6 +27,7 @@ function sleep(delay) {
}
}
var WifiSecurityType = {
WIFI_SEC_TYPE_INVALID: 0,
WIFI_SEC_TYPE_OPEN: 1,
......@@ -84,6 +85,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number open_0001
* @tc.name SUB_Communication_WiFi_Sta_Open_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test wifi.isWifiEnable API functionality.
*/
it('SUB_Communication_WiFi_Sta_Open_0001', 0, function() {
......@@ -92,7 +94,7 @@ describe('ACTS_WifiTest', function() {
var active = wifi.isWifiActive();
if (!active) {
var enable = wifi.enableWifi();
sleep(3000);
sleep(5000);
console.log("[wifi_test] wifi open result: " + enable);
expect(enable).assertTrue();
}
......@@ -108,6 +110,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Scan_0001
* @tc.name SUB_Communication_WiFi_Sta_Scan_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test get ScanInfos callback API functionality.
*/
it('SUB_Communication_WiFi_Sta_Scan_0001', 0, async function(done) {
......@@ -163,6 +166,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Scan_0004
* @tc.name SUB_Communication_WiFi_Sta_Scan_0004
* @tc.author wudangping wwx1075776
* @tc.desc Test wifi.getSignalLevel API functionality.
*/
it('SUB_Communication_WiFi_Sta_Scan_0004', 0, function() {
......@@ -201,6 +205,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Config_0001
* @tc.name SUB_Communication_WiFi_Sta_Config_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test create a OPEN SecurityType wifi device config
*/
it('SUB_Communication_WiFi_Sta_Config_0001', 0, async function(done) {
......@@ -255,6 +260,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Config_0002
* @tc.name SUB_Communication_WiFi_Sta_Config_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test create a PSK SecurityType wifi device config
*/
it('SUB_Communication_WiFi_Sta_Config_0002', 0, async function(done) {
......@@ -294,6 +300,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Config_0005
* @tc.name SUB_Communication_WiFi_Sta_Config_0005
* @tc.author wudangping wwx1075776
* @tc.desc Test remove all wifi device config
*/
it('SUB_Communication_WiFi_Sta_Config_0005', 0, async function(done) {
......@@ -359,6 +366,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Config_0007
* @tc.name SUB_Communication_WiFi_Sta_Config_0007
* @tc.author wudangping wwx1075776
* @tc.desc Test update wifi device config
*/
it('SUB_Communication_WiFi_Sta_Config_0007', 0, async function(done) {
......@@ -411,6 +419,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_info_0001
* @tc.name testgetMacAddress
* @tc.desc Test getMacAddress api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -432,6 +441,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_info_0002
* @tc.name testgetCountryCode
* @tc.desc Test getCountryCode api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -453,6 +463,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_info_0004
* @tc.name testFeatureSupported
* @tc.desc Test FeatureSupported api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -469,6 +480,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Conn_Info_0001
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test reconnect wifi
*/
it('SUB_Communication_WiFi_Sta_Conn_Info_0001', 0, function () {
......@@ -514,6 +526,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number conn_Config_0002
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test getLinkedInfo information
*/
it('SUB_Communication_WiFi_Sta_Conn_Info_0001', 0, async function(done) {
......@@ -559,6 +572,7 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number Conn_Info_0003
* @tc.name SUB_Communication_WiFi_Sta_Conn_Info_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test get IpInfo information
*/
it('SUB_Communication_WiFi_Sta_Conn_Info_0002', 0, function () {
......@@ -600,6 +614,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_ON_0001
* @tc.name testwifiStateChangeOn
* @tc.desc Test wifiStateChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -622,6 +637,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_Off_0002
* @tc.name testwifiStateChangeOff
* @tc.desc Test wifiStateChangeOff api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -644,6 +660,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_ON_0003
* @tc.name testwifiConnectionChnageOn
* @tc.desc Test wifiConnectionChnageOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -666,6 +683,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_Off_0004
* @tc.name testwifiConnectionChangeOff
* @tc.desc Test wifiConnectionChangeOff api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -688,6 +706,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_ON_0005
* @tc.name testwifiScanStateChangeOn
* @tc.desc Test wifiwifiScanStateChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -710,6 +729,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_Off_0006
* @tc.name testwifiScanStateChangeOff
* @tc.desc Test wifiScanStateChangeOff api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -732,6 +752,7 @@ describe('ACTS_WifiTest', function() {
* @tc.number SUB_Communication_WiFi_Sta_ON_0007
* @tc.name testwifiRssiChangeOn
* @tc.desc Test wifiRssiChangeOn api.
* @tc.author wudangping wwx1075776
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......@@ -753,7 +774,8 @@ describe('ACTS_WifiTest', function() {
/**
* @tc.number SUB_Communication_WiFi_Sta_Off_0008
* @tc.name testwifiRssiChangeOff
* @tc.desc Test wifiRssiChange api.
* @tc.desc Test wifiRssiChange api
* @tc.author wudangping wwx1075776.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
......
......@@ -17,6 +17,12 @@ import geolocation from '@ohos.geolocation';
import { LocationEventListener } from '@ohos.geolocation';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var LocationRequestScenario = {UNSET : 0x300 ,NAVIGATION : 0x301 ,
TRAJECTORY_TRACKING : 0x302 ,CAR_HAILING : 0x303,
DAILY_LIFE_SERIVICE : 0x304 ,NO_POWER : 0x305}
var LocationRequestPriority = {UNSET : 0x200 ,ACCURACY : 0x201 ,LOW_POWER : 0x202 ,FIRST_FIX :0x203}
describe('geolocationTest', function () {
beforeAll(function () {
console.info('beforeAll called')
......@@ -33,7 +39,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_ENABLE_LOCATION_PROMISE_0001
* @tc.number geolocation_enableLocation_promise_test_001
* @tc.name testenableLocation promise
* @tc.desc Test enableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -52,11 +58,11 @@ describe('geolocationTest', function () {
console.info("[lbs_js] promise then error." + error.message);
expect().assertFail();
})
done()
done()
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_IS_LOCATION_ENABLED_PROMISE_0001
* @tc.number geolocation_isLocationEnabled_promise_test_001
* @tc.name testisLocationEnabled promise
* @tc.desc Test isLocationEnabled api .
* @tc.author wangsilu wwx1075324
......@@ -88,7 +94,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_GET_ADDR_FROM_LOCATION_NAME_CALLBACK_0001
* @tc.number geolocation_getAddressesFromLocationName_callback_test_001
* @tc.name testgetAddressesFromLocationName callback
* @tc.desc Test getAddressesFromLocationName api .
* @tc.author wangsilu wwx1075324
......@@ -97,7 +103,7 @@ describe('geolocationTest', function () {
* @tc.level Level 2
*/
it('geolocation_getAddressesFromLocationName_callback_test_001', 0, async function (done) {
console.info('LBS enableLocation promise test start ...');
console.info('LBS enableLocation promise test start ...');
await geolocation.enableLocation().then((result) => {
console.info('[lbs_js] testenableLocation result: ' + result);
expect(result).assertTrue();
......@@ -109,7 +115,8 @@ describe('geolocationTest', function () {
console.info('LBS getAddressesFromLocationName callback test start ...');
var geocodeRequest = {"description": "上海市浦东新区金穗路1800号",
"maxItems": 1,"locale":"zh"};
"maxItems": 1,"locale":"zh",minLatitude:"",minLongitude:"",
maxLatitude:"",maxLongitude:""};
geolocation.getAddressesFromLocationName(geocodeRequest,
(err, data) => {
if (err) {
......@@ -150,7 +157,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_GET_ADDR_FROM_LOCATION_CALLBACK_0001
* @tc.number geolocation_getAddressesFromLocation_callback_test_001
* @tc.name testgetAddressesFromLocation callback
* @tc.desc Test getAddressesFromLocation api .
* @tc.author wangsilu wwx1075324
......@@ -205,7 +212,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_IS_GEOSERVICE_AVAIL_PROMISE_0001
* @tc.number geolocation_isGeoServiceAvailable_promise_test_001
* @tc.name testisGeoServiceAvailable promise
* @tc.desc Test isGeoServiceAvailable api .
* @tc.author wangsilu wwx1075324
......@@ -237,7 +244,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_IS_LOCATION_ENABLED_CALLBACK_0001
* @tc.number geolocation_isLocationEnabled_callback_test_001
* @tc.name testisLocationEnabled callback
* @tc.desc Test isLocationEnabled api .
* @tc.author wangsilu wwx1075324
......@@ -280,7 +287,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_GET_ADDR_FROM_LOCATION_NAME_PROMISE_0001
* @tc.number geolocation_getAddressesFromLocationName_promise_test_001
* @tc.name testgetAddressesFromLocationName promise
* @tc.desc Test getAddressesFromLocationName api .
* @tc.author wangsilu wwx1075324
......@@ -314,7 +321,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_REQUEST_ENABLE_LOCATION_CALLBACK_0001
* @tc.number geolocation_requestEnableLocation_callback_test_001
* @tc.name testrequestEnableLocation callback
* @tc.desc Test requestEnableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -338,7 +345,7 @@ describe('geolocationTest', function () {
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_REQUEST_ENABLE_LOCATION_PROMISE_0001
* @tc.number geolocation_requestEnableLocation_promise_test_001
* @tc.name testrequestEnableLocation promise
* @tc.desc Test requestEnableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -360,7 +367,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_ENABLE_LOCATION_CALLBACK_0001
* @tc.number geolocation_enableLocation_callback_test_001
* @tc.name testEnableLocation callback
* @tc.desc Test enableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -383,7 +390,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_DISABLE_LOCATION_CALLBACK_0001
* @tc.number geolocation_disableLocation_callback_test_001
* @tc.name testdisableLocation callback
* @tc.desc Test disableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -405,7 +412,7 @@ describe('geolocationTest', function () {
});
})
/** @tc.number SUB_LOCATION_geocode_DEVICE_JS_DISABLE_LOCATION_PROMISE_0001
/** @tc.number geolocation_disableLocation_promise_test_001
* @tc.name testdisableLocation promise
* @tc.desc Test disableLocation api .
* @tc.author wangsilu wwx1075324
......@@ -424,7 +431,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_GET_ADDR_FROM_LOCATION_PROMISE_0001
* @tc.number geolocation_getAddressesFromLocation_promise_test_001
* @tc.name testgetAddressesFromLocation promise
* @tc.desc Test getAddressesFromLocation api .
* @tc.author wangsilu wwx1075324
......@@ -448,7 +455,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_GET_CURRENT_LOCATION_CALLBACK_0001
* @tc.number geolocation_GetCurrentlocation_callback_test_001
* @tc.name testGetCurrentlocation callback
* @tc.desc Test GetCurrentlocation api .
* @tc.author wangsilu wwx1075324
......@@ -468,7 +475,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_IS_GEOSERVICE_AVAIL_CALLBACK_0001
* @tc.number geolocation_isGeoServiceAvailable_callback_test_001
* @tc.name testisGeoServiceAvailable callback
* @tc.desc Test isGeoServiceAvailable api .
* @tc.author wangsilu wwx1075324
......@@ -509,7 +516,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_LOCATION_CHANGE_ON_0002
* @tc.number geolocation_locationChange_On_test_002
* @tc.name testlocationChangeOn promise
* @tc.desc Test locationChangeOn api .
* @tc.author wangsilu wwx1075324
......@@ -525,8 +532,18 @@ describe('geolocationTest', function () {
await locationEventListener.on('locationChange',requestInfo, result => {
console.info("onLocationChange callback, result: " + JSON.stringify(result));
expect(true).assertEqual(result !=null);
console.info("[lbs_js] onLocationChange latitude: " + result.latitude);
console.info("[lbs_js] onLocationChange longitude: " + result.longitude);
console.info("[lbs_js] onLocationChange altitude: " + result.altitude);
console.info("[lbs_js] onLocationChange accuracy: " + result.accuracy);
console.info("[lbs_js] onLocationChange speed: " + result.speed);
console.info("[lbs_js] onLocationChange timeStamp: " + result.timeStamp);
console.info("[lbs_js] onLocationChange direction: " + result.direction);
console.info("[lbs_js] onLocationChange additions: " + result.additions);
console.info("[lbs_js] onLocationChange additionSize: " + result.additionSize);
done();
});
console.info('LBS enableLocation callback test start ...');
geolocation.enableLocation((err, data) => {
if (err) {
......@@ -542,7 +559,7 @@ describe('geolocationTest', function () {
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_ON_LOCATION_SERVICE_STATE_0001
* @tc.number geolocation_OnLocationServiceState_test_001
* @tc.name testOnLocationServiceState
* @tc.desc Test OnLocationServiceState api .
* @tc.author wangsilu wwx1075324
......@@ -569,11 +586,11 @@ describe('geolocationTest', function () {
}
done()
});
})
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_ON_LOCATION_SERVICE_STATE_0001
* @tc.name testOnLocationServiceState
* @tc.number geolocation_offLocationServiceState_test_001
* @tc.name testoffLocationServiceState
* @tc.desc Test offLocationServiceState api .
* @tc.author wangsilu wwx1075324
* @tc.size MEDIUM
......@@ -614,14 +631,37 @@ describe('geolocationTest', function () {
console.info('LBS offLocationServiceState test start ...');
locationEventListener.off('locationServiceState', result => {
console.info("offlocationServiceState callback, result: " + JSON.stringify(result));
expect(true).assertEqual(result !=null);
done();
console.info("offlocationServiceState callback, result: " + JSON.stringify(result));
expect(true).assertEqual(result !=null);
done();
});
})
/**
* @tc.number geolocation_getLastLocation_callback__test_001
* @tc.name testgetLastLocation callback
* @tc.desc Test getLastLocation api .
* @tc.author wangsilu wwx1075324
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('geolocation_getLastLocation_callback__test_001', 0, async function (done) {
console.info('LBS getLastLocation test start ...');
geolocation.getLastLocation((err, data) => {
if (err) {
console.info('[lbs_js] getLastLocation callback err is : ' + err );
}else {
console.info("[lbs_js] getLastLocation callback data: " + JSON.stringify(data));
expect(data).assertTrue(data != null);
console.info("[lbs_js] getLastLocation callback exit .");
}
});
done();
})
/**
* @tc.number SUB_LOCATION_geocode_DEVICE_JS_LOCATION_SERVICE_OFF_0002
* @tc.number geolocation_locationChange_Off_test_002
* @tc.name testlocationChangeOff promise
* @tc.desc Test locationChangeoff api .
* @tc.author wangsilu wwx1075324
......@@ -671,5 +711,89 @@ describe('geolocationTest', function () {
done();
});
})
/**
* @tc.number geolocation_getLastLocation_promise__test_001
* @tc.name testgetLastLocation promise
* @tc.desc Test getLastLocation api .
* @tc.author wangsilu wwx1075324
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('geolocation_getLastLocation_promise__test_001', 0, async function (done) {
console.info('LBS getLastLocation test start ...');
geolocation.getLastLocation().then((result) => {
console.info("[lbs_js] getLastLocation promise data: " + JSON.stringify(result));
expect(data).assertTrue(data != null);
console.info("[lbs_js] getLastLocation promise exit .");
done();
}).catch(error => {
console.info('[lbs_js] getLastLocation promise err is : ' + err );
expect().assertFail();
done();
});
})
/**
* @tc.number geolocation_isLocationPrivacyConfirmed_promise_test_001
* @tc.name Test setLocationPrivacyConfirmStatus promise
* @tc.desc Test setLocationPrivacyConfirmStatus api .
* @tc.author wangsilu wwx1075324
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('geolocation_setLocationPrivacyConfirmStatus_promise_test_001', 0, async function (done) {
let reqType = 1;
let value = true;
let type = "STARTUP";
if(type == "OTHERS"){
reqType = 0;
}
if(type == "STARTUP"){
reqType = 1;
}
if(type == "CORE_LOCATION"){
reqType = 2;
}
console.info('LBS setLocationPrivacyConfirmStatus promise test start ...')
geolocation.setLocationPrivacyConfirmStatus(reqType,value).then((resp) => {
console.log("[lbs_js] setLocationPrivacyConfirmStatus current type is "+ JSON.stringify(resp))
expect(resp).assertTrue();
done();
})
})
/**
* @tc.number geolocation_isLocationPrivacyConfirmed_promise_test_001
* @tc.name Test isLocationPrivacyConfirmed promise
* @tc.desc Test isLocationPrivacyConfirmed api .
* @tc.author wangsilu wwx1075324
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it('geolocation_isLocationPrivacyConfirmed_promise_test_001', 0, async function (done) {
let reqType = 1;
let value = true;
console.info('LBS setLocationPrivacyConfirmStatus promise test start ...')
geolocation.setLocationPrivacyConfirmStatus(reqType,value).then((resp) => {
console.log("[lbs_js] setLocationPrivacyConfirmStatus current type is "+ JSON.stringify(resp))
expect(resp).assertTrue();
})
console.info('LBS isLocationPrivacyConfirmed promise test start ...');
geolocation.isLocationPrivacyConfirmed(reqType).then(resp => {
console.log("[lbs_js] isLocationPrivacyConfirmed current type is "+ JSON.stringify(resp))
expect(resp).assertTrue();
console.info("[lbs_js] isLocationPrivacyConfirmed callback exit .");
done();
})
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册