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

!5295 【location】脚本优化

Merge pull request !5295 from 权力/myfeature
...@@ -90,13 +90,13 @@ describe('geolocationTest_4', function () { ...@@ -90,13 +90,13 @@ describe('geolocationTest_4', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_CountryCode_0001 * @tc.number SUB_HSS_LocationSystem_CountryCode_0100
* @tc.name Test getCountryCode * @tc.name Test getCountryCode
* @tc.desc Obtaining Country Code Information * @tc.desc Obtaining Country Code Information
* @tc.type Function * @tc.type Function
* @tc.level since 9 * @tc.level since 9
*/ */
it('SUB_HSS_LocationSystem_CountryCode_0001', 0, async function (done) { it('SUB_HSS_LocationSystem_CountryCode_0100', 0, async function (done) {
await geolocation.getCountryCode().then((result) => { await geolocation.getCountryCode().then((result) => {
console.info("[lbs_js] getCountryCode promise result: " + JSON.stringify(result)); console.info("[lbs_js] getCountryCode promise result: " + JSON.stringify(result));
console.info("[lbs_js] country :" + result.country); console.info("[lbs_js] country :" + result.country);
...@@ -113,13 +113,13 @@ describe('geolocationTest_4', function () { ...@@ -113,13 +113,13 @@ describe('geolocationTest_4', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_CountryCode_0002 * @tc.number SUB_HSS_LocationSystem_CountryCode_0200
* @tc.name Test getCountryCode * @tc.name Test getCountryCode
* @tc.desc Obtaining Country Code Information * @tc.desc Obtaining Country Code Information
* @tc.type Function * @tc.type Function
* @tc.level since 9 * @tc.level since 9
*/ */
it('SUB_HSS_LocationSystem_CountryCode_0002', 0, async function (done) { it('SUB_HSS_LocationSystem_CountryCode_0200', 0, async function (done) {
function getCountryCodeCallback() { function getCountryCodeCallback() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
geolocation.getCountryCode((err) => { geolocation.getCountryCode((err) => {
...@@ -137,13 +137,13 @@ describe('geolocationTest_4', function () { ...@@ -137,13 +137,13 @@ describe('geolocationTest_4', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_CountryCode_0003 * @tc.number SUB_HSS_LocationSystem_CountryCode_0300
* @tc.name getCountryCode_on_off * @tc.name getCountryCode_on_off
* @tc.desc The interception country code is changed. * @tc.desc The interception country code is changed.
* @tc.type Function * @tc.type Function
* @tc.level since 9 * @tc.level since 9
*/ */
it('SUB_HSS_LocationSystem_CountryCode_0003', 0, async function (done) { it('SUB_HSS_LocationSystem_CountryCode_0300', 0, async function (done) {
console.info("[lbs_js]countryCodeChange"); console.info("[lbs_js]countryCodeChange");
geolocation.on('countryCodeChange', function (data) { geolocation.on('countryCodeChange', function (data) {
console.info('[lbs_js] countryCodeChange' +JSON.stringify(data) ); console.info('[lbs_js] countryCodeChange' +JSON.stringify(data) );
......
...@@ -83,14 +83,14 @@ describe('geolocationTest_geo2', function () { ...@@ -83,14 +83,14 @@ describe('geolocationTest_geo2', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_systemapi_0001 * @tc.number SUB_HSS_LocationSystem_systemapi_0100
* @tc.name Test getLocation * @tc.name Test getLocation
* @tc.desc Obtains the geographical location of a device.. * @tc.desc Obtains the geographical location of a device..
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_systemapi_0001', 0, async function (done) { it('SUB_HSS_LocationSystem_systemapi_0100', 0, async function (done) {
geolocations.getLocation({ geolocations.getLocation({
timeout:30000, timeout:30000,
coordType:'wgs84', coordType:'wgs84',
...@@ -127,14 +127,14 @@ describe('geolocationTest_geo2', function () { ...@@ -127,14 +127,14 @@ describe('geolocationTest_geo2', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_systemapi_0002 * @tc.number SUB_HSS_LocationSystem_systemapi_0200
* @tc.name Test subscribe and unsubscribe * @tc.name Test subscribe and unsubscribe
* @tc.desc Test subscribe api . * @tc.desc Test subscribe api .
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_systemapi_0002', 0, async function (done) { it('SUB_HSS_LocationSystem_systemapi_0200', 0, async function (done) {
geolocations.subscribe({ geolocations.subscribe({
coordType:'wgs84', coordType:'wgs84',
success: function(data) { success: function(data) {
...@@ -152,14 +152,14 @@ describe('geolocationTest_geo2', function () { ...@@ -152,14 +152,14 @@ describe('geolocationTest_geo2', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_systemapi_0003 * @tc.number SUB_HSS_LocationSystem_systemapi_0300
* @tc.name test getLocationType * @tc.name test getLocationType
* @tc.desc Subscribing to geographical location information . * @tc.desc Subscribing to geographical location information .
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_systemapi_0003', 0, async function (done) { it('SUB_HSS_LocationSystem_systemapi_0300', 0, async function (done) {
geolocations.getLocationType({ geolocations.getLocationType({
success: function(data) { success: function(data) {
console.log('success get location type:' + JSON.stringify(data)); console.log('success get location type:' + JSON.stringify(data));
...@@ -178,14 +178,14 @@ describe('geolocationTest_geo2', function () { ...@@ -178,14 +178,14 @@ describe('geolocationTest_geo2', function () {
}) })
/** /**
* @tc.number SUB_HSS_LocationSystem_systemapi_0004 * @tc.number SUB_HSS_LocationSystem_systemapi_0400
* @tc.name Test getSupportedCoordTypes * @tc.name Test getSupportedCoordTypes
* @tc.desc Obtains the geographical location of a device.. * @tc.desc Obtains the geographical location of a device..
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type Function * @tc.type Function
* @tc.level Level 2 * @tc.level Level 2
*/ */
it('SUB_HSS_LocationSystem_systemapi_0004', 0, function () { it('SUB_HSS_LocationSystem_systemapi_0400', 0, function () {
let types = geolocations.getSupportedCoordTypes(); let types = geolocations.getSupportedCoordTypes();
console.info('[lbs_js] getSupportedCoordTypes result: ' + JSON.stringify(types)); console.info('[lbs_js] getSupportedCoordTypes result: ' + JSON.stringify(types));
expect(true).assertEqual(types.length !=0); expect(true).assertEqual(types.length !=0);
...@@ -196,9 +196,3 @@ describe('geolocationTest_geo2', function () { ...@@ -196,9 +196,3 @@ describe('geolocationTest_geo2', function () {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册