diff --git a/test_packages.gni b/test_packages.gni index 62f36daa18a16cb4bac746761ea2ae33e8f557a3..7a3f933008a7e8b01cac4f3a67663f5c233409e2 100644 --- a/test_packages.gni +++ b/test_packages.gni @@ -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}/validator:validator", ] diff --git a/wukong/BUILD.gn b/wukong/BUILD.gn deleted file mode 100644 index e85f62a086c43accb8d87e1059bd0bf934580f1d..0000000000000000000000000000000000000000 --- a/wukong/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# 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" ] - } -} diff --git a/wukong/actswukongtest/AppScope/app.json b/wukong/actswukongtest/AppScope/app.json deleted file mode 100644 index 0fa085ed14967b974ed0e782ebc302681b7dcdee..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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 - } - } -} diff --git a/wukong/actswukongtest/AppScope/resources/base/element/string.json b/wukong/actswukongtest/AppScope/resources/base/element/string.json deleted file mode 100644 index cb89829df4eb31a7a382f8e9c2f5c0b39a5f3635..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsWukongTest" - } - ] -} diff --git a/wukong/actswukongtest/AppScope/resources/base/media/app_icon.png b/wukong/actswukongtest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/wukong/actswukongtest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/wukong/actswukongtest/BUILD.gn b/wukong/actswukongtest/BUILD.gn deleted file mode 100644 index fb0915129864ca0eea0d7d4e3707e66248a5ca8c..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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" -} diff --git a/wukong/actswukongtest/Test.json b/wukong/actswukongtest/Test.json deleted file mode 100644 index 2f54d195085232f9a2356358d8aeaa232ff12929..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - ] - } - ] -} diff --git a/wukong/actswukongtest/entry/src/main/ets/Application/AbilityStage.ts b/wukong/actswukongtest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 1d1d739c3fa2bd3ea97dcabfdeef7c850a96253e..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 diff --git a/wukong/actswukongtest/entry/src/main/ets/MainAbility/MainAbility.ts b/wukong/actswukongtest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 82fe2dfe3bdeda9ec3c73e2aed3d92140b94268f..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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") - } -}; diff --git a/wukong/actswukongtest/entry/src/main/ets/MainAbility/pages/index.ets b/wukong/actswukongtest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index b67402613b387dc5408e2bab479945c5b5cf783c..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 diff --git a/wukong/actswukongtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/wukong/actswukongtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index de0edc2010d5ac40595591a360dfd22aaaae6d4f..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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') - } -}; diff --git a/wukong/actswukongtest/entry/src/main/ets/test/Ability.test.ets b/wukong/actswukongtest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 564baff8963cddf5233cc32af0319534c88ca7f0..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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(); - }) - }) -} diff --git a/wukong/actswukongtest/entry/src/main/ets/test/List.test.ets b/wukong/actswukongtest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index cb35098ac281d443c7add6de76cee00a268ce092..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 diff --git a/wukong/actswukongtest/entry/src/main/module.json b/wukong/actswukongtest/entry/src/main/module.json deleted file mode 100644 index cc72d0d90dc03873738fb32e69eb1aea3948503e..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/module.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "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" - } - ] - } -} diff --git a/wukong/actswukongtest/entry/src/main/resources/base/element/string.json b/wukong/actswukongtest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index dfa429e6ed614decc3bee008fa9728cfd7959edd..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "AbilityListTest entry" - }, - { - "name": "MainAbility_desc", - "value": "AbilityListTest MainAbility" - }, - { - "name": "MainAbility_label", - "value": "AbilityList" - } - ] -} \ No newline at end of file diff --git a/wukong/actswukongtest/entry/src/main/resources/base/media/icon.png b/wukong/actswukongtest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/wukong/actswukongtest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/wukong/actswukongtest/entry/src/main/resources/base/profile/main_pages.json b/wukong/actswukongtest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/wukong/actswukongtest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/wukong/actswukongtest/signature/openharmony_sx.p7b b/wukong/actswukongtest/signature/openharmony_sx.p7b deleted file mode 100644 index 69bae59ab28bdfd3a72e434ee64100c10d8ec19a..0000000000000000000000000000000000000000 Binary files a/wukong/actswukongtest/signature/openharmony_sx.p7b and /dev/null differ