提交 28974308 编写于 作者: M m00512953

mingxihua@huawei.com.cn

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