Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
28974308
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
28974308
编写于
12月 20, 2022
作者:
M
m00512953
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mingxihua@huawei.com.cn
Signed-off-by:
N
m00512953
<
mingxihua@huawei.com
>
上级
03605463
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
87 addition
and
15 deletion
+87
-15
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
...time/actssupportfunction/actsonandoffscreentest/Test.json
+17
-0
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
...ntest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
+9
-1
ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json
...y_runtime/featureability/actsfeatureabilitytest/Test.json
+17
-0
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
...ytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+19
-14
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
...itytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+25
-0
未找到文件。
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
浏览文件 @
28974308
...
...
@@ -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"
]
}
]
}
...
...
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
浏览文件 @
28974308
...
...
@@ -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
();
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json
浏览文件 @
28974308
...
...
@@ -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"
]
}
]
}
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
浏览文件 @
28974308
...
...
@@ -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
()
{
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
浏览文件 @
28974308
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录