Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fd4be953
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd4be953
编写于
2月 20, 2023
作者:
H
hanyaru
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
移除文件
Signed-off-by:
N
hanyaru
<
hanyaru@huawei.com
>
上级
4d04af18
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
0 addition
and
491 deletion
+0
-491
test_packages.gni
test_packages.gni
+0
-1
wukong/BUILD.gn
wukong/BUILD.gn
+0
-21
wukong/actswukongtest/AppScope/app.json
wukong/actswukongtest/AppScope/app.json
+0
-19
wukong/actswukongtest/AppScope/resources/base/element/string.json
...ctswukongtest/AppScope/resources/base/element/string.json
+0
-8
wukong/actswukongtest/AppScope/resources/base/media/app_icon.png
...actswukongtest/AppScope/resources/base/media/app_icon.png
+0
-0
wukong/actswukongtest/BUILD.gn
wukong/actswukongtest/BUILD.gn
+0
-43
wukong/actswukongtest/Test.json
wukong/actswukongtest/Test.json
+0
-31
wukong/actswukongtest/entry/src/main/ets/Application/AbilityStage.ts
...wukongtest/entry/src/main/ets/Application/AbilityStage.ts
+0
-24
wukong/actswukongtest/entry/src/main/ets/MainAbility/MainAbility.ts
...swukongtest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-58
wukong/actswukongtest/entry/src/main/ets/MainAbility/pages/index.ets
...wukongtest/entry/src/main/ets/MainAbility/pages/index.ets
+0
-31
wukong/actswukongtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+0
-78
wukong/actswukongtest/entry/src/main/ets/test/Ability.test.ets
...g/actswukongtest/entry/src/main/ets/test/Ability.test.ets
+0
-78
wukong/actswukongtest/entry/src/main/ets/test/List.test.ets
wukong/actswukongtest/entry/src/main/ets/test/List.test.ets
+0
-19
wukong/actswukongtest/entry/src/main/module.json
wukong/actswukongtest/entry/src/main/module.json
+0
-59
wukong/actswukongtest/entry/src/main/resources/base/element/string.json
...ongtest/entry/src/main/resources/base/element/string.json
+0
-16
wukong/actswukongtest/entry/src/main/resources/base/media/icon.png
...tswukongtest/entry/src/main/resources/base/media/icon.png
+0
-0
wukong/actswukongtest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+0
-5
wukong/actswukongtest/signature/openharmony_sx.p7b
wukong/actswukongtest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
test_packages.gni
浏览文件 @
fd4be953
...
...
@@ -47,7 +47,6 @@ _all_test_packages = [
"${ACTS_ROOT}/settingsdata:settingsdata",
"${ACTS_ROOT}/barrierfree:barrierfree",
"${ACTS_ROOT}/applications:applications",
"${ACTS_ROOT}/wukong:wukong",
"${ACTS_ROOT}/msdp:msdp",
]
...
...
wukong/BUILD.gn
已删除
100644 → 0
浏览文件 @
4d04af18
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos_var.gni")
import("//test/xts/tools/build/suite.gni")
group("wukong") {
testonly = true
if (is_standard_system) {
deps = [ "actswukongtest:ActsWukongTest" ]
}
}
wukong/actswukongtest/AppScope/app.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"app"
:
{
"bundleName"
:
"com.example.ActsWukongTest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
wukong/actswukongtest/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsWukongTest"
}
]
}
wukong/actswukongtest/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
4d04af18
6.6 KB
wukong/actswukongtest/BUILD.gn
已删除
100644 → 0
浏览文件 @
4d04af18
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsWukongTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":wukong_js_assets",
":wukong_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsWukongTest"
subsystem_name = "wukong"
part_name = "wukong"
}
ohos_app_scope("wukong_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("wukong_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("wukong_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":wukong_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
wukong/actswukongtest/Test.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"280000"
,
"bundle-name"
:
"com.example.ActsWukongTest"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsWukongTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
,
"param set persist.ace.testmode.enabled 1"
],
"teardown-command"
:[
"bm uninstall -n com.example.ActsWukongTest"
]
}
]
}
wukong/actswukongtest/entry/src/main/ets/Application/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[wukongTest] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
\ No newline at end of file
wukong/actswukongtest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
var
abilityDelegator
:
any
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
:
any
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
}
onDestroy
()
{
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
wukong/actswukongtest/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
@State message: string = 'wukongtest'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
wukong/actswukongtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
wukong/actswukongtest/entry/src/main/ets/test/Ability.test.ets
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import { UiDriver } from '@ohos.UiTest'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import prompt from '@ohos.prompt'
var abilityDelegator = undefined;
var abilityDelegator1 = undefined;
var driver;
var cmd;
function sleep(time) {
return new Promise < void> ((resolve, reject) => {
setTimeout(() => {
resolve();
}, time)
})
}
export default function abilityTest() {
describe('ActsWukongTest', function () {
beforeAll(async (done) => {
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator1 = AbilityDelegatorRegistry.getAbilityDelegator();
driver = await UiDriver.create()
await sleep(2000);
done();
})
afterAll(async function (done) {
prompt.showToast({
message: 'CASE All End'
})
done()
})
/**
* @tc.number: wukongtest_0010
* @tc.name: getAbilityLists callback API.
* @tc.desc: getAbilityLists callback API abilityType is spoken, stateType is install.
*/
it('wukongtest_0010', 1, async function (done) {
cmd = "wukong exec -T 0.5 &";
await abilityDelegator.executeShellCommand("pkill accessibility");
abilityDelegator.executeShellCommand(cmd,
async (err: any, d: any) => {
console.log('ACTS_wukongTest executeShellCommand : err : ' + JSON.stringify(err));
console.log('ACTS_wukongTest executeShellCommand : stdResult : ' + d.stdResult);
console.log('ACTS_wukongTest executeShellCommand : exitCode : ' + d.exitCode);
});
await sleep(5000);
abilityDelegator1.executeShellCommand("ps -ef|grep 'wukong exec -T 0.5'|grep -c -v grep ",async (error: any, date: any) => {
console.log('ACTS_wukongTest cmdPs executeShellCommand : err : ' + JSON.stringify(error));
console.log('ACTS_wukongTest cmdPs executeShellCommand : stdResult : ' + date.stdResult);
console.log('ACTS_wukongTest cmdPs executeShellCommand : exitCode : ' + date.exitCode);
let i = date.stdResult.indexOf('1');
if(i == -1){
expect().assertFail();
done();
}
});
done();
})
})
}
wukong/actswukongtest/entry/src/main/ets/test/List.test.ets
已删除
100644 → 0
浏览文件 @
4d04af18
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import abilityTest from './Ability.test'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
wukong/actswukongtest/entry/src/main/module.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:entry_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
,
"phone"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
],
"abilities"
:
[
{
"name"
:
"com.example.ActsWukongTest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.SET_ABILITY_CONTROLLER"
,
"reason"
:
"need use ohos.permission.SET_ABILITY_CONTROLLER"
},
{
"name"
:
"ohos.permission.CAPTURE_SCREEN"
,
"reason"
:
"need use ohos.permission.CAPTURE_SCREEN"
},
{
"name"
:
"ohos.permission.INPUT_MONITORING"
,
"reason"
:
"need use ohos.permission.INPUT_MONITORING"
}
]
}
}
wukong/actswukongtest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"AbilityListTest entry"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"AbilityListTest MainAbility"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"AbilityList"
}
]
}
\ No newline at end of file
wukong/actswukongtest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
4d04af18
6.6 KB
wukong/actswukongtest/entry/src/main/resources/base/profile/main_pages.json
已删除
100644 → 0
浏览文件 @
4d04af18
{
"src"
:
[
"MainAbility/pages/index"
]
}
wukong/actswukongtest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
4d04af18
文件已删除
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录