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

!5194 XTS失败用例适配-主干挑单

Merge pull request !5194 from chengxingzhen/monthly_20220816
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,39 +13,39 @@ ...@@ -13,39 +13,39 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() { export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () { describe('ACTS_AACommand_01_3', function () {
/** /**
* @tc.number: ACTS_AACommand_printSync_0100 * @tc.number: ACTS_AACommand_printSync_01_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The printSync information includes Chinese, special characters, etc. * The printSync information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0100', 0, async function (done) { it('ACTS_AACommand_printSync_01_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 start ====> " ) console.log("ACTS_AACommand_printSync_01_0100 start ====> " )
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg); globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0100 printSync end ====> " ) console.log("ACTS_AACommand_printSync_01_0100 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0100 end' var finishmsg = 'ACTS_AACommand_printSync_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_printSync_0100 finishTest test end ========> callback " ) console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_0100 finishTest test end " + console.log("ACTS_AACommand_printSync_01_0100 finishTest test end " +
"========> callback data: "+JSON.stringify(data)) "========> callback data: "+JSON.stringify(data))
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_printSync_0200 * @tc.number: ACTS_AACommand_printSync_01_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The length of the printSync message is 1000 characters. * The length of the printSync message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0200', 0, async function (done) { it('ACTS_AACommand_printSync_01_0200', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + 'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -58,22 +58,22 @@ export default function abilityTest() { ...@@ -58,22 +58,22 @@ export default function abilityTest() {
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.printSync(msg); globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0200 printSync end ====> " ) console.log("ACTS_AACommand_printSync_01_0200 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0200 end' var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0200 print test end ========> callback " ) console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_printSync_0300 * @tc.number: ACTS_AACommand_printSync_01_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
* The length of the printSync message is greater than 1000 characters. * The length of the printSync message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0300', 0, async function (done) { it('ACTS_AACommand_printSync_01_0300', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + 'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -87,27 +87,27 @@ export default function abilityTest() { ...@@ -87,27 +87,27 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff' 'fffffffffff'
globalThis.abilityDelegator.printSync(msg); globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " ) console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0300 end' var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0300 print test end ========> callback " ) console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_printSync_0400 * @tc.number: ACTS_AACommand_printSync_01_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* printSync information is null. * printSync information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0400', 0, async function (done) { it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
globalThis.abilityDelegator.printSync(null); globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " ) console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0400 end' var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0400 print test end ========> callback " ) console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
done() done()
}) })
}) })
......
...@@ -14,20 +14,11 @@ ...@@ -14,20 +14,11 @@
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
globalThis.abilityContext = this.context; globalThis.abilityContext = this.context;
console.log('MainAbility onCreate') console.log('MainAbility onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
} }
onDestroy() { onDestroy() {
...@@ -36,7 +27,7 @@ export default class MainAbility extends Ability { ...@@ -36,7 +27,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate') console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null) windowStage.setUIContent(this.context, 'pages/index', null)
} }
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
...@@ -13,17 +13,103 @@ ...@@ -13,17 +13,103 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
@Entry @Entry
@Component @Component
struct Index { struct Index {
@State message: string = 'Hello World' aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
let cmd: any
let abilityDelegatorArguments: any
let abilityDelegator: any
function sleep(delay) {
let start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
}
}
function test(time) {
sleep(time);
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult2 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ')
})
test(3000)
setTimeout(() => {
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, 15000)
}
@State message: string = 'Hello World'
build() { build() {
Row() { Row() {
Column() { Column() {
Text(this.message) Text(this.message)
.fontSize(50) .fontSize(50)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
} }
.width('100%') .width('100%')
} }
......
...@@ -14,21 +14,10 @@ ...@@ -14,21 +14,10 @@
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager';
const DELAY = 3000 let msg: any
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function abilityTest() { export default function abilityTest() {
describe('ActsAbilityTest', function () { describe('ActsAbilityTest', function () {
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
return true;
}
}
return false;
}
/** /**
* @tc.number: ACTS_AACommand_printSync_0100 * @tc.number: ACTS_AACommand_printSync_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
...@@ -37,27 +26,10 @@ export default function abilityTest() { ...@@ -37,27 +26,10 @@ export default function abilityTest() {
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0100', 0, async function (done) { it('ACTS_AACommand_printSync_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 --- start") console.log('ACTS_AACommand_printSync_0100 --- start')
var cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' + msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0100 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult1).assertContain(msg)
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' done()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0100 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0100 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0100 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0100====>infores = " + infores)
expect(infores==false).assertEqual(true);
done();
}, DELAY )
}) })
/** /**
...@@ -68,37 +40,20 @@ export default function abilityTest() { ...@@ -68,37 +40,20 @@ export default function abilityTest() {
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0200', 0, async function (done) { it('ACTS_AACommand_printSync_0200', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0200 --- start") console.log('ACTS_AACommand_printSync_0200 --- start')
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0200 -s unittest OpenHarmonyTestRunner' 'aaaaaaaaaa' +
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + expect(globalThis.stdResult2).assertContain(msg);
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' done();
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0200 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0200 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0200 getProcessRunningInfos ======> ' +
'' + JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0200====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -109,41 +64,21 @@ export default function abilityTest() { ...@@ -109,41 +64,21 @@ export default function abilityTest() {
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0300', 0, async function (done) { it('ACTS_AACommand_printSync_0300', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0300 --- start") console.log('ACTS_AACommand_printSync_0300 --- start')
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0300 -s unittest OpenHarmonyTestRunner' 'aaaaaaaaaa' +
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + expect(globalThis.stdResult3).assertContain(msg);
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' done()
var msgcopy = 'fffffffffff'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0300 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0300 query string i = ' + i);
expect(i == -1).assertEqual(false);
var j = data.stdResult.indexOf(msgcopy);
console.log('ACTS_AACommand_printSync_0300 === query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0300 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0300====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -154,24 +89,10 @@ export default function abilityTest() { ...@@ -154,24 +89,10 @@ export default function abilityTest() {
* the test command. * the test command.
*/ */
it('ACTS_AACommand_printSync_0400', 0, async function (done) { it('ACTS_AACommand_printSync_0400', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0400 --- start") console.log('ACTS_AACommand_printSync_0400 --- start')
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + msg = 'start ability successfully';
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0400 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult4).assertContain(msg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { done();
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0400 stdResult = ' + data.stdResult)
expect(data.stdResult.indexOf('start ability successfully')==-1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0400 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0400====>infores = ")
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
}) })
} }
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -14,40 +14,40 @@ ...@@ -14,40 +14,40 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() { export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () { describe('ACTS_AACommand_01_3', function () {
/** /**
* @tc.number: ACTS_AACommand_print_0100 * @tc.number: ACTS_AACommand_print_01_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The print information includes Chinese, special characters, etc. * called in AsyncCallback mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0100', 0, async function (done) { it('ACTS_AACommand_print_01_0100', 0, async function (done) {
console.log("ACTS_AACommand_print_0100 start ====> " ) console.log("ACTS_AACommand_print_01_0100 start ====> " )
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.print(msg,(err,data)=>{ globalThis.abilityDelegator.print(msg,(err,data)=>{
console.log("ACTS_AACommand_print_0100 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0100 print test end ========> callback " )
console.log("ACTS_AACommand_print_0100 print test end ========> callback err: "+JSON.stringify(err) ) console.log("ACTS_AACommand_print_01_0100 print test end ========> callback err: "+JSON.stringify(err) )
console.log("ACTS_AACommand_print_0100 print test end ========> callback data: "+JSON.stringify(data)) console.log("ACTS_AACommand_print_01_0100 print test end ========> callback data: "+JSON.stringify(data))
}) })
var finishmsg = 'ACTS_AACommand_print_0100 end' var finishmsg = 'ACTS_AACommand_print_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_print_0100 finishTest test end ========> callback " ) console.log("ACTS_AACommand_print_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_print_0100 finishTest test end ========> callback data: "+JSON.stringify(data)) console.log("ACTS_AACommand_print_01_0100 finishTest test end ========> callback data: "+JSON.stringify(data))
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0200 * @tc.number: ACTS_AACommand_print_01_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is 1000 characters. * called in AsyncCallback mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0200', 0, async function (done) { it('ACTS_AACommand_print_01_0200', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + 'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -62,21 +62,21 @@ export default function abilityTest() { ...@@ -62,21 +62,21 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg,()=>{ globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " ) console.log("print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0200 end' var finishmsg = 'ACTS_AACommand_print_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0200 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0200 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0300 * @tc.number: ACTS_AACommand_print_01_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. The length of the print message is greater than 1000 characters. * called in AsyncCallback mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0300', 0, async function (done) { it('ACTS_AACommand_print_01_0300', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -91,58 +91,58 @@ export default function abilityTest() { ...@@ -91,58 +91,58 @@ export default function abilityTest() {
globalThis.abilityDelegator.print(msg,()=>{ globalThis.abilityDelegator.print(msg,()=>{
console.log("print test end ========> callback " ) console.log("print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0300 end' var finishmsg = 'ACTS_AACommand_print_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0300 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0300 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0400 * @tc.number: ACTS_AACommand_print_01_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in AsyncCallback mode. print information is null. * called in AsyncCallback mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0400', 0, async function (done) { it('ACTS_AACommand_print_01_0400', 0, async function (done) {
globalThis.abilityDelegator.print(null,()=>{ globalThis.abilityDelegator.print(null,()=>{
console.log("print test end ========> callback " ) console.log("print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0400 end' var finishmsg = 'ACTS_AACommand_print_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0400 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0400 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0500 * @tc.number: ACTS_AACommand_print_01_0500
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The print information includes Chinese, special characters, etc. * called in Promise mode. The print information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0500', 0, async function (done) { it('ACTS_AACommand_print_01_0500', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.print(msg).then(()=>{ globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_0500 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0500 end' var finishmsg = 'ACTS_AACommand_print_01_0500 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0500 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0500 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0600 * @tc.number: ACTS_AACommand_print_01_0600
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is 1000 characters. * called in Promise mode. The length of the print message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command. * through the test command.
*/ */
it('ACTS_AACommand_print_0600', 0, async function (done) { it('ACTS_AACommand_print_01_0600', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -154,23 +154,23 @@ export default function abilityTest() { ...@@ -154,23 +154,23 @@ export default function abilityTest() {
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.print(msg).then(()=>{ globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_0600 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0600 print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0600 end' var finishmsg = 'ACTS_AACommand_print_01_0600 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0600 2 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0600 2 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0700 * @tc.number: ACTS_AACommand_print_01_0700
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. The length of the print message is greater than 1000 characters. * called in Promise mode. The length of the print message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command. * the test command.
*/ */
it('ACTS_AACommand_print_0700', 0, async function (done) { it('ACTS_AACommand_print_01_0700', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
...@@ -183,197 +183,197 @@ export default function abilityTest() { ...@@ -183,197 +183,197 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff' 'fffffffffff'
globalThis.abilityDelegator.print(msg).then(()=>{ globalThis.abilityDelegator.print(msg).then(()=>{
console.log("ACTS_AACommand_print_0700 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0700 print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0700 end' var finishmsg = 'ACTS_AACommand_print_01_0700 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0700 2 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0700 2 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0800 * @tc.number: ACTS_AACommand_print_01_0800
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
* called in Promise mode. print information is null. * called in Promise mode. print information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally * @tc.desc: Verify that the test framework can be started normally and the logs can be output normally
* through the test command. * through the test command.
*/ */
it('ACTS_AACommand_print_0800', 0, async function (done) { it('ACTS_AACommand_print_01_0800', 0, async function (done) {
globalThis.abilityDelegator.print("").then(()=>{ globalThis.abilityDelegator.print("").then(()=>{
console.log("ACTS_AACommand_print_0800 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0800 print test end ========> callback " )
}) })
var finishmsg = 'ACTS_AACommand_print_0800 end' var finishmsg = 'ACTS_AACommand_print_01_0800 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{ globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_print_0800 2 print test end ========> callback " ) console.log("ACTS_AACommand_print_01_0800 2 print test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0100 * @tc.number: ACTS_AACommand_finishTest_01_0100
* @tc.name: Each parameter of the test command is valid, and the finishTest interface is called * @tc.name: Each parameter of the test command is valid, and the finishTest interface is called
* in AsyncCallback mode. * in AsyncCallback mode.
* The msg parameter is valid (including Chinese and special characters) and the code parameter * The msg parameter is valid (including Chinese and special characters) and the code parameter
* is valid (1). * is valid (1).
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0100', 0, async function (done) { it('ACTS_AACommand_finish_01_0100', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146ACTS_AACommand_finish_0100' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146ACTS_AACommand_finish_01_0100'
globalThis.abilityDelegator.finishTest(msg, 1,()=>{ globalThis.abilityDelegator.finishTest(msg, 1,()=>{
console.log("ACTS_AACommand_finish_0100 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0100 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0200 * @tc.number: ACTS_AACommand_finishTest_01_0200
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid (null) and the code parameter is valid (1) * mode. The msg parameter is invalid (null) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0200', 0, async function (done) { it('ACTS_AACommand_finish_01_0200', 0, async function (done) {
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_0200 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_0200 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
done(); done();
}, 3000) }, 3000)
var code = globalThis.abilityDelegator.finishTest(null, 1,()=>{ var code = globalThis.abilityDelegator.finishTest(null, 1,()=>{
console.log(" ACTS_AACommand_finish_0200 finishTest test end ========> callback " ) console.log(" ACTS_AACommand_finish_01_0200 finishTest test end ========> callback " )
expect().assertFail(); expect().assertFail();
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0300 * @tc.number: ACTS_AACommand_finishTest_01_0300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid (Undefined) and the code parameter is valid (1) * mode. The msg parameter is invalid (Undefined) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0300', 0, async function (done) { it('ACTS_AACommand_finish_01_0300', 0, async function (done) {
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_0300 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_0300 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
done(); done();
}, 3000) }, 3000)
var code = globalThis.abilityDelegator.finishTest(undefined, 1,()=>{ var code = globalThis.abilityDelegator.finishTest(undefined, 1,()=>{
console.log(" ACTS_AACommand_finish_0300 finishTest test end ========> callback " ) console.log(" ACTS_AACommand_finish_01_0300 finishTest test end ========> callback " )
expect().assertFail(); expect().assertFail();
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0400 * @tc.number: ACTS_AACommand_finishTest_01_0400
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter * mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE) * is valid (Number.MAX_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0400', 0, async function (done) { it('ACTS_AACommand_finish_01_0400', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MAX_VALUE,()=>{ globalThis.abilityDelegator.finishTest(msg, Number.MAX_VALUE,()=>{
console.log("ACTS_AACommand_finish_0400 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0400 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0500 * @tc.number: ACTS_AACommand_finishTest_01_0500
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter * mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter
* is valid (Number.MIN_VALUE) * is valid (Number.MIN_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0500', 0, async function (done) { it('ACTS_AACommand_finish_01_0500', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE,()=>{ globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE,()=>{
console.log("ACTS_AACommand_finish_0500 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0500 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0600 * @tc.number: ACTS_AACommand_finishTest_01_0600
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter * mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE+1) * is valid (Number.MAX_VALUE+1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0600', 0, async function (done) { it('ACTS_AACommand_finish_01_0600', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE+1),()=>{ globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE+1),()=>{
console.log("ACTS_AACommand_finish_0600 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0600 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0700 * @tc.number: ACTS_AACommand_finishTest_01_0700
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter * mode. The msg parameter is invalid(including Chinese and special characters) and the code parameter
* is valid (Number.MIN_VALUE-1) * is valid (Number.MIN_VALUE-1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0700', 0, async function (done) { it('ACTS_AACommand_finish_01_0700', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE-1),()=>{ globalThis.abilityDelegator.finishTest(msg, (Number.MIN_VALUE-1),()=>{
console.log("ACTS_AACommand_finish_0700 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0700 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0800 * @tc.number: ACTS_AACommand_finishTest_01_0800
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the * mode. The msg parameter is invalid(including Chinese and special characters) and the
* code parameter is valid (“ABCD”) * code parameter is valid (“ABCD”)
* @tc.desc: Verify that the process of the test framework is not stopped by calling this interface. * @tc.desc: Verify that the process of the test framework is not stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0800', 0, async function (done) { it('ACTS_AACommand_finish_01_0800', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_0800 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_0800 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
done(); done();
}, 3000) }, 3000)
var code = globalThis.abilityDelegator.finishTest(msg, 'ABCD',()=>{ var code = globalThis.abilityDelegator.finishTest(msg, 'ABCD',()=>{
console.log(" ACTS_AACommand_finish_0800 finishTest test end ========> callback " ) console.log(" ACTS_AACommand_finish_01_0800 finishTest test end ========> callback " )
expect().assertFail(); expect().assertFail();
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_0900 * @tc.number: ACTS_AACommand_finishTest_01_0900
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter * mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (1) * is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_0900', 0, async function (done) { it('ACTS_AACommand_finish_01_0900', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, 1).then(() => { globalThis.abilityDelegator.finishTest(msg, 1).then(() => {
console.log("ACTS_AACommand_finish_0900 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_0900 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1000 * @tc.number: ACTS_AACommand_finishTest_01_1000
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is invalid(null) and the code parameter is valid (1) * mode. The msg parameter is invalid(null) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1000', 0, async function (done) { it('ACTS_AACommand_finish_01_1000', 0, async function (done) {
var code = null var code = null
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_1000 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_1000 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
...@@ -383,15 +383,15 @@ export default function abilityTest() { ...@@ -383,15 +383,15 @@ export default function abilityTest() {
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1100 * @tc.number: ACTS_AACommand_finishTest_01_1100
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is invalid(undefined) and the code parameter is valid (1) * mode. The msg parameter is invalid(undefined) and the code parameter is valid (1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1100', 0, async function (done) { it('ACTS_AACommand_finish_01_1100', 0, async function (done) {
var code=null var code=null
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_1100 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_1100 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
...@@ -401,77 +401,62 @@ export default function abilityTest() { ...@@ -401,77 +401,62 @@ export default function abilityTest() {
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1200 * @tc.number: ACTS_AACommand_finishTest_01_1300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finish_1200', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MAX_VALUE).then(()=>{
console.log("ACTS_AACommand_finish_1200 finishTest test end ========> callback " )
done()
})
})
/**
* @tc.number: ACTS_AACommand_finishTest_1300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter * mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MIN_VALUE) * is valid (Number.MIN_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1300', 0, async function (done) { it('ACTS_AACommand_finish_01_1300', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE).then(()=>{ globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE).then(()=>{
console.log("ACTS_AACommand_finish_1300 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_1300 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1400 * @tc.number: ACTS_AACommand_finishTest_01_1400
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter * mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE+1) * is valid (Number.MAX_VALUE+1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1400', 0, async function (done) { it('ACTS_AACommand_finish_01_1400', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE+1).then(()=>{ globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE+1).then(()=>{
console.log("ACTS_AACommand_finish_1400 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_1400 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1500 * @tc.number: ACTS_AACommand_finishTest_01_1500
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter * mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MIN_VALUE-1) * is valid (Number.MIN_VALUE-1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1500', 0, async function (done) { it('ACTS_AACommand_finish_01_1500', 0, async function (done) {
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE-1).then(()=>{ globalThis.abilityDelegator.finishTest(msg, Number.MIN_VALUE-1).then(()=>{
console.log("ACTS_AACommand_finish_1500 finishTest test end ========> callback " ) console.log("ACTS_AACommand_finish_01_1500 finishTest test end ========> callback " )
done() done()
}) })
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1600 * @tc.number: ACTS_AACommand_finishTest_01_1600
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter * mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (ABCD) * is valid (ABCD)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface. * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/ */
it('ACTS_AACommand_finish_1600', 0, async function (done) { it('ACTS_AACommand_finish_01_1600', 0, async function (done) {
var code = null var code = null
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
setTimeout(() => { setTimeout(() => {
console.log('ACTS_AACommand_finish_1600 code:'+JSON.stringify(code)) console.log('ACTS_AACommand_finish_01_1600 code:'+JSON.stringify(code))
if(code!=undefined){ if(code!=undefined){
expect().assertFail(); expect().assertFail();
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function abilityTest() { export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () { describe('ACTS_AACommand_01_3', function () {
......
...@@ -14,19 +14,10 @@ ...@@ -14,19 +14,10 @@
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log('MainAbility onCreate') console.log('MainAbility onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
} }
onDestroy() { onDestroy() {
...@@ -35,7 +26,7 @@ export default class MainAbility extends Ability { ...@@ -35,7 +26,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate') console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null) windowStage.setUIContent(this.context, 'pages/index', null)
globalThis.abilityContext = this.context; globalThis.abilityContext = this.context;
} }
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
...@@ -13,17 +13,490 @@ ...@@ -13,17 +13,490 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
@Entry @Entry
@Component @Component
struct Index { struct Index {
@State message: string = 'Hello World' aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
let cmd: any
let abilityDelegatorArguments: any
let abilityDelegator: any
function sleep(delay) {
let start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
}
}
function test(time) {
sleep(time);
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0700 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data));
globalThis.stdResult2 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0700 end');
})
test(3000)
cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' +
'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0200 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' +
'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult5 = data.stdResult;
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' +
'nd_print_01_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult6 = data.stdResult;
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' +
'and_print_01_0500 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0500 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult7 = data.stdResult;
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' +
'Command_print_01_0600 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0600 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult8 = data.stdResult;
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0700 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult9 = data.stdResult;
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_01_0800 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult)
globalThis.stdResult10 = data.stdResult;
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult11 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data));
globalThis.stdResult12 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0700 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult13 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0700 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0700 : data : ' + JSON.stringify(data));
globalThis.stdResult14 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0700 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0500 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult15 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0500 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0500 : data : ' + JSON.stringify(data));
globalThis.stdResult16 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0500 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0600 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult17 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0600 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0600 : data : ' + JSON.stringify(data));
globalThis.stdResult18 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0600 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0900 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0900 stdResult = ' + data.stdResult)
globalThis.stdResult19 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0900 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0900 : data : ' + JSON.stringify(data));
globalThis.stdResult20 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0900 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1300 stdResult = ' + data.stdResult)
globalThis.stdResult23 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1300 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1300 : data : ' + JSON.stringify(data));
globalThis.stdResult24 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1300 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1400 stdResult = ' + data.stdResult)
globalThis.stdResult25 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1400 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1400 : data : ' + JSON.stringify(data));
globalThis.stdResult26 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1400 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1500 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1500 stdResult = ' + data.stdResult)
globalThis.stdResult27 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1500 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1500 : data : ' + JSON.stringify(data));
globalThis.stdResult28 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1500 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0200 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0200 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0200 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0200 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0200 : data : ' + JSON.stringify(data));
globalThis.stdResult29 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0200 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0300 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0300 : data : ' + JSON.stringify(data));
globalThis.stdResult30 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0300 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0800 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_0800 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0800 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0800 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_0800 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_0800 : data : ' + JSON.stringify(data));
globalThis.stdResult31 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_0800 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1000 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1000 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1000 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1000 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1000 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1000 : data : ' + JSON.stringify(data));
globalThis.stdResult32 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1000 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1100 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1100 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1100 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1100 : data : ' + JSON.stringify(data));
globalThis.stdResult33 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1100 end');
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: start ')
console.log('ACTS_AACommand_finish_01_1600 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end')
})
test(3000)
cmd = 'aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err, data) => {
console.info('ACTS_AACommand_finish_01_1600 : err : ' + JSON.stringify(err));
console.info('ACTS_AACommand_finish_01_1600 : data : ' + JSON.stringify(data));
globalThis.stdResult34 = data["stdResult"];
console.info('ACTS_AACommand_finish_01_1600 end');
})
test(3000)
setTimeout(() => {
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, 12000)
}
@State message: string = 'Hello World'
build() { build() {
Row() { Row() {
Column() { Column() {
Text(this.message) Text(this.message)
.fontSize(50) .fontSize(50)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
} }
.width('100%') .width('100%')
} }
......
...@@ -14,20 +14,13 @@ ...@@ -14,20 +14,13 @@
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager';
const DELAY = 3000 let msg: any
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' let msgcopy: any
let finishmsg: any
let finishmsg1: any
export default function abilityTest() { export default function abilityTest() {
describe('ACTS_AACommand_Test', function () { describe('ACTS_AACommand_Test', function () {
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
return true;
}
}
return false;
}
/** /**
* @tc.number: ACTS_AACommand_0100 * @tc.number: ACTS_AACommand_0100
...@@ -39,10 +32,10 @@ export default function abilityTest() { ...@@ -39,10 +32,10 @@ export default function abilityTest() {
it('ACTS_AACommand_0100', 0, async function (done) { it('ACTS_AACommand_0100', 0, async function (done) {
console.log("ACTS_AACommand_0100 --- start") console.log("ACTS_AACommand_0100 --- start")
let cmd = 'aa test -b com.example.actsaacommandtesta' + let cmd = 'aa test -b com.example.actsaacommandtesta' +
'test -m entry_test ' + 'test -m entry_test ' +
'-s unittest OpenHarmonyTestRunner ' + '-s unittest OpenHarmonyTestRunner ' +
'-w 40 -s class ACTS_AACommand_01_3 -s level 1 -s size 0 -s testType aaa -s '+ '-w 40 -s class ACTS_AACommand_01_3 -s level 1 -s size 0 -s testType aaa -s ' +
'timeout 5 -s 1 3 -D' 'timeout 5 -s 1 3 -D'
let delay = 3000 let delay = 3000
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_0100 - executeShellCommand: start ') console.log('ACTS_AACommand_0100 - executeShellCommand: start ')
...@@ -109,8 +102,8 @@ export default function abilityTest() { ...@@ -109,8 +102,8 @@ export default function abilityTest() {
it('ACTS_AACommand_0400', 0, async function (done) { it('ACTS_AACommand_0400', 0, async function (done) {
console.log("ACTS_AACommand_0400 --- start") console.log("ACTS_AACommand_0400 --- start")
let cmd = 'aa test -b com.example.actsaacommandtestatest -m entry_test ' + let cmd = 'aa test -b com.example.actsaacommandtestatest -m entry_test ' +
'-s unittest OpenHarmonyTestRunner ' + '-s unittest OpenHarmonyTestRunner ' +
'-w 无效值' '-w 无效值'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_0400 - executeShellCommand: start ') console.log('ACTS_AACommand_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_0400 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_0400 stdResult = ' + data.stdResult)
...@@ -134,7 +127,7 @@ export default function abilityTest() { ...@@ -134,7 +127,7 @@ export default function abilityTest() {
it('ACTS_AACommand_0500', 0, async function (done) { it('ACTS_AACommand_0500', 0, async function (done) {
console.log("ACTS_AACommand_0500 --- start") console.log("ACTS_AACommand_0500 --- start")
let cmd = 'aa test -b aa test -b com.example.actsaacommandtestatest -m entry_test' + let cmd = 'aa test -b aa test -b com.example.actsaacommandtestatest -m entry_test' +
'-s unittest OpenHarmonyTestRunner -z invalid' '-s unittest OpenHarmonyTestRunner -z invalid'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_0500 - executeShellCommand: start ') console.log('ACTS_AACommand_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_0500 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_0500 stdResult = ' + data.stdResult)
...@@ -181,33 +174,12 @@ export default function abilityTest() { ...@@ -181,33 +174,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0700', 0, async function (done) { it('ACTS_AACommand_finishTest_0700', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0700 --- start") console.log("ACTS_AACommand_finishTest_0700 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0700 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: -1'
var finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult1).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { expect(globalThis.stdResult1).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_0700 - executeShellCommand: start ') expect(globalThis.stdResult2.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_0700 stdResult = ' + data.stdResult) done()
var i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0700 query string i = ' + i);
expect(i == -1).assertEqual(false);
var j = data.stdResult.indexOf('TestFinished-ResultCode: -1');
console.log('ACTS_AACommand_finishTest_0700 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0700 - executeShellCommand: end')
})
setTimeout(async() => {
var temp
var cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -239,27 +211,12 @@ export default function abilityTest() { ...@@ -239,27 +211,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0100', 0, async function (done) { it('ACTS_AACommand_print_0100', 0, async function (done) {
console.log("ACTS_AACommand_print_0100 --- start") console.log("ACTS_AACommand_print_0100 --- start")
let cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' + msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'mmand_print_0100 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult3).assertContain(msg);
let msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' done()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0100 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0100 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_print_0100 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0100 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print01', procrssinfo)
console.log("====>ACTS_AACommand_print_0100====>infores = " + infores)
expect(infores==false).assertEqual(true);
done();
}, DELAY )
}) })
/** /**
* @tc.number: ACTS_AACommand_print_0200 * @tc.number: ACTS_AACommand_print_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is * @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
...@@ -269,35 +226,19 @@ export default function abilityTest() { ...@@ -269,35 +226,19 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0200', 0, async function (done) { it('ACTS_AACommand_print_0200', 0, async function (done) {
console.log("ACTS_AACommand_print_0200 --- start") console.log("ACTS_AACommand_print_0200 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm'+ msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'and_print_0200 -s unittest OpenHarmonyTestRunner' 'aaaaaaaaa' +
let msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'+ '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + expect(globalThis.stdResult4).assertContain(msg);
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' done()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0200 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0200 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_print_0200 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0200 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print02', procrssinfo)
console.log("====>ACTS_AACommand_print_0200====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -309,39 +250,21 @@ export default function abilityTest() { ...@@ -309,39 +250,21 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0300', 0, async function (done) { it('ACTS_AACommand_print_0300', 0, async function (done) {
console.log("ACTS_AACommand_print_0300 --- start") console.log("ACTS_AACommand_print_0300 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_'+ msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'AACommand_print_0300 -s unittest OpenHarmonyTestRunner' 'aaaaaaaaaa' +
let msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
let msgcopy = 'fffffffffff' let msgcopy = 'fffffffffff'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { expect(globalThis.stdResult5).assertContain(msg);
console.log('ACTS_AACommand_print_0300 - executeShellCommand: start ') expect(globalThis.stdResult5.indexOf(msgcopy) == -1).assertEqual(true);
console.log('ACTS_AACommand_print_0300 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0300 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf(msgcopy);
console.log('ACTS_AACommand_print_0300 === query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_print_0300 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0300 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print03', procrssinfo)
console.log("====>ACTS_AACommand_print_0300====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -353,22 +276,9 @@ export default function abilityTest() { ...@@ -353,22 +276,9 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0400', 0, async function (done) { it('ACTS_AACommand_print_0400', 0, async function (done) {
console.log("ACTS_AACommand_print_0400 --- start") console.log("ACTS_AACommand_print_0400 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma'+ msg = 'start ability successfully'
'nd_print_0400 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult6).assertContain(msg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { done()
console.log('ACTS_AACommand_print_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0400 stdResult = ' + data.stdResult)
expect(data.stdResult.indexOf('start ability successfully')==-1).assertEqual(false);
console.log('ACTS_AACommand_print_0400 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0400 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print04', procrssinfo)
console.log("====>ACTS_AACommand_print_0400====>infores = ")
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -380,25 +290,9 @@ export default function abilityTest() { ...@@ -380,25 +290,9 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0500', 0, async function (done) { it('ACTS_AACommand_print_0500', 0, async function (done) {
console.log("ACTS_AACommand_print_0500 --- start") console.log("ACTS_AACommand_print_0500 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm'+ msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'and_print_0500 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult7).assertContain(msg);
let msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' done()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_0500 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0500 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0500 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_print_0500 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0500 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print05', procrssinfo)
console.log("====>ACTS_AACommand_print_0500====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -410,35 +304,19 @@ export default function abilityTest() { ...@@ -410,35 +304,19 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0600', 0, async function (done) { it('ACTS_AACommand_print_0600', 0, async function (done) {
console.log("ACTS_AACommand_print_0600 --- start") console.log("ACTS_AACommand_print_0600 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' + msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'Command_print_0600 -s unittest OpenHarmonyTestRunner' 'aaaaaaaaaa' +
let msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + expect(globalThis.stdResult8).assertContain(msg);
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' done()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_print_0600 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0600 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0600 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_print_0600 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0600 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print06', procrssinfo)
console.log("====>ACTS_AACommand_print_0600====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -450,39 +328,21 @@ export default function abilityTest() { ...@@ -450,39 +328,21 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0700', 0, async function (done) { it('ACTS_AACommand_print_0700', 0, async function (done) {
console.log("ACTS_AACommand_print_0700 --- start") console.log("ACTS_AACommand_print_0700 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'ACTS_AACommand_01_3#ACTS_AACommand_print_0700 -s unittest OpenHarmonyTestRunner ' 'aaaaaaaaaa' +
let msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' + '2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + '9aaaaaaaaa'
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + msgcopy = 'fffffffffff'
'9aaaaaaaaa' expect(globalThis.stdResult9).assertContain(msg);
let msgcopy = 'fffffffffff' expect(globalThis.stdResult9.indexOf(msgcopy) == -1).assertEqual(true);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { done()
console.log('ACTS_AACommand_print_0700 - executeShellCommand: start ')
console.log('ACTS_AACommand_print_0700 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_print_0700 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf(msgcopy);
console.log('ACTS_AACommand_print_0700 === query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_print_0700 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0700 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print07', procrssinfo)
console.log("====>ACTS_AACommand_print_0700====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
/** /**
...@@ -494,22 +354,9 @@ export default function abilityTest() { ...@@ -494,22 +354,9 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_print_0800', 0, async function (done) { it('ACTS_AACommand_print_0800', 0, async function (done) {
console.log("ACTS_AACommand_print_0800 --- start") console.log("ACTS_AACommand_print_0800 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + msg = 'start ability successfully'
'class ACTS_AACommand_01_3#ACTS_AACommand_print_0800 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult10).assertContain(msg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { done()
console.log('ACTS_AACommand_print_0800 - executeShellCommand: start ')
console.log("ACTS_AACommand_print_0800 print test end ========> callback " )
expect(data.stdResult.indexOf('start ability successfully')==-1).assertEqual(false);
console.log('ACTS_AACommand_print_0800 - executeShellCommand: end')
})
setTimeout(async() => {
let procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_print_0800 getProcessRunningInfos ======> ' + JSON.stringify(procrssinfo));
let infores = checkRunningProcess('com.example.print08', procrssinfo)
console.log("====>ACTS_AACommand_print_0800====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
}) })
...@@ -525,33 +372,11 @@ export default function abilityTest() { ...@@ -525,33 +372,11 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0400', 0, async function (done) { it('ACTS_AACommand_finishTest_0400', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0400 --- start") console.log("ACTS_AACommand_finishTest_0400 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'ACTS_AACommand_01_3#ACTS_AACommand_finish_0400 -s unittest OpenHarmonyTestRunner' expect(globalThis.stdResult11).assertContain(finishmsg);
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult12.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { done()
console.log('ACTS_AACommand_finishTest_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_finishTest_0400 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0400 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: -1');
console.log('ACTS_AACommand_finishTest_0400 query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_finishTest_0400 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
...@@ -565,33 +390,12 @@ export default function abilityTest() { ...@@ -565,33 +390,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0100', 0, async function (done) { it('ACTS_AACommand_finishTest_0100', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0100 --- start") console.log("ACTS_AACommand_finishTest_0100 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0100 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 1'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult13).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { expect(globalThis.stdResult13).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_0100 - executeShellCommand: start ') expect(globalThis.stdResult14.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_0100 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0100 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 1');
console.log('ACTS_AACommand_finishTest_0100 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0100 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
...@@ -606,33 +410,12 @@ export default function abilityTest() { ...@@ -606,33 +410,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0500', 0, async function (done) { it('ACTS_AACommand_finishTest_0500', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0500 --- start") console.log("ACTS_AACommand_finishTest_0500 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'ACTS_AACommand_01_3#ACTS_AACommand_finish_0500 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 0'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult15).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { expect(globalThis.stdResult15).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_0500 - executeShellCommand: start ') expect(globalThis.stdResult16.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_0500 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0500 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 0');
console.log('ACTS_AACommand_finishTest_0500 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0500 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -646,74 +429,14 @@ export default function abilityTest() { ...@@ -646,74 +429,14 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0600', 0, async function (done) { it('ACTS_AACommand_finishTest_0600', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0600 --- start") console.log("ACTS_AACommand_finishTest_0600 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0600 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 1'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult17).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { expect(globalThis.stdResult17).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_0600 - executeShellCommand: start ') expect(globalThis.stdResult18.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_0600 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0600 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 1');
console.log('ACTS_AACommand_finishTest_0600 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0600 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/**
* @tc.number: ACTS_AACommand_finishTest_0700
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
* AsyncCallback
* mode. The msg parameter is invalid(including Chinese and special characters) and the code
* parameter
* is valid (Number.MIN_VALUE-1)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_0700', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0700 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0700 -s unittest OpenHarmonyTestRunner'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finishTest_0700 - executeShellCommand: start ')
console.log('ACTS_AACommand_finishTest_0700 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0700 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: -1');
console.log('ACTS_AACommand_finishTest_0700 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0700 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
})
/** /**
...@@ -725,72 +448,12 @@ export default function abilityTest() { ...@@ -725,72 +448,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0900', 0, async function (done) { it('ACTS_AACommand_finishTest_0900', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0900 --- start") console.log("ACTS_AACommand_finishTest_0900 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0900 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 1'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult19).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => { expect(globalThis.stdResult19).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_0900 - executeShellCommand: start ') expect(globalThis.stdResult20.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_0900 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0900 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 1');
console.log('ACTS_AACommand_finishTest_0900 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0900 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
})
/**
* @tc.number: ACTS_AACommand_finishTest_1200
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
* mode. The msg parameter is valid(including Chinese and special characters) and the code parameter
* is valid (Number.MAX_VALUE)
* @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
*/
it('ACTS_AACommand_finishTest_1200', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1200 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1200 -s unittest OpenHarmonyTestRunner'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => {
console.log('ACTS_AACommand_finishTest_1200 - executeShellCommand: start ')
console.log('ACTS_AACommand_finishTest_1200 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_1200 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: -1');
console.log('ACTS_AACommand_finishTest_1200 query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_finishTest_1200 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -802,33 +465,12 @@ export default function abilityTest() { ...@@ -802,33 +465,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1300', 0, async function (done) { it('ACTS_AACommand_finishTest_1300', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1300 --- start") console.log("ACTS_AACommand_finishTest_1300 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1300 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 0'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult23).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => { expect(globalThis.stdResult23).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_1300 - executeShellCommand: start ') expect(globalThis.stdResult24.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_1300 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_1300 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 0');
console.log('ACTS_AACommand_finishTest_1300 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_1300 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -840,33 +482,12 @@ export default function abilityTest() { ...@@ -840,33 +482,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1400', 0, async function (done) { it('ACTS_AACommand_finishTest_1400', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1400 --- start") console.log("ACTS_AACommand_finishTest_1400 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1400 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: 1'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult25).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => { expect(globalThis.stdResult25).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_1400 - executeShellCommand: start ') expect(globalThis.stdResult26.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_1400 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_1400 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: 1');
console.log('ACTS_AACommand_finishTest_1400 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_1400 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -878,33 +499,12 @@ export default function abilityTest() { ...@@ -878,33 +499,12 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1500', 0, async function (done) { it('ACTS_AACommand_finishTest_1500', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1500 --- start") console.log("ACTS_AACommand_finishTest_1500 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1500 -s unittest OpenHarmonyTestRunner' finishmsg1 = 'TestFinished-ResultCode: -1'
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146' expect(globalThis.stdResult27).assertContain(finishmsg);
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => { expect(globalThis.stdResult27).assertContain(finishmsg1);
console.log('ACTS_AACommand_finishTest_1500 - executeShellCommand: start ') expect(globalThis.stdResult28.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.log('ACTS_AACommand_finishTest_1500 stdResult = ' + data.stdResult) done()
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_1500 query string i = ' + i);
expect(i == -1).assertEqual(false);
let j = data.stdResult.indexOf('TestFinished-ResultCode: -1');
console.log('ACTS_AACommand_finishTest_1500 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_1500 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") == -1).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -916,24 +516,8 @@ export default function abilityTest() { ...@@ -916,24 +516,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0200', 0, async function (done) { it('ACTS_AACommand_finishTest_0200', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0200 --- start") console.log("ACTS_AACommand_finishTest_0200 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + expect(globalThis.stdResult29.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_0200 -s unittest OpenHarmonyTestRunner' done()
globalThis.abilityDelegator.executeShellCommand(cmd, () => {
console.log('ACTS_AACommand_finishTest_0200 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -944,24 +528,8 @@ export default function abilityTest() { ...@@ -944,24 +528,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0300', 0, async function (done) { it('ACTS_AACommand_finishTest_0300', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0300 --- start") console.log("ACTS_AACommand_finishTest_0300 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + expect(globalThis.stdResult30.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_0300 -s unittest OpenHarmonyTestRunner' done()
globalThis.abilityDelegator.executeShellCommand(cmd, () => {
console.log('ACTS_AACommand_finishTest_0300 - executeShellCommand: start ')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -974,35 +542,8 @@ export default function abilityTest() { ...@@ -974,35 +542,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_0800', 0, async function (done) { it('ACTS_AACommand_finishTest_0800', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_0800 --- start") console.log("ACTS_AACommand_finishTest_0800 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + expect(globalThis.stdResult31.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_0800 -s unittest OpenHarmonyTestRunner' done()
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_finishTest_0800 - executeShellCommand: start ')
console.log('ACTS_AACommand_finishTest_0800 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_0800 query string i = ' + i);
expect(i == -1).assertEqual(true);
let j = data.stdResult.indexOf('TestFinished-ResultCode:');
console.log('ACTS_AACommand_finishTest_0800 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_0800 exitCode = ' + data.exitCode)
expect(data.exitCode).assertEqual(0);
console.log('ACTS_AACommand_finishTest_0800 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -1013,24 +554,8 @@ export default function abilityTest() { ...@@ -1013,24 +554,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1000', 0, async function (done) { it('ACTS_AACommand_finishTest_1000', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1000 --- start") console.log("ACTS_AACommand_finishTest_1000 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + expect(globalThis.stdResult32.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_1000 -s unittest OpenHarmonyTestRunner' done()
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => {
console.log('ACTS_AACommand_finishTest_1000 - executeShellCommand: start ')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >=0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
...@@ -1041,24 +566,8 @@ export default function abilityTest() { ...@@ -1041,24 +566,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1100', 0, async function (done) { it('ACTS_AACommand_finishTest_1100', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1100 --- start") console.log("ACTS_AACommand_finishTest_1100 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + expect(globalThis.stdResult33.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1100 -s unittest OpenHarmonyTestRunner' done()
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => {
console.log('ACTS_AACommand_finishTest_1100 - executeShellCommand: start ')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
/** /**
* @tc.number: ACTS_AACommand_finishTest_1600 * @tc.number: ACTS_AACommand_finishTest_1600
...@@ -1070,35 +579,8 @@ export default function abilityTest() { ...@@ -1070,35 +579,8 @@ export default function abilityTest() {
*/ */
it('ACTS_AACommand_finishTest_1600', 0, async function (done) { it('ACTS_AACommand_finishTest_1600', 0, async function (done) {
console.log("ACTS_AACommand_finishTest_1600 --- start") console.log("ACTS_AACommand_finishTest_1600 --- start")
let cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + expect(globalThis.stdResult34.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_1600 -s unittest OpenHarmonyTestRunner' done()
let finishmsg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd).then((data) => {
console.log('ACTS_AACommand_finishTest_1600 - executeShellCommand: start ')
console.log('ACTS_AACommand_finishTest_1600 stdResult = ' + data.stdResult)
let i = data.stdResult.indexOf(finishmsg);
console.log('ACTS_AACommand_finishTest_1600 query string i = ' + i);
expect(i == -1).assertEqual(true);
let j = data.stdResult.indexOf('TestFinished-ResultCode:');
console.log('ACTS_AACommand_finishTest_1600 query string j = ' + j);
expect(j == -1).assertEqual(false);
console.log('ACTS_AACommand_finishTest_1600 exitCode = ' + data.exitCode)
expect(data.exitCode).assertEqual(0);
console.log('ACTS_AACommand_finishTest_1600 - executeShellCommand: end')
})
setTimeout(async() => {
let temp
let cmd ='aa dump -a'
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + JSON.stringify(d));
temp = d["stdResult"];
expect(temp.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
console.info('executeShellCommand end');
})
done();
}, DELAY )
}) })
}) })
}; };
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册