未验证 提交 56f0570f 编写于 作者: O openharmony_ci 提交者: Gitee

!4914 免安装适配测试套新框架

Merge pull request !4914 from dy/master0809
......@@ -17,6 +17,7 @@ group("freeinstalltest") {
testonly = true
if (is_standard_system) {
deps = [
"connectabilityfatest/actsfreeinstallconnectabilityfatest:ActsFreeInstallConnectAbilityFaTest",
"connectabilityfatest/connectdifferentapplication:ConnectDifferentApplication",
"connectabilityfatest/connectfamyapplication1:ConnectFaMyApplication1",
"connectabilityfatest/connectfamyapplication10:ConnectFaMyApplication10",
......@@ -28,7 +29,7 @@ group("freeinstalltest") {
"connectabilityfatest/connectfamyapplication7:ConnectFaMyApplication7",
"connectabilityfatest/connectfamyapplication8:ConnectFaMyApplication8",
"connectabilityfatest/connectfamyapplication9:ConnectFaMyApplication9",
"connectabilityfatest/freeinstallconnectabilityfatest:FreeInstallConnectAbilityFaTest",
"connectabilitystagetest/actsfreeinstallconnectabilitystagetest:ActsFreeInstallConnectAbilityStageTest",
"connectabilitystagetest/connectstagemyapplication0:ConnectStageMyApplication0",
"connectabilitystagetest/connectstagemyapplication1:ConnectStageMyApplication1",
"connectabilitystagetest/connectstagemyapplication2:ConnectStageMyApplication2",
......@@ -38,34 +39,33 @@ group("freeinstalltest") {
"connectabilitystagetest/connectstagemyapplication6:ConnectStageMyApplication6",
"connectabilitystagetest/connectstagemyapplication7:ConnectStageMyApplication7",
"connectabilitystagetest/connectstagemyapplication8:ConnectStageMyApplication8",
"connectabilitystagetest/freeinstallconnectabilitystagetest:FreeInstallConnectAbilityStageTest",
"mockservice:MockService",
"mockservicetimeout:MockServiceTimeout",
"startabilityfatest/actsfreeinstallstartabilityfatest:ActsFreeInstallStartAbilityFaTest",
"startabilityfatest/actsstartabilitynotargetbundlelistfatest:ActsStartAbilityNoTargetBundleListFaTest",
"startabilityfatest/atomizationfaentry:AtomizationFaEntry",
"startabilityfatest/atomizationfahm2:AtomizationFaHm2",
"startabilityfatest/atomizationfahm4:AtomizationFaHm4",
"startabilityfatest/famyapplication1:FaMyApplication1",
"startabilityfatest/freeinstallstartabilityfatest:FreeInstallStartAbilityFaTest",
"startabilityfatest/startabilitynotargetbundlelistfatest:StartAbilityNoTargetBundleListFaTest",
"startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest:ActsFreeInstallStartAbilityForResultFaTest",
"startabilityforresultfatest/actsstartabilityforresultnotargetfatest:ActsStartAbilityForResultNoTargetFaTest",
"startabilityforresultfatest/atomizationresulta:AtomizationResultA",
"startabilityforresultfatest/atomizationresultfaentry:AtomizationResultFaEntry",
"startabilityforresultfatest/atomizationresultfahm1:AtomizationResultFaHm1",
"startabilityforresultfatest/atomizationresultfahm2:AtomizationResultFaHm2",
"startabilityforresultfatest/faresultmyapplication1:FaResultMyApplication1",
"startabilityforresultfatest/freeinstallstartabilityforresultfatest:FreeInstallStartAbilityForResultFaTest",
"startabilityforresultfatest/startabilityforresultnotargetfatest:StartAbilityForResultNoTargetFaTest",
"startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest:ActsFreeInstallStartAbilityForResultStageTest",
"startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest:ActsStartAbilityForResultNoTargetBundleListStageTest",
"startabilityforresultstagetest/atomizationresultstageentry:AtomizationResultStageEntry",
"startabilityforresultstagetest/atomizationresultstagehm2:AtomizationResultStageHm2",
"startabilityforresultstagetest/atomizationresultstagehnm2:AtomizationResultStageHnm2",
"startabilityforresultstagetest/freeinstallstartabilityforresultstagetest:FreeInstallStartAbilityForResultStageTest",
"startabilityforresultstagetest/stageresultmyapplication1:StageResultMyApplication1",
"startabilityforresultstagetest/startabilityforresultnotargetbundleliststagetest:StartAbilityForResultNoTargetBundleListStageTest",
"startabilitystagetest/actsfreeinstallstartabilitystagetest:ActsFreeInstallStartAbilityStageTest",
"startabilitystagetest/actsstartabilitynotargetbundleliststagetest:ActsStartAbilityNoTargetBundleListStageTest",
"startabilitystagetest/atomizationstageentry:AtomizationStageEntry",
"startabilitystagetest/atomizationstagehm2:AtomizationStageHm2",
"startabilitystagetest/atomizationstagehm4:AtomizationStageHm4",
"startabilitystagetest/freeinstallstartabilitystagetest:FreeInstallStartAbilityStageTest",
"startabilitystagetest/stagemyapplication1:StageMyApplication1",
"startabilitystagetest/startabilitynotargetbundleliststagetest:StartAbilityNoTargetBundleListStageTest",
]
}
}
......@@ -13,22 +13,22 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("FreeInstallStartAbilityFaTest") {
ohos_js_hap_suite("ActsFreeInstallConnectAbilityFaTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":freeinstallstartabilityfatest_ets_assets",
":freeinstallstartabilityfatest_ets_resources",
":actsfreeinstallconnectabilityfatest_ets_assets",
":actsfreeinstallconnectabilityfatest_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FreeInstallStartAbilityFaTest"
hap_name = "ActsFreeInstallConnectAbilityFaTest"
}
ohos_js_assets("freeinstallstartabilityfatest_ets_assets") {
ohos_js_assets("actsfreeinstallconnectabilityfatest_ets_assets") {
source_dir = "./entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("freeinstallstartabilityfatest_ets_resources") {
ohos_resources("actsfreeinstallconnectabilityfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
......@@ -5,12 +5,13 @@
"test-timeout": "600000",
"bundle-name": "com.example.myapplication.hmservice",
"package-name": "com.example.myapplication",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout": "10000"
},
"kits": [
{
"test-file-name": [
"FreeInstallConnectAbilityFaTest.hap"
"ActsFreeInstallConnectAbilityFaTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
// @ts-nocheck
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../test/List.test";
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
aboutToAppear() {
console.info("aboutToAppear start!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
* 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 rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant'
......
......@@ -15,7 +15,7 @@
* 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 rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant'
......
......@@ -14,7 +14,7 @@
* 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 featureAbility from '@ohos.ability.featureAbility';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from '@ohos.commonEvent';
......
......@@ -23,7 +23,7 @@ function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s package','-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
......
// @ts-nocheck
/**
* 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 file from '@system.file';
import {Core, ExpectExtend, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test";
import featureAbility from "@ohos.ability.featureAbility";
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
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');
console.info('parameters---->' + JSON.stringify(Want.parameters));
Want.parameters.timeout = 10000;
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
......@@ -13,29 +13,29 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("FreeInstallStartAbilityStageTest") {
ohos_js_hap_suite("ActsFreeInstallConnectAbilityStageTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":freeinstallstartabilitystagetest_js_assets",
":freeinstallstartabilitystagetest_resources",
":actsfreeinstallconnectabilitystagetest_js_assets",
":actsfreeinstallconnectabilitystagetest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "FreeInstallStartAbilityStageTest"
hap_name = "ActsFreeInstallConnectAbilityStageTest"
}
ohos_app_scope("freeinstallstartabilitystagetest_app_profile") {
ohos_app_scope("actsfreeinstallconnectabilitystagetest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("freeinstallstartabilitystagetest_js_assets") {
ohos_js_assets("actsfreeinstallconnectabilitystagetest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("freeinstallstartabilitystagetest_resources") {
ohos_resources("actsfreeinstallconnectabilitystagetest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":freeinstallstartabilitystagetest_app_profile" ]
deps = [ ":actsfreeinstallconnectabilitystagetest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
......@@ -5,12 +5,13 @@
"test-timeout": "600000",
"bundle-name": "com.example.myapplication.hmservice",
"module-name": "entry",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"FreeInstallConnectAbilityStageTest.hap"
"ActsFreeInstallConnectAbilityStageTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -22,7 +22,7 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout'
'-s level', '-s testType', '-s size', '-s timeout','-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
......
......@@ -14,29 +14,22 @@
*/
// @ts-nocheck
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import List from '../test/ListTest'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/ListTest'
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
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();
globalThis.abilityWant.parameters.timeout = 60000;
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(globalThis.abilityWant.parameters);
List(globalThis.abilityContext);
core.execute();
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
......
......@@ -15,7 +15,7 @@
* 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 rpc from '@ohos.rpc';
import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt';
......
......@@ -14,7 +14,7 @@
* 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 commonEvent from '@ohos.commonEvent';
export default function ConnectAbilityTest_Ext(abilityContext) {
......
......@@ -13,22 +13,22 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("FreeInstallConnectAbilityFaTest") {
ohos_js_hap_suite("ActsFreeInstallStartAbilityFaTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":freeinstallconnectabilityfatest_ets_assets",
":freeinstallconnectabilityfatest_ets_resources",
":actsfreeinstallstartabilityfatest_ets_assets",
":actsfreeinstallstartabilityfatest_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FreeInstallConnectAbilityFaTest"
hap_name = "ActsFreeInstallStartAbilityFaTest"
}
ohos_js_assets("freeinstallconnectabilityfatest_ets_assets") {
ohos_js_assets("actsfreeinstallstartabilityfatest_ets_assets") {
source_dir = "./entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("freeinstallconnectabilityfatest_ets_resources") {
ohos_resources("actsfreeinstallstartabilityfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
......@@ -5,12 +5,13 @@
"test-timeout": "600000",
"bundle-name": "com.open.harmony.startAbility",
"package-name": "com.open.harmony.startAbility",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout": "50000"
},
"kits": [
{
"test-file-name": [
"FreeInstallStartAbilityFaTest.hap"
"ActsFreeInstallStartAbilityFaTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -17,7 +17,8 @@
import router from '@system.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index";
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../test/List.test";
import featureAbility from "@ohos.ability.featureAbility";
......@@ -36,29 +37,13 @@ async function routePage() {
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
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();
Want.parameters.timeout = 50000;
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
console.info("aboutToAppear start!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
......
......@@ -14,7 +14,7 @@
* 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 featureAbility from "@ohos.ability.featureAbility";
import wantConstant from '@ohos.ability.wantConstant';
import abilityManager from '@ohos.application.abilityManager';
......@@ -543,72 +543,6 @@ export default function startAbilityTest() {
done();
});
/*
* @tc.number FreeInstall_FA_Local_StartAbility_1300
* @tc.name Flags= '94.31' of the incoming error. There is a hap package that
needs to be installed free under the specified path
* @tc.desc Function test
* @tc.level 0
*/
it("FreeInstall_FA_Local_StartAbility_1300", 0, async function (done) {
console.info("------------start FreeInstall_FA_Local_StartAbility_1300-------------");
TAG = "FreeInstall_FA_Local_StartAbility_1300";
let wrong;
var str = {
'want': {
"bundleName": "com.example.qianyiyingyong.hmservice",
"abilityName": "com.example.qianyiyingyong.MainAbility",
"moduleName": "entry",
"flags": 94.31
}
}
await featureAbility.startAbility(str).then((data) => {
console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
}).catch((error) => {
wrong = error;
console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
});
await sleep(2000);
expect(wrong.code).assertEqual(1);
console.info("------------end FreeInstall_FA_Local_StartAbility_1300-------------");
done();
});
/*
* @tc.number FreeInstall_FA_Local_StartAbility_1400
* @tc.name Flags= '94.31' of incoming error, atomized HAP package installed
* @tc.desc Function test
* @tc.level 0
*/
it("FreeInstall_FA_Local_StartAbility_1400", 0, async function (done) {
console.info("------------start FreeInstall_FA_Local_StartAbility_1400-------------");
TAG = "FreeInstall_FA_Local_StartAbility_1400";
var cmd1400 = "bm install -p data/test/AtomizationFaEntry.hap";
delegator.executeShellCommand(cmd1400, (err: any, d: any) => {
console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
await sleep(500);
let details;
var str = {
'want': {
"bundleName": "com.example.qianyiyingyong.hmservice",
"abilityName": "com.example.qianyiyingyong.MainAbility",
"moduleName": "entry",
"flags": 94.31
}
}
await featureAbility.startAbility(str).then((data) => {
details = data;
console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
}).catch((error) => {
console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
});
await sleep(2000);
expect(details).assertEqual(0);
console.info("------------end FreeInstall_FA_Local_StartAbility_1400-------------");
done();
});
/*
* @tc.number FreeInstall_FA_Local_StartAbility_1500
* @tc.name Flags= '' of the incoming error. There is a hap package that needs to be
......
......@@ -15,7 +15,7 @@
* 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 featureAbility from "@ohos.ability.featureAbility";
import wantConstant from '@ohos.ability.wantConstant';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
......
......@@ -23,7 +23,7 @@ function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s package','-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
......
......@@ -13,20 +13,20 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("FreeInstallStartAbilityForResultFaTest") {
ohos_js_hap_suite("ActsStartAbilityNoTargetBundleListFaTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":freeinstallstartabilityforresultfatest_ets_assets",
":freeinstallstartabilityforresultfatest_ets_resources",
":actsstartabilitynotargetbundlelistfatest_ets_assets",
":actsstartabilitynotargetbundlelistfatest_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FreeInstallStartAbilityForResultFaTest"
hap_name = "ActsStartAbilityNoTargetBundleListFaTest"
}
ohos_js_assets("freeinstallstartabilityforresultfatest_ets_assets") {
ohos_js_assets("actsstartabilitynotargetbundlelistfatest_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("freeinstallstartabilityforresultfatest_ets_resources") {
ohos_resources("actsstartabilitynotargetbundlelistfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
......@@ -5,12 +5,13 @@
"test-timeout": "600000",
"bundle-name": "com.open.harmony.startAbility",
"package-name": "com.open.harmony.startAbility",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout": "50000"
},
"kits": [
{
"test-file-name": [
"StartAbilityNoTargetBundleListFaTest.hap"
"ActsStartAbilityNoTargetBundleListFaTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -17,7 +17,8 @@
import router from '@system.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index";
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../test/List.test";
import featureAbility from "@ohos.ability.featureAbility";
......@@ -36,29 +37,13 @@ async function routePage() {
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
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();
Want.parameters.timeout = 50000;
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
console.info("aboutToAppear start!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
......
......@@ -15,7 +15,7 @@
* 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 Utils from './Utils';
import featureAbility from "@ohos.ability.featureAbility";
import wantConstant from '@ohos.ability.wantConstant';
......
......@@ -23,7 +23,7 @@ function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s package','-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
......
......@@ -13,20 +13,20 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("StartAbilityNoTargetBundleListFaTest") {
ohos_js_hap_suite("ActsFreeInstallStartAbilityForResultFaTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":startabilitynotargetbundlelistfatest_ets_assets",
":startabilitynotargetbundlelistfatest_ets_resources",
":actsfreeinstallstartabilityforresultfatest_ets_assets",
":actsfreeinstallstartabilityforresultfatest_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StartAbilityNoTargetBundleListFaTest"
hap_name = "ActsFreeInstallStartAbilityForResultFaTest"
}
ohos_js_assets("startabilitynotargetbundlelistfatest_ets_assets") {
ohos_js_assets("actsfreeinstallstartabilityforresultfatest_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("startabilitynotargetbundlelistfatest_ets_resources") {
ohos_resources("actsfreeinstallstartabilityforresultfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
......@@ -5,12 +5,13 @@
"test-timeout": "600000",
"bundle-name": "com.open.harmony.startAbilityForResult",
"package-name": "com.open.harmony.startAbilityForResult",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout": "50000"
},
"kits": [
{
"test-file-name": [
"FreeInstallStartAbilityForResultFaTest.hap"
"ActsFreeInstallStartAbilityForResultFaTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -17,7 +17,8 @@
import router from '@system.router';
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend,expect} from "deccjsunit/index";
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../test/List.test";
import featureAbility from "@ohos.ability.featureAbility";
......@@ -36,29 +37,13 @@ async function routePage() {
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
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();
Want.parameters.timeout = 50000;
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
console.info("aboutToAppear start!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
......
......@@ -16,7 +16,7 @@
* 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 Utils from './Utils';
import featureAbility from "@ohos.ability.featureAbility";
import wantConstant from '@ohos.ability.wantConstant';
......
......@@ -16,7 +16,7 @@
* 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 Utils from './Utils';
import featureAbility from "@ohos.ability.featureAbility";
import wantConstant from '@ohos.ability.wantConstant';
......
......@@ -23,7 +23,7 @@ function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s package','-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
......
......@@ -13,20 +13,20 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("StartAbilityForResultNoTargetFaTest") {
ohos_js_hap_suite("ActsStartAbilityForResultNoTargetFaTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":startabilityforresultnotargetfatest_ets_assets",
":startabilityforresultnotargetfatest_ets_resources",
":actsstartabilityforresultnotargetfatest_ets_assets",
":actsstartabilityforresultnotargetfatest_ets_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StartAbilityForResultNoTargetFaTest"
hap_name = "ActsStartAbilityForResultNoTargetFaTest"
}
ohos_js_assets("startabilityforresultnotargetfatest_ets_assets") {
ohos_js_assets("actsstartabilityforresultnotargetfatest_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("startabilityforresultnotargetfatest_ets_resources") {
ohos_resources("actsstartabilityforresultnotargetfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册