提交 6f021041 编写于 作者: C chengxingzhen

XTS新框架适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 39c5174a
...@@ -17,10 +17,9 @@ group("ability_runtime") { ...@@ -17,10 +17,9 @@ group("ability_runtime") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [
"TestApi:Testapi",
"aacommand:aacommand", "aacommand:aacommand",
"abilitymanager:actsabilitymanagertest", "abilitymanager:actsabilitymanagertest",
"abilitymontior:AbilityMonitorTest", "abilitymontior:ActsAbilityMonitorTest",
"abilitymultiinstance:abilitymultiinstance", "abilitymultiinstance:abilitymultiinstance",
"actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest", "actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest",
"actsabilitymanageretstest:ActsAbilityManagerEtsTest", "actsabilitymanageretstest:ActsAbilityManagerEtsTest",
...@@ -38,6 +37,7 @@ group("ability_runtime") { ...@@ -38,6 +37,7 @@ group("ability_runtime") {
"amsdisplayIdtest:amsdisplayIdtest", "amsdisplayIdtest:amsdisplayIdtest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo", "amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"apicover:apicover", "apicover:apicover",
"apitest:ActsApiTest",
"context:context", "context:context",
"fa:fa", "fa:fa",
"faapicover:faapicover", "faapicover:faapicover",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AACommandPrintSyncTest") { ohos_js_hap_suite("ActsAACommandPrintSyncTest") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandPrintSyncTest") { ...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandPrintSyncTest") {
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AACommandPrintSyncTest" hap_name = "ActsAACommandPrintSyncTest"
} }
ohos_app_scope("aacommandprintsynctest_app_profile") { ohos_app_scope("aacommandprintsynctest_app_profile") {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
{ {
"test-file-name": [ "test-file-name": [
"AACommandPrintSyncTest.hap", "ActsAACommandPrintSyncTest.hap",
"AACommandPrintSync.hap" "AACommandPrintSync.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
......
...@@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined ...@@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) { function translateParamsToString(parameters) {
const keySet = new Set([ const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s it', '-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout' '-s level', '-s testType', '-s size', '-s timeout',
'-s dryRun'
]) ])
let targetParams = ''; let targetParams = '';
for (const key in parameters) { for (const key in parameters) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
const DELAY = 3000 const DELAY = 3000
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AACommandtest") { ohos_js_hap_suite("ActsAACommandTest") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandtest") { ...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AACommandtest") {
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AACommandtest" hap_name = "ActsAACommandTest"
} }
ohos_app_scope("aacommandtest_app_profile") { ohos_app_scope("aacommandtest_app_profile") {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
{ {
"test-file-name": [ "test-file-name": [
"AACommandtest.hap", "ActsAACommandTest.hap",
"AACommand07.hap", "AACommand07.hap",
"AACommand08.hap", "AACommand08.hap",
"AACommandpackage.hap", "AACommandpackage.hap",
......
...@@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined ...@@ -22,7 +22,8 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) { function translateParamsToString(parameters) {
const keySet = new Set([ const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s it', '-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout' '-s level', '-s testType', '-s size', '-s timeout',
'-s dryRun'
]) ])
let targetParams = ''; let targetParams = '';
for (const key in parameters) { for (const key in parameters) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
const DELAY = 3000 const DELAY = 3000
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
......
...@@ -17,13 +17,13 @@ group("aacommand") { ...@@ -17,13 +17,13 @@ group("aacommand") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [
"AACommand07:AACommand07", "aacommand07:AACommand07",
"AACommand08:AACommand08", "aacommand08:AACommand08",
"AACommandPrintSync:AACommandPrintSync", "aacommandprintsync:AACommandPrintSync",
"AACommandPrintSyncTest:AACommandPrintSyncTest", "aacommandprintsynctest:ActsAACommandPrintSyncTest",
"AACommandRelyHap:AACommandRelyHap", "aacommandrelyhap:AACommandRelyHap",
"AACommandpackage:AACommandpackage", "aacommandpackage:AACommandpackage",
"AACommandtest:AACommandtest", "aacommandtest:ActsAACommandTest",
] ]
} }
} }
{ {
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "300000", "test-timeout": "300000",
"bundle-name": "com.example.actsamstestthirdscene", "bundle-name": "com.example.actsamstestthirdscene",
"package-name": "com.example.actsamstestthirdscene", "package-name": "com.example.actsamstestthirdscene",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AbilityMonitorTest") { ohos_js_hap_suite("ActsAbilityMonitorTest") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AbilityMonitorTest") { ...@@ -22,7 +22,7 @@ ohos_js_hap_suite("AbilityMonitorTest") {
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityMonitorTest" hap_name = "ActsAbilityMonitorTest"
} }
ohos_app_scope("abilitymonitortest_app_profile") { ohos_app_scope("abilitymonitortest_app_profile") {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"AbilityMonitorTest.hap" "ActsAbilityMonitorTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"run-command": [ "run-command": [
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default { export default {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeEach, afterEach, it, expect} from 'hypium/index'; import {describe, beforeEach, afterEach, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
export default function ContextJsunit() { export default function ContextJsunit() {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import ability_particleAbility from '@ohos.ability.particleAbility'; import ability_particleAbility from '@ohos.ability.particleAbility';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
......
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
var subscriberInfo_MainAbility = { var subscriberInfo_MainAbility = {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
// @ts-nocheck // @ts-nocheck
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
const START_ABILITY_TIMEOUT = 4000; const START_ABILITY_TIMEOUT = 4000;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
const START_ABILITY_TIMEOUT = 5000; const START_ABILITY_TIMEOUT = 5000;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
const START_ABILITY_TIMEOUT = 5000; const START_ABILITY_TIMEOUT = 5000;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
const START_ABILITY_TIMEOUT = 5000; const START_ABILITY_TIMEOUT = 5000;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent" import commonEvent from "@ohos.commonEvent"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class TestAbility extends Ability { export default class TestAbility extends Ability {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() { export default function abilityTest() {
describe('ActsAbilityTest', function () { describe('ActsAbilityTest', function () {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class TestAbility extends Ability { export default class TestAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
export default function abilityTest() { export default function abilityTest() {
......
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' import testsuite from '../test/List.test'
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
var subscriberInfo_MainAbility = { var subscriberInfo_MainAbility = {
......
{ {
"app": { "app": {
"bundleName": "com.example.testapi", "bundleName": "com.example.testapi",
"vendor": "huawei", "vendor": "huawei",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
"debug": false, "debug": false,
"icon" : "$media:icon", "icon" : "$media:icon",
"label" : "$string:app_name", "label" : "$string:app_name",
"description" : "$string:description_application", "description" : "$string:description_application",
"distributedNotificationEnabled": true, "distributedNotificationEnabled": true,
"keepAlive" : true, "keepAlive" : true,
"singleUser": true, "singleUser": true,
"minAPIVersion": 9, "minAPIVersion": 9,
"targetAPIVersion": 9, "targetAPIVersion": 9,
"car": { "car": {
"apiCompatibleVersion": 9, "apiCompatibleVersion": 9,
"singleUser": false "singleUser": false
} }
} }
} }
{ {
"string": [ "string": [
{ {
"name": "app_name", "name": "app_name",
"value": "Testapi" "value": "Testapi"
} }
] ]
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("Testapi") { ohos_js_hap_suite("ActsApiTest") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
...@@ -22,7 +22,7 @@ ohos_js_hap_suite("Testapi") { ...@@ -22,7 +22,7 @@ ohos_js_hap_suite("Testapi") {
] ]
ets2abc = true ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "Testapi" hap_name = "ActsApiTest"
} }
ohos_app_scope("testapi_app_profile") { ohos_app_scope("testapi_app_profile") {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"Testapi.hap" "ActsApiTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>"); console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>");
setTimeout(()=>{ setTimeout(()=>{
globalThis.abilityContext.terminateSelf(); globalThis.abilityContext.terminateSelf();
console.debug("====>MainAbility2 terminateSelf succese====>") console.debug("====>MainAbility2 terminateSelf succese====>")
},2000) },2000)
} }
export default class MainAbility2 extends Ability { export default class MainAbility2 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility2 onCreate") console.log("[Demo] MainAbility2 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContext = this.context
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility2 onDestroy") console.log("[Demo] MainAbility2 onDestroy")
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
console.log("[Demo] MainAbility2 onWindowStageCreate") console.log("[Demo] MainAbility2 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null) windowStage.setUIContent(this.context, "pages/index", null)
} }
onWindowStageDestroy() { onWindowStageDestroy() {
// Main window is destroyed, release UI related resources // Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility2 onWindowStageDestroy") console.log("[Demo] MainAbility2 onWindowStageDestroy")
} }
onForeground() { onForeground() {
// Ability has brought to foreground // Ability has brought to foreground
console.log("[Demo] MainAbility2 onForeground") console.log("[Demo] MainAbility2 onForeground")
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
} }
onBackground() { onBackground() {
// Ability has back to background // Ability has back to background
console.log("[Demo] MainAbility2 onBackground") console.log("[Demo] MainAbility2 onBackground")
} }
}; };
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>"); console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>");
globalThis.abilityContext.terminateSelf().then(()=>{ globalThis.abilityContext.terminateSelf().then(()=>{
console.debug("====>MainAbility3 terminateSelf====>"); console.debug("====>MainAbility3 terminateSelf====>");
}); });
} }
export default class MainAbility3 extends Ability { export default class MainAbility3 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility3 onCreate") console.log("[Demo] MainAbility3 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContext = this.context
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility3 onDestroy") console.log("[Demo] MainAbility3 onDestroy")
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
console.log("[Demo] MainAbility3 onWindowStageCreate") console.log("[Demo] MainAbility3 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null) windowStage.setUIContent(this.context, "pages/index", null)
} }
onWindowStageDestroy() { onWindowStageDestroy() {
// Main window is destroyed, release UI related resources // Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility3 onWindowStageDestroy") console.log("[Demo] MainAbility3 onWindowStageDestroy")
} }
onForeground() { onForeground() {
// Ability has brought to foreground // Ability has brought to foreground
console.log("[Demo] MainAbility3 onForeground") console.log("[Demo] MainAbility3 onForeground")
globalThis.abilitydelegator.getCurrentTopAbility().then((data)=>{ globalThis.abilitydelegator.getCurrentTopAbility().then((data)=>{
globalThis.ability3 = data globalThis.ability3 = data
console.debug("====>MainAbility getCurrentTopAbility:====>" + JSON.stringify(globalThis.ability3)); console.debug("====>MainAbility getCurrentTopAbility:====>" + JSON.stringify(globalThis.ability3));
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}) })
} }
onBackground() { onBackground() {
// Ability has back to background // Ability has back to background
console.log("[Demo] MainAbility3 onBackground") console.log("[Demo] MainAbility3 onBackground")
} }
}; };
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack Event====>"); console.debug("====>Publish CallBack Event====>");
} }
export default class MainAbility4 extends Ability { export default class MainAbility4 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility4 onCreate") console.log("[Demo] MainAbility4 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContext = this.context
setTimeout(()=> { setTimeout(()=> {
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}, 500) }, 500)
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility4 onDestroy") console.log("[Demo] MainAbility4 onDestroy")
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
console.log("[Demo] MainAbility4 onWindowStageCreate") console.log("[Demo] MainAbility4 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null) windowStage.setUIContent(this.context, "pages/index", null)
} }
onWindowStageDestroy() { onWindowStageDestroy() {
// Main window is destroyed, release UI related resources // Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility4 onWindowStageDestroy") console.log("[Demo] MainAbility4 onWindowStageDestroy")
} }
onForeground() { onForeground() {
// Ability has brought to foreground // Ability has brought to foreground
console.log("[Demo] MainAbility4 onForeground") console.log("[Demo] MainAbility4 onForeground")
} }
onBackground() { onBackground() {
// Ability has back to background // Ability has back to background
console.log("[Demo] MainAbility4 onBackground") console.log("[Demo] MainAbility4 onBackground")
} }
}; };
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent' import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() { function PublishCallBackOne() {
console.debug("====>Publish CallBack Event====>"); console.debug("====>Publish CallBack Event====>");
} }
export default class MainAbility5 extends Ability { export default class MainAbility5 extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility5 onCreate") console.log("[Demo] MainAbility5 onCreate")
globalThis.abilityContext = this.context globalThis.abilityContext = this.context
setTimeout(()=> { setTimeout(()=> {
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne); commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}, 500) }, 500)
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility5 onDestroy") console.log("[Demo] MainAbility5 onDestroy")
} }
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
console.log("[Demo] MainAbility5 onWindowStageCreate") console.log("[Demo] MainAbility5 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null) windowStage.setUIContent(this.context, "pages/index", null)
} }
onWindowStageDestroy() { onWindowStageDestroy() {
// Main window is destroyed, release UI related resources // Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility5 onWindowStageDestroy") console.log("[Demo] MainAbility5 onWindowStageDestroy")
} }
onForeground() { onForeground() {
// Ability has brought to foreground // Ability has brought to foreground
console.log("[Demo] MainAbility5 onForeground") console.log("[Demo] MainAbility5 onForeground")
} }
onBackground() { onBackground() {
// Ability has back to background // Ability has back to background
console.log("[Demo] MainAbility5 onBackground") console.log("[Demo] MainAbility5 onBackground")
} }
}; };
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@Entry @Entry
@Component @Component
struct Index { struct Index {
@State message: string = 'Hello World' @State message: string = 'Hello World'
build() { build() {
Row() { Row() {
Column() { Column() {
Text(this.message) Text(this.message)
.fontSize(50) .fontSize(50)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
} }
.width('100%') .width('100%')
} }
.height('100%') .height('100%')
} }
} }
\ No newline at end of file
{ {
"module": { "module": {
"name": "entry", "name": "entry",
"type": "entry", "type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts", "srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_desc", "description": "$string:entry_desc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"phone" "phone"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"uiSyntax": "ets", "uiSyntax": "ets",
"abilities": [ "abilities": [
{ {
"name": "MainAbility", "name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts", "srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc", "description": "$string:MainAbility_desc",
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"visible": true, "visible": true,
"skills": [ "skills": [
{ {
"entities": [ "entities": [
"entity.system.home" "entity.system.home"
], ],
"actions": [ "actions": [
"action.system.home" "action.system.home"
] ]
} }
] ]
}, },
{ {
"name": "MainAbility2", "name": "MainAbility2",
"srcEntrance": "./ets/MainAbility2/MainAbility2.ts", "srcEntrance": "./ets/MainAbility2/MainAbility2.ts",
"description": "$string:MainAbility2_desc", "description": "$string:MainAbility2_desc",
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility2_label", "label": "$string:MainAbility2_label",
"visible": true "visible": true
}, },
{ {
"name": "MainAbility3", "name": "MainAbility3",
"srcEntrance": "./ets/MainAbility3/MainAbility3.ts", "srcEntrance": "./ets/MainAbility3/MainAbility3.ts",
"description": "$string:MainAbility3_desc", "description": "$string:MainAbility3_desc",
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility3_label", "label": "$string:MainAbility3_label",
"visible": true "visible": true
}, },
{ {
"name": "MainAbility4", "name": "MainAbility4",
"srcEntrance": "./ets/MainAbility4/MainAbility4.ts", "srcEntrance": "./ets/MainAbility4/MainAbility4.ts",
"description": "$string:MainAbility4_desc", "description": "$string:MainAbility4_desc",
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility4_label" "label": "$string:MainAbility4_label"
}, },
{ {
"name": "MainAbility5", "name": "MainAbility5",
"srcEntrance": "./ets/MainAbility5/MainAbility5.ts", "srcEntrance": "./ets/MainAbility5/MainAbility5.ts",
"description": "$string:MainAbility5_desc", "description": "$string:MainAbility5_desc",
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility5_label" "label": "$string:MainAbility5_label"
} }
] ]
} }
} }
\ No newline at end of file
{ {
"string": [ "string": [
{ {
"name": "entry_desc", "name": "entry_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility_desc", "name": "MainAbility_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility_label", "name": "MainAbility_label",
"value": "label" "value": "label"
}, },
{ {
"name": "MainAbility1_desc", "name": "MainAbility1_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility1_label", "name": "MainAbility1_label",
"value": "label" "value": "label"
}, },
{ {
"name": "MainAbility2_desc", "name": "MainAbility2_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility2_label", "name": "MainAbility2_label",
"value": "label" "value": "label"
}, },
{ {
"name": "MainAbility3_desc", "name": "MainAbility3_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility3_label", "name": "MainAbility3_label",
"value": "label" "value": "label"
}, },
{ {
"name": "MainAbility4_desc", "name": "MainAbility4_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility4_label", "name": "MainAbility4_label",
"value": "label" "value": "label"
}, },
{ {
"name": "MainAbility5_desc", "name": "MainAbility5_desc",
"value": "description" "value": "description"
}, },
{ {
"name": "MainAbility5_label", "name": "MainAbility5_label",
"value": "label" "value": "label"
}, },
{ {
"name": "app_name", "name": "app_name",
"value": "Testapi" "value": "Testapi"
}, },
{ {
"name": "description_application", "name": "description_application",
"value": "demo for test" "value": "demo for test"
} }
] ]
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ group("faapicover") { ...@@ -17,7 +17,7 @@ group("faapicover") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [
"faapicoverhaptest:FaApiCoverHapTest", "faapicoverhaptest:ActsFaApiCoverTest",
"faauxiliary:FaAuxiliary", "faauxiliary:FaAuxiliary",
] ]
} }
......
...@@ -13,20 +13,25 @@ ...@@ -13,20 +13,25 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("FaApiCoverHapTest") { ohos_js_hap_suite("ActsFaApiCoverTest") {
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
deps = [ deps = [
":faapicoverhaptest_ets_assets", ":faapicoverhaptest_ets_assets",
":faapicoverhaptest_ets_resources", ":faapicoverhaptest_ets_resources",
":faapicoverhaptest_ets_test_assets",
] ]
ets2abc = true ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaApiCoverHapTest" hap_name = "ActsFaApiCoverTest"
} }
ohos_js_assets("faapicoverhaptest_ets_assets") { ohos_js_assets("faapicoverhaptest_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility" source_dir = "./entry/src/main/ets/MainAbility"
} }
ohos_js_assets("faapicoverhaptest_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("faapicoverhaptest_ets_resources") { ohos_resources("faapicoverhaptest_ets_resources") {
sources = [ "./entry/src/main/resources" ] sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
{ {
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "180000", "test-timeout": "600000",
"package": "com.example.faapicoverhaptest", "bundle-name": "com.example.faapicoverhaptest",
"package-name": "com.example.faapicoverhaptest",
"shell-timeout": "600000" "shell-timeout": "600000"
}, },
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"FaApiCoverHapTest.hap", "ActsFaApiCoverTest.hap",
"FaAuxiliary.hap" "FaAuxiliary.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
......
...@@ -41,6 +41,19 @@ ...@@ -41,6 +41,19 @@
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"type": "page", "type": "page",
"launchType": "singleton" "launchType": "singleton"
},
{
"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"
} }
], ],
"distro": { "distro": {
...@@ -66,6 +79,16 @@ ...@@ -66,6 +79,16 @@
"designWidth": 720, "designWidth": 720,
"autoDesignWidth": false "autoDesignWidth": false
} }
},
{
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
} }
] ]
} }
......
...@@ -12,32 +12,11 @@ ...@@ -12,32 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
import list from '../../test/ListTest'
@Entry @Entry
@Component @Component
struct Index { struct Index {
@State message: string = 'Hello World FA MainAbility' @State message: string = 'Hello World FA MainAbility'
aboutToAppear() {
console.info("start run testcase!!!!")
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(this)
list();
core.execute();
}
build() { build() {
Row() { Row() {
Column() { Column() {
......
/*
* 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 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
/*
* 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 router from '@system.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
/*
* 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 itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
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')
}
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
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 call abilityDelegator.getAppContext')
var context = abilityDelegator.getAppContext()
console.info('getAppContext : ' + JSON.stringify(context))
console.info('OpenHarmonyTestRunner onRun end')
}
};
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import FormInfo from '@ohos.application.formInfo'; import FormInfo from '@ohos.application.formInfo';
import formError from '@ohos.application.formError'; import formError from '@ohos.application.formError';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
......
...@@ -11,6 +11,14 @@ ...@@ -11,6 +11,14 @@
{ {
"name": "MainAbility_label", "name": "MainAbility_label",
"value": "FaXts" "value": "FaXts"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
} }
] ]
} }
\ No newline at end of file
...@@ -16,6 +16,6 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,6 +16,6 @@ import("//test/xts/tools/build/suite.gni")
group("workercontextcover") { group("workercontextcover") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ "workercontexttest:WorkerContextTest" ] deps = [ "workercontexttest:ActsWorkerContextTest" ]
} }
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("WorkerContextTest") { ohos_js_hap_suite("ActsWorkerContextTest") {
hap_profile = "entry/src/main/module.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug" js_build_mode = "debug"
deps = [ deps = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册