提交 3486d9b5 编写于 作者: C chengxingzhen

XTS冻结修改

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 242b510a
...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry ...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
async function startAbilityTest(TAG, context) {
let wantInfo = {
bundleName: "com.example.aacommandprintonetest",
abilityName: "MainAbility"
}
await context.startAbility(wantInfo).then((data) => {
console.log(TAG + "startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log(TAG + "startAbility err : " + JSON.stringify(err));
})
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
async onCreate(want, launchParam) { async onCreate(want, launchParam) {
globalThis.abilityContext = this.context; globalThis.abilityContext = this.context;
...@@ -34,96 +46,112 @@ export default class MainAbility extends Ability { ...@@ -34,96 +46,112 @@ export default class MainAbility extends Ability {
cmd = 'aa test -b com.example.aacommandrelyhap -m entry_test -s class ACTS_AACommand_01_3#ACTS_AACo' + 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' 'mmand_print_01_0100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult; globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0100 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0100', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + 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' 'and_print_01_0200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult; globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0200 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0200', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' +
'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner' 'AACommand_print_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult5 = data.stdResult; globalThis.stdResult5 = data.stdResult;
console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0300 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0300', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComma' + 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' 'nd_print_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult6 = data.stdResult; globalThis.stdResult6 = data.stdResult;
console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0400 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0400', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AAComm' + 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' 'and_print_01_0500 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult7 = data.stdResult; globalThis.stdResult7 = data.stdResult;
console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0500 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0500', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_AA' + 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' 'Command_print_01_0600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult8 = data.stdResult; globalThis.stdResult8 = data.stdResult;
console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0600 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0600', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_print_01_0700 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult9 = data.stdResult; globalThis.stdResult9 = data.stdResult;
console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0700 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0700', this.context);
}) })
await sleep(4000) await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner' 'class ACTS_AACommand_01_3#ACTS_AACommand_print_01_0800 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_print_01_0800 stdResult = ' + data.stdResult)
globalThis.stdResult10 = data.stdResult; globalThis.stdResult10 = data.stdResult;
console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end') console.log('ACTS_AACommand_print_01_0800 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_print_01_0800', this.context);
}) })
setTimeout(() => { setTimeout(() => {
......
...@@ -20,6 +20,25 @@ let msgcopy: any ...@@ -20,6 +20,25 @@ let msgcopy: any
export default function abilityTest() { export default function abilityTest() {
describe('ActsAACommandPrinOneTest', function () { describe('ActsAACommandPrinOneTest', function () {
afterEach(async (done) => {
console.log("ActsAACommandPrinOneTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandprintonetest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrinOneTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandPrinOneTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandPrinOneTest afterEach end");
done();
}, 1000);
})
/** /**
* @tc.number: ACTS_AACommand_print_0100 * @tc.number: ACTS_AACommand_print_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
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"visible": true, "visible": true,
"launchType": "singleton",
"skills": [ "skills": [
{ {
"entities": [ "entities": [
......
...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry ...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
async function startAbilityTest(TAG, context) {
let wantInfo = {
bundleName: "com.example.aacommandprintsynctest",
abilityName: "MainAbility"
}
await context.startAbility(wantInfo).then((data) => {
console.log(TAG + "startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log(TAG + "startAbility err : " + JSON.stringify(err));
})
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
async onCreate(want, launchParam) { async onCreate(want, launchParam) {
globalThis.abilityContext = this.context; globalThis.abilityContext = this.context;
...@@ -34,44 +46,52 @@ export default class MainAbility extends Ability { ...@@ -34,44 +46,52 @@ export default class MainAbility extends Ability {
cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' + cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err)) console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult; globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ') console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0100', this.context);
}) })
await sleep(3000) await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err)) console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult2 = data.stdResult; globalThis.stdResult2 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ') console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0200', this.context);
}) })
await sleep(3000) await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err)) console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult; globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ') console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0300', this.context);
}) })
await sleep(3000) await sleep(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err)) console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult; globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ') console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0400', this.context);
}) })
setTimeout(() => { setTimeout(() => {
......
...@@ -18,6 +18,25 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -18,6 +18,25 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
let msg: any let msg: any
export default function abilityTest() { export default function abilityTest() {
describe('ActsAbilityTest', function () { describe('ActsAbilityTest', function () {
afterEach(async (done) => {
console.log("ActsAACommandPrintSyncTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandprintsynctest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandPrintSyncTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandPrintSyncTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandPrintSyncTest afterEach end");
done();
}, 1000);
})
/** /**
* @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
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"visible": true, "visible": true,
"launchType": "singleton",
"skills": [ "skills": [
{ {
"entities": [ "entities": [
......
...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry ...@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
async function startAbilityTest(TAG, context) {
let wantInfo = {
bundleName: "com.example.aacommandtest",
abilityName: "MainAbility"
}
await context.startAbility(wantInfo).then((data) => {
console.log(TAG + "startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log(TAG + "startAbility err : " + JSON.stringify(err));
})
}
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
async onCreate(want, launchParam) { async onCreate(want, launchParam) {
console.log('MainAbility onCreate') console.log('MainAbility onCreate')
...@@ -34,11 +46,13 @@ export default class MainAbility extends Ability { ...@@ -34,11 +46,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner' 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0700 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0700 start err: ' + JSON.stringify(err)) console.log('ACTS_AACommand_finish_01_0700 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0700 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0700 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult; globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ') console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_finish_01_0700', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -55,12 +69,14 @@ export default class MainAbility extends Ability { ...@@ -55,12 +69,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0400 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult11 = data.stdResult; globalThis.stdResult11 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0400 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0400', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -77,12 +93,14 @@ export default class MainAbility extends Ability { ...@@ -77,12 +93,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner' 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0100 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0100 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult13 = data.stdResult; globalThis.stdResult13 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0100 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0100', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -99,12 +117,14 @@ export default class MainAbility extends Ability { ...@@ -99,12 +117,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner' 'ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0500 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0500 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0500 stdResult = ' + data.stdResult)
globalThis.stdResult15 = data.stdResult; globalThis.stdResult15 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0500 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0500', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -121,12 +141,14 @@ export default class MainAbility extends Ability { ...@@ -121,12 +141,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner' 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0600 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0600 stdResult = ' + data.stdResult)
globalThis.stdResult17 = data.stdResult; globalThis.stdResult17 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0600 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0600', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -143,12 +165,14 @@ export default class MainAbility extends Ability { ...@@ -143,12 +165,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner' 'class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0900 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0900 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0900 stdResult = ' + data.stdResult)
globalThis.stdResult19 = data.stdResult; globalThis.stdResult19 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0900 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0900', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -165,12 +189,14 @@ export default class MainAbility extends Ability { ...@@ -165,12 +189,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner' '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1300 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_1300 stdResult = ' + data.stdResult)
globalThis.stdResult23 = data.stdResult; globalThis.stdResult23 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_1300 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_1300', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -187,12 +213,14 @@ export default class MainAbility extends Ability { ...@@ -187,12 +213,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner' '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1400 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1400 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_1400 stdResult = ' + data.stdResult)
globalThis.stdResult25 = data.stdResult; globalThis.stdResult25 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_1400 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_1400', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -209,12 +237,14 @@ export default class MainAbility extends Ability { ...@@ -209,12 +237,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner' '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1500 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1500 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_1500 stdResult = ' + data.stdResult)
globalThis.stdResult27 = data.stdResult; globalThis.stdResult27 = data.stdResult;
console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_1500 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_1500', this.context);
}) })
await sleep(4000) await sleep(4000)
...@@ -231,11 +261,13 @@ export default class MainAbility extends Ability { ...@@ -231,11 +261,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner' '-s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_0300 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0300', this.context);
}) })
await sleep(3000) await sleep(3000)
...@@ -252,11 +284,13 @@ export default class MainAbility extends Ability { ...@@ -252,11 +284,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' + cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner' ' -s class ACTS_AACommand_01_3#ACTS_AACommand_finish_01_1600 -s unittest OpenHarmonyTestRunner'
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, async (err, data) => {
console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: start ') 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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult) console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end') console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_1600', this.context);
}) })
await sleep(3000) await sleep(3000)
......
...@@ -22,6 +22,24 @@ let finishmsg1: any ...@@ -22,6 +22,24 @@ let finishmsg1: any
export default function abilityTest() { export default function abilityTest() {
describe('ACTS_AACommand_Test', function () { describe('ACTS_AACommand_Test', function () {
afterEach(async (done) => {
console.log("ActsAACommandTest afterEach called");
let wantInfo = {
bundleName: "com.example.aacommandtest",
abilityName: "MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ActsAACommandTest startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ActsAACommandTest startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ActsAACommandTest afterEach end");
done();
}, 1000);
})
/** /**
* @tc.number: ACTS_AACommand_0100 * @tc.number: ACTS_AACommand_0100
* @tc.name: -b, -s unittest, -p, -s class, -s level, -s size, -s testType, -s timeout, * @tc.name: -b, -s unittest, -p, -s class, -s level, -s size, -s testType, -s timeout,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"visible": true, "visible": true,
"launchType": "singleton",
"skills": [ "skills": [
{ {
"entities": [ "entities": [
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
...@@ -21,6 +24,15 @@ export default class MainAbility extends Ability { ...@@ -21,6 +24,15 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability // Ability is creating, initialize resources for this ability
console.log("MainAbility onCreate") console.log("MainAbility onCreate")
globalThis.abilityWant = want; globalThis.abilityWant = want;
globalThis.abilityContext = this.context
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
} }
onDestroy() { onDestroy() {
...@@ -31,7 +43,7 @@ export default class MainAbility extends Ability { ...@@ -31,7 +43,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
console.log("MainAbility onWindowStageCreate") console.log("MainAbility onWindowStageCreate")
globalThis.abilityContext = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null) windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
} }
......
...@@ -14,23 +14,13 @@ ...@@ -14,23 +14,13 @@
*/ */
import router from '@ohos.router'; import router from '@ohos.router';
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 {
aboutToAppear(){ aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
} }
build() { build() {
......
...@@ -38,6 +38,24 @@ let flagNewWant = false; ...@@ -38,6 +38,24 @@ let flagNewWant = false;
export default function abilityTest() { export default function abilityTest() {
describe('ActsNewWantTest', function () { describe('ActsNewWantTest', function () {
afterEach(async (done) => {
console.log("ACTS_NewWant afterEach called");
let wantInfo = {
bundleName: "com.example.newwanttest",
abilityName: "com.example.newwanttest.MainAbility"
}
await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
console.log("ACTS_NewWant startAbility data : " + JSON.stringify(data));
}).catch((err) => {
console.log("ACTS_NewWant startAbility err : " + JSON.stringify(err));
})
setTimeout(function () {
console.log("ACTS_NewWant afterEach end");
done();
}, 1000);
})
/** /**
* @tc.number: ACTS_NewWant_Test_0100 * @tc.number: ACTS_NewWant_Test_0100
* @tc.name: Starting standard Ability for the first time does not trigger onNewWant. * @tc.name: Starting standard Ability for the first time does not trigger onNewWant.
...@@ -608,4 +626,4 @@ export default function abilityTest() { ...@@ -608,4 +626,4 @@ export default function abilityTest() {
} }
}) })
}) })
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"label": "$string:entry_label", "label": "$string:entry_label",
"visible": true, "visible": true,
"orientation": "portrait", "orientation": "portrait",
"launchType": "singleton",
"skills": [ "skills": [
{ {
"actions": [ "actions": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册