提交 28974308 编写于 作者: M m00512953

mingxihua@huawei.com.cn

Signed-off-by: Nm00512953 <mingxihua@huawei.com>
上级 03605463
......@@ -17,6 +17,23 @@
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"param set persist.ace.testmode.enabled 1",
"param set persist.sys.suspend_manager_enabled 0",
"reboot",
"power-shell wakeup",
"hilog -Q pidoff",
"hilog -b DEBUG",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100",
"power-shell setmode 602"
],
"teardown-command": [
"param set persist.sys.suspend_manager_enabled 1",
"reboot"
]
}
]
}
......
......@@ -17,6 +17,9 @@ import commonEvent from '@ohos.commonEvent';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import power from '@ohos.power';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
import { BY, UiDriver, UiComponent, MatchPattern } from '@ohos.uitest';
var driver;
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
......@@ -39,6 +42,7 @@ export default function OnAndOffScreenTest() {
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
driver = await UiDriver.create();
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
......@@ -48,6 +52,10 @@ export default function OnAndOffScreenTest() {
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
let button = await driver.findComponent(BY.text('知道了').enabled(true));
await sleep(4000);
await button.click();
await sleep(2000);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
......
......@@ -22,6 +22,23 @@
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"param set persist.ace.testmode.enabled 1",
"param set persist.sys.suspend_manager_enabled 0",
"reboot",
"power-shell wakeup",
"hilog -Q pidoff",
"hilog -b DEBUG",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100",
"power-shell setmode 602"
],
"teardown-command": [
"param set persist.sys.suspend_manager_enabled 1",
"reboot"
]
}
]
}
......@@ -19,6 +19,9 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import commonEvent from '@ohos.commonEvent'
import particleAbility from '@ohos.ability.particleAbility'
import backgroundTaskManager from '@ohos.backgroundTaskManager'
import { BY, UiDriver, UiComponent, MatchPattern } from '@ohos.uitest';
var driver;
const START_ABILITY_TIMEOUT = 4000;
let subscriberInfoActsStartAbility0100 = {
......@@ -61,20 +64,22 @@ function sleep(time) {
export default function actsFeatureAbilityTest() {
describe('ActsFeatureAbilityTest', function () {
beforeAll(function() {
/*
* @tc.setup: setup invoked before all testcases
*/
beforeAll(async (done) => {
console.info('beforeAll called')
driver = await UiDriver.create();
await sleep(2000);
done();
})
afterAll(function() {
/*
* @tc.teardown: teardown invoked after all testcases
*/
afterAll(async (done) => {
let button = await driver.findComponent(BY.text('知道了').enabled(true));
await sleep(4000);
await button.click();
await sleep(4000);
setTimeout(function () {
console.info('afterAll called')
done();
}, 6000);
})
beforeEach(function() {
......
......@@ -14,15 +14,40 @@
*/
import featureAbility from '@ohos.ability.featureAbility'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import { BY, UiDriver, UiComponent, MatchPattern } from '@ohos.uitest';
var driver;
let resultCode = 123;
let bundleName = 'ohso.act.aafwk';
let mainAbilityName = 'ohos.acts.aafwk.jsap';
const errCode = 1;
const errCode1 = 202;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function startAbilityTest() {
describe('StartAbilityTest', function () {
beforeAll(async (done) => {
driver = await UiDriver.create();
await sleep(2000);
done();
})
afterAll(async (done) => {
let button = await driver.findComponent(BY.text('知道了').enabled(true));
await sleep(4000);
await button.click();
await sleep(2000);
setTimeout(function () {
console.log("afterAll end");
done();
}, 6000);
})
afterEach(async function(done) {
let wantInfo = {
want: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册