From e4e1f623e00129a0ee32294778c30288fd98a2dc Mon Sep 17 00:00:00 2001 From: zhangfuzhi Date: Fri, 6 Jan 2023 10:29:13 +0800 Subject: [PATCH] add smsmmsbatchinsert Signed-off-by: zhangfuzhi --- .../call_manager/src/main/config.json | 2 +- .../cellular_data/src/main/config.json | 2 +- .../sms_mms/src/main/config.json | 2 +- .../sms_mms/src/main/js/MainAbility/app.js | 2 +- .../main/js/MainAbility/pages/index/index.js | 10 ++++---- .../js/TestRunner/OpenHarmonyTestRunner.js | 10 ++++---- .../sms_mms/src/main/js/test/List.test.js | 2 +- .../main/js/test/SmsMmsBatchInsert.test.js | 25 ++++++++++--------- 8 files changed, 28 insertions(+), 27 deletions(-) diff --git a/telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json b/telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json index 89589fce8..afa33f835 100644 --- a/telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json +++ b/telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json @@ -8,7 +8,7 @@ }, "apiVersion": { "compatible": 4, - "target": 5, + "target": 7, "releaseType": "Release" } }, diff --git a/telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json b/telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json index d0a893040..74b5fe73e 100644 --- a/telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json +++ b/telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json @@ -8,7 +8,7 @@ }, "apiVersion": { "compatible": 4, - "target": 5, + "target": 7, "releaseType": "Release" } }, diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json index 49bbcd0b2..e59af5c88 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json @@ -8,7 +8,7 @@ }, "apiVersion": { "compatible": 4, - "target": 5, + "target": 7, "releaseType": "Release" } }, diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js index d5d6f8c03..b4e801145 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js @@ -14,7 +14,7 @@ */ export default { onCreate() { - console.info('TestApplication onCreate') + console.info('TestApplication onCreate'); }, onDestroy() { diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js index 168e3ac93..3fe73f9a9 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js @@ -13,9 +13,9 @@ * limitations under the License. */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../../../test/List.test' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../../../test/List.test'; const injectRef = Object.getPrototypeOf(global) || global injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') @@ -25,13 +25,13 @@ export default { title: '' }, onInit () { - this.title = this.$t('strings.world'); + this.title = this.$t('strings.world') }, onShow () { console.info('onShow finish!'); var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') + console.info('start run testcase!!!'); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onReady () { diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js index 04f59896e..48030915a 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; function translateParamsToString(parameters) { const keySet = new Set([ @@ -32,10 +32,10 @@ function translateParamsToString(parameters) { export default { onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info('OpenHarmonyTestRunner OnPrepare'); }, onRun() { - console.log('OpenHarmonyTestRunner onRun run') + console.log('OpenHarmonyTestRunner onRun run'); var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() @@ -44,12 +44,12 @@ function translateParamsToString(parameters) { var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) + console.info('debug value : '+debug); if (debug == 'true') { cmd += ' -D' } - console.info('cmd : '+cmd) + console.info('cmd : '+cmd); abilityDelegator.executeShellCommand(cmd, (err, data) => { console.info('executeShellCommand : err : ' + JSON.stringify(err)); console.info('executeShellCommand : data : ' + data.stdResult); diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js index 0147eb134..4351c20ac 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import SmsMmsBatchInsert from './SmsMmsBatchInsert.test' +import SmsMmsBatchInsert from './SmsMmsBatchInsert.test'; export default function testsuite() { SmsMmsBatchInsert(); diff --git a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js index 5143572ca..cf1dc8cfa 100644 --- a/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js +++ b/telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js @@ -96,8 +96,9 @@ export default function SmsMmsBatchInsert() { var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); - if (now.getTime() > exitTime) - return; + if (now.getTime() > exitTime){ + return; + } } } @@ -138,8 +139,8 @@ export default function SmsMmsBatchInsert() { } ExpectTrue(data.code === 0); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); - }) - await sleep(100); + }); + sleep(100); try { let data = await DAHelper.query(URL_INFO); ExpectTrue(data.rowCount === num); @@ -175,7 +176,7 @@ export default function SmsMmsBatchInsert() { ExpectFalse(); console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data)); done(); - }) + }); }); /* @@ -195,8 +196,8 @@ export default function SmsMmsBatchInsert() { } ExpectTrue(data.code === 0); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); - }) - await sleep(100); + }); + sleep(100); try { let data = await DAHelper.query(URL_INFO); ExpectTrue(data.rowCount === 0); @@ -229,8 +230,8 @@ export default function SmsMmsBatchInsert() { } ExpectTrue(data.code === 0); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); - }) - await sleep(2000); + }); + sleep(2000); try { let data = await DAHelper.query(URL_INFO); ExpectTrue(data.rowCount === num); @@ -266,7 +267,7 @@ export default function SmsMmsBatchInsert() { ExpectFalse(); console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data)); done(); - }) + }); }); /* @@ -347,7 +348,7 @@ export default function SmsMmsBatchInsert() { done(); return; } - await sleep(100); + sleep(100); try { let data = await DAHelper.query(URL_INFO); ExpectTrue(data.rowCount === 0); @@ -383,7 +384,7 @@ export default function SmsMmsBatchInsert() { done(); return; } - await sleep(100); + sleep(100); try { let data = await DAHelper.query(URL_INFO); ExpectTrue(data.rowCount === num); -- GitLab