提交 7b3caf71 编写于 作者: C chengxingzhen

XTS冻结修改

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 adb081ce
......@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium'
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 {
async onCreate(want, launchParam) {
globalThis.abilityContext = this.context;
......@@ -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' +
'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 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')
await startAbilityTest('ACTS_AACommand_print_01_0100', this.context);
})
await sleep(4000)
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'
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 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')
await startAbilityTest('ACTS_AACommand_print_01_0200', this.context);
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ACTS_AACommand_01_3#ACTS_' +
'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 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')
await startAbilityTest('ACTS_AACommand_print_01_0300', this.context);
})
await sleep(4000)
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'
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 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')
await startAbilityTest('ACTS_AACommand_print_01_0400', this.context);
})
await sleep(4000)
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'
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 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')
await startAbilityTest('ACTS_AACommand_print_01_0500', this.context);
})
await sleep(4000)
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'
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 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')
await startAbilityTest('ACTS_AACommand_print_01_0600', this.context);
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'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 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')
await startAbilityTest('ACTS_AACommand_print_01_0700', this.context);
})
await sleep(4000)
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'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 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')
await startAbilityTest('ACTS_AACommand_print_01_0800', this.context);
})
setTimeout(() => {
......
......@@ -20,6 +20,25 @@ let msgcopy: any
export default function abilityTest() {
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.name: The -b, -p, -s, -w and other parameters of the test command are valid, and the print interface is
......
......@@ -21,6 +21,7 @@
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"launchType": "singleton",
"skills": [
{
"entities": [
......
......@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium'
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 {
async onCreate(want, launchParam) {
globalThis.abilityContext = this.context;
......@@ -34,44 +46,52 @@ export default class MainAbility extends Ability {
cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'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 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0100', this.context);
})
await sleep(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'
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 stdResult = ' + data.stdResult)
globalThis.stdResult2 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0200', this.context);
})
await sleep(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'
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 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0300', this.context);
})
await sleep(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'
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 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_printSync_01_0400', this.context);
})
setTimeout(() => {
......
......@@ -18,6 +18,25 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
let msg: any
export default function abilityTest() {
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.name: The -b, -p, -s, -w and other parameters of the test command are valid
......
......@@ -21,6 +21,7 @@
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"launchType": "singleton",
"skills": [
{
"entities": [
......
......@@ -18,6 +18,18 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
import { Hypium } from '@ohos/hypium'
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 {
async onCreate(want, launchParam) {
console.log('MainAbility onCreate')
......@@ -34,11 +46,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'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 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_finish_01_0700 - executeShellCommand: end ')
await startAbilityTest('ACTS_AACommand_finish_01_0700', this.context);
})
await sleep(4000)
......@@ -55,12 +69,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'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 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')
await startAbilityTest('ACTS_AACommand_finish_01_0400', this.context);
})
await sleep(4000)
......@@ -77,12 +93,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'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 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')
await startAbilityTest('ACTS_AACommand_finish_01_0100', this.context);
})
await sleep(4000)
......@@ -99,12 +117,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s class ' +
'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 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')
await startAbilityTest('ACTS_AACommand_finish_01_0500', this.context);
})
await sleep(4000)
......@@ -121,12 +141,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'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 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')
await startAbilityTest('ACTS_AACommand_finish_01_0600', this.context);
})
await sleep(4000)
......@@ -143,12 +165,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap -s ' +
'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 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')
await startAbilityTest('ACTS_AACommand_finish_01_0900', this.context);
})
await sleep(4000)
......@@ -165,12 +189,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-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 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')
await startAbilityTest('ACTS_AACommand_finish_01_1300', this.context);
})
await sleep(4000)
......@@ -187,12 +213,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-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 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')
await startAbilityTest('ACTS_AACommand_finish_01_1400', this.context);
})
await sleep(4000)
......@@ -209,12 +237,14 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-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 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')
await startAbilityTest('ACTS_AACommand_finish_01_1500', this.context);
})
await sleep(4000)
......@@ -231,11 +261,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap ' +
'-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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_0300 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_0300 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_0300', this.context);
})
await sleep(3000)
......@@ -252,11 +284,13 @@ export default class MainAbility extends Ability {
cmd = 'aa test -m entry_test -b com.example.aacommandrelyhap' +
' -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 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_finish_01_1600 stdResult = ' + data.stdResult)
console.log('ACTS_AACommand_finish_01_1600 - executeShellCommand: end')
await startAbilityTest('ACTS_AACommand_finish_01_1600', this.context);
})
await sleep(3000)
......
......@@ -22,6 +22,24 @@ let finishmsg1: any
export default function abilityTest() {
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.name: -b, -s unittest, -p, -s class, -s level, -s size, -s testType, -s timeout,
......
......@@ -21,6 +21,7 @@
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"launchType": "singleton",
"skills": [
{
"entities": [
......
......@@ -14,6 +14,9 @@
*/
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 {
......@@ -21,6 +24,15 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability
console.log("MainAbility onCreate")
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() {
......@@ -31,7 +43,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility onWindowStageCreate")
globalThis.abilityContext = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
......
......@@ -14,23 +14,13 @@
*/
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
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)
aboutToAppear(){
}
build() {
......
......@@ -38,6 +38,24 @@ let flagNewWant = false;
export default function abilityTest() {
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.name: Starting standard Ability for the first time does not trigger onNewWant.
......
......@@ -21,6 +21,7 @@
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
"launchType": "singleton",
"skills": [
{
"actions": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册