diff --git a/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/MainAbility/pages/index/index.js b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/MainAbility/pages/index/index.js
index 8ea0eedbb7b0ca5759444d12e5761cb5c3fab9c5..dcf2e52edc9dbdf339b4ce594bd06ad0fdcc9749 100644
--- a/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/MainAbility/pages/index/index.js
+++ b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/MainAbility/pages/index/index.js
@@ -12,9 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import file from '@system.file'
-import app from '@system.app'
-import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default {
data: {
@@ -25,19 +22,6 @@ export default {
},
onShow() {
console.info('====onShow finish====<')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- const reportExtend = new ReportExtend(file)
- core.addService('expect', expectExtend)
- core.addService('report', reportExtend)
- core.init()
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
},
onReady() {
},
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn b/ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn
index 89b4782ea4d0da989f581e15d3403febf90d292f..712188a49ec121e727a817dda71b8f07ac084ead 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn
@@ -21,14 +21,15 @@ ohos_js_hap_suite("ActsFeatureAbilityTest") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFeatureAbilityTest"
-
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
+ js2abc = true
+ hap_profile = "./entry/src/main/config.json"
+ source_dir = "./entry/src/main/js"
}
ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
+ sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json
index 1410989d06fcd7d9480bd42baee9b7314e1ea8eb..f2af2537338b4b2245b8ee73d7e85215197f586b 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json
@@ -1,10 +1,12 @@
{
"description": "Configuration for hjunit demo Tests",
"driver": {
- "type": "JSUnitTest",
+ "type": "OHJSUnitTest",
"test-timeout": "300000",
- "package": "com.example.actsfeatureabilitytest",
- "shell-timeout": "600000"
+ "bundle-name": "com.example.actsfeatureabilitytest",
+ "package-name": "com.example.actsfeatureabilitytest",
+ "shell-timeout": "600000",
+ "testcase-timeout":"30000"
},
"kits": [
{
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
index fc48f59c88fc99108c079b53ebdf81d9caa0f39e..78165bae4c2699d1e89d4e9b13517a2d1c034094 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
@@ -14,7 +14,7 @@
},
"deviceConfig": {
"default": {
- "process": "processTest"
+ "process": "processTestAbility"
}
},
"module": {
@@ -47,6 +47,8 @@
"dataTransfer"
],
"name": "com.example.actsfeatureabilitytest.MainAbility",
+ "srcPath": "MainAbility",
+ "srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
@@ -57,6 +59,23 @@
"deviceCapability": ["SystemCapability.Ability.AbilityBase"],
"uri": "uriTest",
"visible": true
+ },
+ {
+ "orientation": "unspecified",
+ "formsEnabled": false,
+ "name": ".TestAbility",
+ "srcLanguage": "js",
+ "srcPath": "TestAbility",
+ "icon": "$media:icon",
+ "description": "$string:TestAbility_desc",
+ "label": "$string:TestAbility_label",
+ "type": "page",
+ "visible": true,
+ "launchType": "singleton",
+ "permissions": ["ohos.permission.ACCELEROMETER"],
+ "deviceCapability": ["SystemCapability.Ability.AbilityBase"],
+ "uri": "uriTest",
+ "process": "processTestAbility"
}
],
"reqCapabilities": ["reqCapabilitiesTest1","reqCapabilitiesTest2"],
@@ -114,7 +133,21 @@
"designWidth": 720,
"autoDesignWidth": false
}
+ },
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": ".TestAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
}
- ]
+ ],
+ "testRunner": {
+ "name": "OpenHarmonyTestRunner",
+ "srcPath": "TestRunner"
+ }
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/app.js
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/app.js
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/i18n/en-US.json
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/i18n/en-US.json
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/i18n/zh-CN.json
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/i18n/zh-CN.json
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.css
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.css
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.hml
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.hml
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.js
similarity index 56%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.js
index 130fe7cec945b59ca60f66c6f8e11170e1f7055c..a0634f2462006d017fbb3361ec0defec0710d773 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/MainAbility/pages/index/index.js
@@ -13,12 +13,6 @@
* limitations under the License.
*/
-import {Core, ExpectExtend} from 'deccjsunit/index'
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-let once = true
-
export default {
data: {
title: ''
@@ -27,23 +21,7 @@ export default {
this.title = this.$t('strings.world');
},
onActive() {
- if (!once) {
- return;
- }
- once = false;
console.info('onShow finish');
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- id: 'extend'
- })
- core.addService('expect', expectExtend)
- core.init()
- const configService = core.getDefaultService('config')
- this.timeout = 10000;
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
},
onReady() {
console.info('onReady');
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/app.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..23f62e8848d5558629a640ea4b8ef1ccfd742364
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/app.js
@@ -0,0 +1,33 @@
+/*
+ * 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'
+
+export default {
+ onCreate() {
+ console.info('TestApplication onCreate')
+ var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('abilityDelegator' + abilityDelegator)
+ console.info('abilityDelegator' + abilityDelegator)
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info("TestApplication onDestroy");
+ }
+};
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/en-US.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/en-US.json
@@ -0,0 +1,8 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ },
+ "Files": {
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/zh-CN.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/i18n/zh-CN.json
@@ -0,0 +1,8 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ },
+ "Files": {
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.css b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..56e3f23b7600859d82213a7d24d8756f9f32480a
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.css
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+.container {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ height: 100%;
+}
+
+.title {
+ font-size: 60px;
+ text-align: center;
+ width: 100%;
+ height: 40%;
+ margin: 10px;
+}
+.btn {
+ width: 50%;
+ height: 100px;
+ font-size: 40px;
+}
+
+@media screen and (device-type: phone) and (orientation: landscape) {
+ .title {
+ font-size: 60px;
+ }
+}
+
+@media screen and (device-type: tablet) and (orientation: landscape) {
+ .title {
+ font-size: 100px;
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.hml b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..6069a046a35c4409ab85e4595a079a1670a9c7fe
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.hml
@@ -0,0 +1,21 @@
+
+
+
+
+ {{ $t('strings.hello') }} {{title}}
+
+
+
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d94b75c085fa1c16a0b2721609b18c57a7295476
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestAbility/pages/index/index.js
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ }
+}
+
+
+
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js
new file mode 100644
index 0000000000000000000000000000000000000000..b9e78ce7cf73f1ade6ba52a408a44e33f5430f0d
--- /dev/null
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/TestRunner/OpenHarmonyTestRunner.js
@@ -0,0 +1,59 @@
+/*
+ * 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'
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package', '-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams += ' ' + key + ' ' + parameters[key]
+ }
+ }
+ return targetParams.trim()
+}
+
+ export default {
+ onPrepare() {
+ console.info('OpenHarmonyTestRunner OnPrepare')
+ },
+ onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
+
+ var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
+ cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
+ var debug = abilityDelegatorArguments.parameters["-D"]
+ console.info('debug value : '+debug)
+ if (debug == 'true')
+ {
+ cmd += ' -D'
+ }
+ console.info('cmd : '+cmd)
+ abilityDelegator.executeShellCommand(cmd, (err, data) => {
+ console.info('executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('executeShellCommand : data : ' + data.stdResult);
+ console.info('executeShellCommand : data : ' + data.exitCode);
+ })
+ }
+};
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
index 31899e565c9dd3fc36f399b0f36a2fa4a6c34618..6563e4db5fd25b16160e17808d8ad7ff17fa48b8 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
@@ -14,7 +14,7 @@
*/
import featureAbility from '@ohos.ability.featureAbility'
import wantconstant from '@ohos.ability.wantConstant'
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import commonEvent from '@ohos.commonEvent'
import particleAbility from '@ohos.ability.particleAbility'
import backgroundTaskManager from '@ohos.backgroundTaskManager'
@@ -57,7 +57,7 @@ let subscriberInfoActsGetCallingBundle0100 = {
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
-
+export default function actsFeatureAbilityTest() {
describe('ActsFeatureAbilityTest', function () {
beforeAll(function() {
@@ -847,7 +847,7 @@ describe('ActsFeatureAbilityTest', function () {
// expect(info.labelId).assertEqual(0); //create by DevEco when building HAP.
expect(info.icon).assertEqual("$media:icon");
// expect(info.iconId).assertEqual(0); //create by DevEco when building HAP.
- expect(info.process).assertEqual("processTest");
+ expect(info.process).assertEqual("processTestAbility");
expect(info.supportedModes).assertEqual(0);
expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" +
"com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest");
@@ -964,7 +964,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(info.deviceId).assertEqual("");
expect(info.bundleName).assertEqual("com.example.actsfeatureabilitytest");
- expect(info.abilityName).assertEqual("com.example.actsfeatureabilitytest.MainAbility");
+ expect(info.abilityName).assertEqual("com.example.actsfeatureabilitytest.TestAbility");
expect(info.uri).assertEqual("");
expect(info.shortName).assertEqual("");
console.info("getElementName : end");
@@ -1094,15 +1094,15 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.bundleName).assertEqual("com.example.actsfeatureabilitytest");
- expect(data.name).assertEqual("com.example.actsfeatureabilitytest.MainAbility");
- expect(data.label).assertEqual("$string:app_name");
- expect(data.description).assertEqual("$string:mainability_description");
+ expect(data.name).assertEqual("com.example.actsfeatureabilitytest.TestAbility");
+ expect(data.label).assertEqual("$string:TestAbility_label");
+ expect(data.description).assertEqual("$string:TestAbility_desc");
expect(data.icon).assertEqual("$media:icon");
expect(data.moduleName).assertEqual("entry");
expect(data.process).assertEqual("processTestAbility");
expect(data.targetAbility).assertEqual("");
- expect(data.backgroundModes).assertEqual(1);
+ expect(data.backgroundModes).assertEqual(0);
expect(data.isVisible).assertEqual(true);
expect(data.formEnabled).assertEqual(false);
expect(data.type).assertEqual(1);
@@ -1188,8 +1188,8 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.descriptionId).assertEqual(0);
expect(data.icon).assertEqual("$media:icon");
expect(data.label).assertEqual("$string:app_name");
- expect(data.labelId).assertEqual(16777216);
- expect(data.iconId).assertEqual(16777219);
+ expect(data.labelId).assertEqual(16777218);
+ expect(data.iconId).assertEqual(16777221);
expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0);
expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1");
@@ -1731,3 +1731,4 @@ describe('ActsFeatureAbilityTest', function () {
}
});
})
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js
index dcdf3a43437009c0b047d0eb049ce8d616982e2c..1d18927f349ab05d67396cea5a0bb315618a2c14 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js
@@ -12,5 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-require('./FeatureAbilityJsunit.test.js')
-require('./StartAbilityJsunit.test.js')
\ No newline at end of file
+import actsFeatureAbilityTest from './FeatureAbilityJsunit.test.js'
+import startAbilityTest from './StartAbilityJsunit.test.js'
+
+export default function testsuite() {
+ actsFeatureAbilityTest()
+ startAbilityTest()
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
index 36d5ac0c2fe2e4bb49c2204894493a5e9f752288..1d63d39b02c28ab660b8d4a64c9b7fb510974f62 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
@@ -13,15 +13,15 @@
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureAbility'
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
let resultCode = 123;
let bundleName = 'ohso.act.aafwk';
let mainAbilityName = 'ohos.acts.aafwk.jsap';
const errCode = 1;
const errCode1 = 202;
-
-describe('ConnectAbilityTest', function () {
+export default function startAbilityTest() {
+describe('StartAbilityTest', function () {
/*
* @tc.number: SUB_AA_JsApi_StartAbility_0100
@@ -449,3 +449,4 @@ describe('ConnectAbilityTest', function () {
})
})
})
+}
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/resources/base/element/string.json
similarity index 64%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/resources/base/element/string.json
index 41e9180299771ac021dde0786de080a5c20175f7..03d8392782e4eda9d3ac8704a030bcd7e5e7ce33 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/resources/base/element/string.json
@@ -11,6 +11,14 @@
{
"name": "permreason_camera",
"value": "permreason camera"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
}
]
}
\ No newline at end of file
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn
index 7ef8478b4c8dce9ccea422d67b9dc907ae86e237..0551673c6d9e6a8e0ae2143c06af51a971e58586 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("FinishWithResultEmptyTest") {
+ohos_hap("FinishWithResultEmptyTest") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "FinishWithResultEmptyTest"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn
index c4f436580568ea3ae4663270f77846bdc3bcb3bd..ed6c72f0a26b6d1ad91adca0744f21b2205ce7f6 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("FinishWithResultPromiseParametersTest") {
+ohos_hap("FinishWithResultPromiseParametersTest") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "FinishWithResultPromiseParametersTest"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn
index 5133004bde31cb96c93cc704950cfc761a1100ff..0dd27e7af1e10faa63dbf77c3d9469527f13122d 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("FinishWithResultTest") {
+ohos_hap("FinishWithResultTest") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "FinishWithResultTest"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn
index 64e8a3c9912bc4bf5156b1c5ab4906eca9d03c27..72ef3714c8817ff544e3e5f126f24a96df945927 100644
--- a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("GetCallingBundlePromiseTest") {
+ohos_hap("GetCallingBundlePromiseTest") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "GetCallingBundlePromiseTest"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn
index b4d8b09d48199b2c914c74a408662dfe04dacdc2..3b0684b8f4f14f0ccb01386261c68c71d48ed78a 100644
--- a/ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("StartAbility") {
+ohos_hap("StartAbility") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "StartAbility"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn
index cc6943159548ba02a2b8ab123d3f6a80622d232d..e1e3ea836c882bac2f2a5780892ff0d260e3a567 100644
--- a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("StartAbilityForResult") {
+ohos_hap("StartAbilityForResult") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "StartAbilityForResult"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
diff --git a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn
index e9b2ddfa51975bc73f4f80c3a0a72d2cecf1b7de..3ddfb2615cc76de46b7035028e0124d1c6941866 100644
--- a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn
+++ b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn
@@ -12,20 +12,19 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
-ohos_hap_assist_suite("TerminateAbilityTest") {
+ohos_hap("TerminateAbilityTest") {
hap_profile = "./src/main/config.json"
js_build_mode = "debug"
hap_name = "TerminateAbilityTest"
-
+ subsystem_name = XTS_SUITENAME
+ final_hap_path =
+ "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
-
- subsystem_name = "ability"
- part_name = "ability_runtime"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"