提交 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 = {
......
...@@ -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
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册