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

!8552 【ACE子系统】切stage模型&适配测试用例

Merge pull request !8552 from hekun/master
{
"app": {
"bundleName": "com.open.harmony.myapplication",
"vendor": "huawei",
"versionCode": 1000000,
"versionName": "1.0.0",
"debug": false,
"icon": "$media:icon",
"label": "$string:app_name",
"description": "$string:description_application",
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 10,
"targetAPIVersion": 10,
"car": {
"apiCompatibleVersion": 10,
"singleUser": false
}
}
}
\ No newline at end of file
{
"string":[
{
"name":"app_name",
"value":"ohosProject"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2023 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
......@@ -14,25 +14,29 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsStTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_demo_ets_assets",
":ace_demo_ets_resources",
":ace_demo_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsStTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_demo_ets_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_demo_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_demo_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_demo_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_demo_ets_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
......@@ -3,8 +3,8 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.open.harmony.myapplication",
"package-name": "com.open.harmony.myapplication",
"bundle-name": "com.open.harmony.myapplication",
"module-name": "phone",
"shell-timeout": "600000"
},
"kits": [
......
{
"app": {
"bundleName": "com.open.harmony.myapplication",
"vendor": "open",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"releaseType": "Release",
"target": 8
}
},
"deviceConfig": {},
"module": {
"package": "com.open.harmony.myapplication",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"visible": true,
"srcPath": "TestAbility",
"name": ".TestAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"formsEnabled": false,
"label": "$string:TestAbility_label",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/Button",
"pages/Blank",
"pages/DataPanel",
"pages/Divider",
"pages/Text",
"pages/RowSplit",
"pages/Scroll",
"pages/Stack",
"pages/Image",
"pages/Progress",
"pages/Qrcode",
"pages/Rating",
"pages/Span",
"pages/Slider",
"pages/Badge",
"pages/Column",
"pages/ColumnSplit",
"pages/Counter",
"pages/Flex",
"pages/GridContainer"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
globalThis.stageOnCreateRun = 1;
globalThis.stageContext = this.context;
}
}
import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want,launchParam){
// Ability is creating, initialize resources for this ability
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
// Ability is destroying, release resources for this ability
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage)
globalThis.windowStage = windowStage
globalThis.abilityContext = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
onWindowStageDestroy() {
//Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -43,7 +43,7 @@ struct image_textcase {
.renderMode(ImageRenderMode.Original)
.autoResize(false)
.syncLoad(false)
.sourceSize({ width: 200, height: 100 })
.sourceSize({ width: px2vp(200), height: px2vp(100) })
.alt("/resources/rawfile/person.png")
.key('image1')
Image("/resources/rawfile/hand.png")
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2023 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 '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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')
},
/*
* Copyright (c) 2023 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 Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default class CommonFunc {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
}
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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')
},
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Callback {
(message:any):void
}
export class MessageManager {
callback:Callback
callbacks:Map<string,Callback> = new Map()
constructor() {
}
registerCallback(callback:Callback , type?:string) {
if (type == undefined) {
console.error('registerCallback callback set')
this.callback = callback
return
}
this.callbacks.set(type,callback)
}
notify(message:any, type?:string) {
if (type == undefined) {
this.callback(message)
return
}
let tmpCallback:Callback = this.callbacks.get(type)
if (tmpCallback === undefined) {
console.error('callbacks has no callback for type ' + type)
return
}
tmpCallback(message)
}
clear() {
this.callbacks.clear()
this.callback = null
}
}
\ No newline at end of file
/*
* Copyright (c) 2023 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 Ability from '@ohos.app.ability.UIAbility'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
console.log('TestAbility onCreate')
}
onDestroy() {
console.log('TestAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('TestAbility onWindowStageCreate')
windowStage.loadContent("TestAbility/pages/index", (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
});
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.log('TestAbility onWindowStageDestroy')
}
onForeground() {
console.log('TestAbility onForeground')
}
onBackground() {
console.log('TestAbility onBackground')
}
};
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* Copyright (c) 2023 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
......@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
targetParams = `${targetParams} ${key} ${parameters[key]}`
}
}
return targetParams.trim()
}
async function onAbilityCreateCallback() {
console.log('onAbilityCreateCallback');
console.log("onAbilityCreateCallback");
}
async function addAbilityMonitorCallback(err: any) {
console.info('addAbilityMonitorCallback : ' + JSON.stringify(err))
console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
}
export default class OpenHarmonyTestRunner implements TestRunner {
......@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
console.info("OpenHarmonyTestRunner OnPrepare ")
}
onRun() {
async onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
var cmd = 'aa start -d 0 -a com.open.harmony.myapplication.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
......@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
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
};
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function badgeJsunit() {
......@@ -32,7 +32,7 @@ export default function badgeJsunit() {
describe('badgeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Badge',
uri: 'MainAbility/pages/Badge',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function blankJsunit() {
......@@ -32,7 +32,7 @@ export default function blankJsunit() {
describe('BlankTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Blank',
uri: 'MainAbility/pages/Blank',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function buttonJsunit() {
......@@ -32,7 +32,7 @@ export default function buttonJsunit() {
describe('buttonTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Button',
uri: 'MainAbility/pages/Button',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function columnJsunit() {
......@@ -32,7 +32,7 @@ export default function columnJsunit() {
describe('columnTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Column',
uri: 'MainAbility/pages/Column',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function columnSplitJsunit() {
......@@ -32,7 +32,7 @@ export default function columnSplitJsunit() {
describe('columnSplitTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/ColumnSplit',
uri: 'MainAbility/pages/ColumnSplit',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function counterJsunit() {
......@@ -32,7 +32,7 @@ export default function counterJsunit() {
describe('counterTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Counter',
uri: 'MainAbility/pages/Counter',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function datapanelJsunit() {
......@@ -32,7 +32,7 @@ export default function datapanelJsunit() {
describe('dataPanelTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/DataPanel',
uri: 'MainAbility/pages/DataPanel',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function dividerJsunit() {
......@@ -32,7 +32,7 @@ export default function dividerJsunit() {
describe('dividerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Divider',
uri: 'MainAbility/pages/Divider',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function flexJsunit() {
......@@ -32,7 +32,7 @@ export default function flexJsunit() {
describe('flexTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Flex',
uri: 'MainAbility/pages/Flex',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function gridContainerJsunit() {
......@@ -32,7 +32,7 @@ export default function gridContainerJsunit() {
describe('gridContainerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/GridContainer',
uri: 'MainAbility/pages/GridContainer',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function imageJsunit() {
......@@ -32,7 +32,7 @@ export default function imageJsunit() {
describe('imageTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Image',
uri: 'MainAbility/pages/Image',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -33,6 +33,7 @@ import flexJsunit from './FlexJsunit.test.ets';
import counterJsunit from './CounterJsunit.test.ets';
import columnSplitJsunit from './ColumnSplitJsunit.test.ets';
import columnJsunit from './ColumnJsunit.test.ets';
export default function testsuite() {
buttonJsunit()
blankJsunit()
......@@ -54,5 +55,4 @@ export default function testsuite() {
counterJsunit()
flexJsunit()
gridContainerJsunit()
}
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function panelJsunit() {
......@@ -32,7 +32,7 @@ export default function panelJsunit() {
describe('panelTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Panel',
uri: 'MainAbility/pages/Panel',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function progressJsunit() {
......@@ -32,7 +32,7 @@ export default function progressJsunit() {
describe('progressTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Progress',
uri: 'MainAbility/pages/Progress',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function qrcodeJsunit() {
......@@ -32,7 +32,7 @@ export default function qrcodeJsunit() {
describe('QrcodeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Qrcode',
uri: 'MainAbility/pages/Qrcode',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function ratingJsunit() {
......@@ -32,7 +32,7 @@ export default function ratingJsunit() {
describe('ratingTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Rating',
uri: 'MainAbility/pages/Rating',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function rowSplitJsunit() {
......@@ -32,7 +32,7 @@ export default function rowSplitJsunit() {
describe('RowSplitTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/RowSplit',
uri: 'MainAbility/pages/RowSplit',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function ScrollJsunit() {
......@@ -32,7 +32,7 @@ export default function ScrollJsunit() {
describe('scrollTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Scroll',
uri: 'MainAbility/pages/Scroll',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function sliderJsunit() {
......@@ -32,7 +32,7 @@ export default function sliderJsunit() {
describe('SliderTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Slider',
uri: 'MainAbility/pages/Slider',
}
try {
router.clear();
......@@ -71,7 +71,7 @@ export default function sliderJsunit() {
expect(obj.$attrs.constructor.min).assertEqual(0.000000.toFixed(6))
expect(obj.$attrs.constructor.max).assertEqual(100.000000.toFixed(6))
expect(obj.$attrs.constructor.step).assertEqual(1.000000.toFixed(6))
expect(obj.$attrs.constructor.style).assertEqual("SliderStyle.OutSet")
expect(obj.$attrs.style).assertEqual("SliderStyle.OutSet")
console.info('testGetSliderAttr1 END');
done();
});
......@@ -88,7 +88,7 @@ export default function sliderJsunit() {
console.info("component obj is Slider: " + JSON.stringify(obj));
expect(obj.$attrs.showTips).assertEqual("true")
expect(obj.$attrs.showSteps).assertEqual("true")
expect(obj.$attrs.constructor.style).assertEqual("SliderStyle.InSet")
expect(obj.$attrs.style).assertEqual("SliderStyle.InSet")
console.info('testGetSliderAttr2 END');
done();
});
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function spanJsunit() {
......@@ -32,7 +32,7 @@ export default function spanJsunit() {
describe('SpanTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Span',
uri: 'MainAbility/pages/Span',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function StackJsunit() {
......@@ -32,7 +32,7 @@ export default function StackJsunit() {
describe('StackTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Stack',
uri: 'MainAbility/pages/Stack',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function textJsunit() {
......@@ -32,7 +32,7 @@ export default function textJsunit() {
describe('textTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Text',
uri: 'MainAbility/pages/Text',
}
try {
router.clear();
......@@ -93,7 +93,7 @@ export default function textJsunit() {
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold")
expect(obj.$attrs.fontStyle).assertEqual("FontStyle.Italic")
expect(obj.$attrs.fontFamily).assertEqual("sans-serif")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.End")
expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Ellipsis")
expect(obj.$attrs.lineHeight).assertEqual("15.00fp")
expect(obj.$attrs.baselineOffset).assertEqual("0")
......@@ -125,7 +125,7 @@ export default function textJsunit() {
expect(obj.$attrs.enabled).assertEqual(true)
expect(obj.$attrs.visibility).assertEqual("Visibility.Hidden")
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Normal")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Start")
expect(obj.$attrs.textOverflow).assertEqual("TextOverflow.Clip")
expect(obj.$attrs.decoration).assertEqual(JSON.stringify({
type: "TextDecorationType.LineThrough", color: "#FFFF0000"
......@@ -150,7 +150,7 @@ export default function textJsunit() {
expect(obj.$attrs.borderStyle).assertEqual("BorderStyle.Solid")
expect(obj.$attrs.visibility).assertEqual("Visibility.None")
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bolder")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Right")
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center")
expect(obj.$attrs.textCase).assertEqual("TextCase.UpperCase")
expect(obj.$attrs.decoration).assertEqual(JSON.stringify({
type: "TextDecorationType.None", color: "#FFFF0000"
......
{
"module": {
"name": "phone",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet",
"default",
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"abilities": [{
"name": "com.open.harmony.myapplication.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main",
"icon": "$media:icon",
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
"skills": [{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}]
}]
}
}
......@@ -15,6 +15,34 @@
{
"name": "TestAbility_label",
"value": "label"
},
{
"name": "phone_entry_dsc",
"value": "i am an entry for phone"
},
{
"name": "phone_entry_main",
"value": "the phone entry ability"
},
{
"name": "entry_label",
"value": "ActsContextTest"
},
{
"name": "form_description",
"value": "my form"
},
{
"name": "serviceability_description",
"value": "my whether"
},
{
"name": "description_application",
"value": "demo for test"
},
{
"name": "app_name",
"value": "Demo"
}
]
}
\ No newline at end of file
{
"src": [
"MainAbility/pages/index/index",
"MainAbility/pages/second/second",
"MainAbility/pages/index",
"MainAbility/pages/Button",
"MainAbility/pages/Blank",
"MainAbility/pages/DataPanel",
"MainAbility/pages/Divider",
"MainAbility/pages/Text",
"MainAbility/pages/RowSplit",
"MainAbility/pages/Scroll",
"MainAbility/pages/Stack",
"MainAbility/pages/Image",
"MainAbility/pages/Progress",
"MainAbility/pages/Qrcode",
"MainAbility/pages/Rating",
"MainAbility/pages/Span",
"MainAbility/pages/Slider",
"MainAbility/pages/Badge",
"MainAbility/pages/Column",
"MainAbility/pages/ColumnSplit",
"MainAbility/pages/Counter",
"MainAbility/pages/Flex",
"MainAbility/pages/GridContainer"
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.open.harmony.standardtest",
"vendor": "huawei",
"versionCode": 1000000,
"versionName": "1.0.0",
"debug": false,
"icon": "$media:icon",
"label": "$string:app_name",
"description": "$string:description_application",
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 10,
"targetAPIVersion": 10,
"car": {
"apiCompatibleVersion": 10,
"singleUser": false
}
}
}
\ No newline at end of file
{
"string":[
{
"name":"app_name",
"value":"ohosProject"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2023 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
......@@ -14,25 +14,30 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_assets",
":ace_ets_resources",
":ace_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_test_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_test_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
......@@ -3,8 +3,8 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.open.harmony.standardtest",
"package-name": "com.open.harmony.standardtest",
"bundle-name": "com.open.harmony.standardtest",
"module-name": "phone",
"shell-timeout": "600000"
},
"kits": [
......
{
"app": {
"bundleName": "com.open.harmony.standardtest",
"vendor": "open",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"releaseType": "Release",
"target": 8
}
},
"deviceConfig": {},
"module": {
"package": "com.open.harmony.standardtest",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"visible": true,
"srcPath": "TestAbility",
"name": ".TestAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"formsEnabled": false,
"label": "$string:TestAbility_label",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/AlphabetIndexer",
"pages/Grid",
"pages/GridItem",
"pages/List",
"pages/ListItem",
"pages/Navigator",
"pages/Panel",
"pages/Row",
"pages/Swiper",
"pages/Tab",
"pages/Calendar",
"pages/AlertDialog",
"pages/Prop",
"pages/Link",
"pages/AppStorage",
"pages/Video",
"pages/components/Marquee",
"pages/components/Path",
"pages/components/PatternLock",
"pages/components/Polygon",
"pages/components/Polyline",
"pages/components/Rect",
"pages/components/RichText",
"pages/components/Select",
"pages/components/Shape",
"pages/components/Sidebar",
"pages/components/FormComponentPage",
"pages/components/XComponentPage",
"pages/components/WebPage"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
globalThis.stageOnCreateRun = 1;
globalThis.stageContext = this.context;
}
}
import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want,launchParam){
// Ability is creating, initialize resources for this ability
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
// Ability is destroying, release resources for this ability
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage)
globalThis.windowStage = windowStage
globalThis.abilityContext = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
onWindowStageDestroy() {
//Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
\ No newline at end of file
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2023 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 '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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')
},
/*
* Copyright (c) 2023 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 Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default class CommonFunc {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Callback {
(message:any):void
}
export class MessageManager {
callback:Callback
callbacks:Map<string,Callback> = new Map()
constructor() {
}
registerCallback(callback:Callback , type?:string) {
if (type == undefined) {
console.error('registerCallback callback set')
this.callback = callback
return
}
this.callbacks.set(type,callback)
}
notify(message:any, type?:string) {
if (type == undefined) {
this.callback(message)
return
}
let tmpCallback:Callback = this.callbacks.get(type)
if (tmpCallback === undefined) {
console.error('callbacks has no callback for type ' + type)
return
}
tmpCallback(message)
}
clear() {
this.callbacks.clear()
this.callback = null
}
}
\ No newline at end of file
/*
* Copyright (c) 2023 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 Ability from '@ohos.app.ability.UIAbility'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
console.log('TestAbility onCreate')
}
onDestroy() {
console.log('TestAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('TestAbility onWindowStageCreate')
windowStage.loadContent("TestAbility/pages/index", (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
});
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.log('TestAbility onWindowStageDestroy')
}
onForeground() {
console.log('TestAbility onForeground')
}
onBackground() {
console.log('TestAbility onBackground')
}
};
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* Copyright (c) 2023 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
......@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
targetParams = `${targetParams} ${key} ${parameters[key]}`
}
}
return targetParams.trim()
}
async function onAbilityCreateCallback() {
console.log('onAbilityCreateCallback');
console.log("onAbilityCreateCallback");
}
async function addAbilityMonitorCallback(err: any) {
console.info('addAbilityMonitorCallback : ' + JSON.stringify(err))
console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
}
export default class OpenHarmonyTestRunner implements TestRunner {
......@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
console.info("OpenHarmonyTestRunner OnPrepare ")
}
onRun() {
async onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
var cmd = 'aa start -d 0 -a com.open.harmony.standardtest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
......@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
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
};
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
* 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 router from '@system.router';
export default function alphabetIndexerJsunit() {
......@@ -32,7 +32,7 @@ export default function alphabetIndexerJsunit() {
describe('alphabetIndexerTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/AlphabetIndexer',
uri: 'MainAbility/pages/AlphabetIndexer',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function appStorageJsunit() {
......@@ -32,7 +32,7 @@ export default function appStorageJsunit() {
describe('appStorageTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/AppStorage',
uri: 'MainAbility/pages/AppStorage',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function gridItemJsunit() {
......@@ -32,7 +32,7 @@ export default function gridItemJsunit() {
describe('gridItemTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/GridItem',
uri: 'MainAbility/pages/GridItem',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function gridJsunit() {
......@@ -32,7 +32,7 @@ export default function gridJsunit() {
describe('gridTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Grid',
uri: 'MainAbility/pages/Grid',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function linkJsunit() {
......@@ -33,7 +33,7 @@ export default function linkJsunit() {
describe('linkTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Link',
uri: 'MainAbility/pages/Link',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -27,6 +27,7 @@ import listItemJsunit from './ListItemJsunit.test.ets';
import gridItemJsunit from './GridItem.test.ets';
import gridJsunit from './GridJsnuit.test.ets';
import videoJsunit from './VideoJsunit.test.ets';
export default function testsuite() {
alphabetIndexerJsunit()
rowJsunit()
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function listItemJsunit() {
......@@ -32,7 +32,7 @@ export default function listItemJsunit() {
describe('listItemTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/ListItem',
uri: 'MainAbility/pages/ListItem',
}
try {
router.clear();
......@@ -72,7 +72,6 @@ export default function listItemJsunit() {
console.log('ListItem1‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem1‘s editable is ' + JSON.stringify(obj.$attrs.editable))
expect(obj.$attrs.sticky).assertEqual('Sticky.None')
expect(obj.$attrs.editable).assertEqual('true')
console.info('++++++++++++++++ ListItem TestCase 1 End ++++++++++++++++');
done();
});
......@@ -94,7 +93,6 @@ export default function listItemJsunit() {
console.log('ListItem2‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Normal')
expect(obj.$attrs.editable).assertEqual('EditMode.Deletable')
console.info('++++++++++++++++ ListItem TestCase 2 End ++++++++++++++++');
done();
});
......@@ -116,7 +114,6 @@ export default function listItemJsunit() {
console.log('ListItem3‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attrs.editable).assertEqual('EditMode.None')
console.info('++++++++++++++++ ListItem TestCase 3 End ++++++++++++++++');
done();
});
......@@ -138,7 +135,6 @@ export default function listItemJsunit() {
console.log('ListItem4‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attrs.editable).assertEqual('EditMode.Movable')
console.info('++++++++++++++++ ListItem TestCase 4 End ++++++++++++++++');
done();
});
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function listJsunit() {
......@@ -32,7 +32,7 @@ export default function listJsunit() {
describe('listTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/List',
uri: 'MainAbility/pages/List',
}
try {
router.clear();
......@@ -74,10 +74,10 @@ export default function listJsunit() {
console.log('List‘s listDirection is ' + JSON.stringify(obj.$attrs.listDirection))
console.log('List‘s divider is ' + JSON.stringify(obj.$attrs.divider))
console.log('List‘s edgeEffect is ' + JSON.stringify(obj.$attrs.edgeEffect))
expect(obj.$attrs.initialIndex).assertEqual(0.000000.toFixed(6))
expect(obj.$attrs.initialIndex).assertEqual('0')
expect(obj.$attrs.listDirection).assertEqual('Axis.Vertical')
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.None')
expect(obj.$attrs.editMode).assertEqual("false")
expect(obj.$attrs.editMode).assertEqual(false)
console.info('++++++++++++++++ List TestCase 1 End ++++++++++++++++');
done();
});
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function navigatorJsunit() {
......@@ -32,7 +32,7 @@ export default function navigatorJsunit() {
describe('navigatorTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Navigator',
uri: 'MainAbility/pages/Navigator',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function panelJsunit() {
......@@ -33,7 +33,7 @@ export default function panelJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Panel',
uri: 'MainAbility/pages/Panel',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function propJsunit() {
......@@ -33,7 +33,7 @@ export default function propJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Prop',
uri: 'MainAbility/pages/Prop',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function rowJsunit() {
......@@ -32,7 +32,7 @@ export default function rowJsunit() {
describe('rowTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/Row',
uri: 'MainAbility/pages/Row',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function swiperJsunit() {
......@@ -34,7 +34,7 @@ export default function swiperJsunit() {
console.info('afterEach backToIndexPromise ...');
setTimeout(() => {
router.back({
uri: 'pages/index'
uri: 'MainAbility/pages/index'
});
resolve();
}, 500);
......@@ -56,7 +56,7 @@ export default function swiperJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Swiper',
uri: 'MainAbility/pages/Swiper',
}
try {
router.clear();
......@@ -107,7 +107,7 @@ export default function swiperJsunit() {
expect(obj.$attrs.indicator).assertEqual('true')
expect(obj.$attrs.loop).assertEqual('false')
expect(obj.$attrs.vertical).assertEqual('false')
expect(obj.$attrs.duration).assertEqual(1000.000000.toFixed(6))
expect(obj.$attrs.duration).assertEqual("1000")
console.info('++++++++++++++++ Swiper TestCase 1 End +++++++++++++++++');
done();
});
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function tabJsunit() {
......@@ -33,7 +33,7 @@ export default function tabJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Tab',
uri: 'MainAbility/pages/Tab',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function textJsunit() {
......@@ -33,7 +33,7 @@ export default function textJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Text',
uri: 'MainAbility/pages/Text',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function videoJsunit() {
......@@ -33,7 +33,7 @@ export default function videoJsunit() {
beforeEach(async function (done) {
let options = {
uri: 'pages/Video',
uri: 'MainAbility/pages/Video',
}
try {
router.clear();
......
{
"module": {
"name": "phone",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet",
"default",
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"abilities": [{
"name": "com.open.harmony.standardtest.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main",
"icon": "$media:icon",
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
"skills": [{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}]
}]
}
}
......@@ -15,6 +15,34 @@
{
"name": "TestAbility_label",
"value": "label"
},
{
"name": "phone_entry_dsc",
"value": "i am an entry for phone"
},
{
"name": "phone_entry_main",
"value": "the phone entry ability"
},
{
"name": "entry_label",
"value": "ActsContextTest"
},
{
"name": "form_description",
"value": "my form"
},
{
"name": "serviceability_description",
"value": "my whether"
},
{
"name": "description_application",
"value": "demo for test"
},
{
"name": "app_name",
"value": "Demo"
}
]
}
\ No newline at end of file
{
"src": [
"MainAbility/pages/index/index",
"MainAbility/pages/second/second",
"MainAbility/pages/index",
"MainAbility/pages/AlphabetIndexer",
"MainAbility/pages/Grid",
"MainAbility/pages/GridItem",
"MainAbility/pages/List",
"MainAbility/pages/ListItem",
"MainAbility/pages/Navigator",
"MainAbility/pages/Panel",
"MainAbility/pages/Row",
"MainAbility/pages/Swiper",
"MainAbility/pages/Tab",
"MainAbility/pages/Calendar",
"MainAbility/pages/AlertDialog",
"MainAbility/pages/Prop",
"MainAbility/pages/Link",
"MainAbility/pages/AppStorage",
"MainAbility/pages/Video",
"MainAbility/pages/components/Marquee",
"MainAbility/pages/components/Path",
"MainAbility/pages/components/PatternLock",
"MainAbility/pages/components/Polygon",
"MainAbility/pages/components/Polyline",
"MainAbility/pages/components/Rect",
"MainAbility/pages/components/RichText",
"MainAbility/pages/components/Select",
"MainAbility/pages/components/Shape",
"MainAbility/pages/components/Sidebar",
"MainAbility/pages/components/FormComponentPage",
"MainAbility/pages/components/XComponentPage",
"MainAbility/pages/components/WebPage"
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.actsaceetstest",
"vendor": "huawei",
"versionCode": 1000000,
"versionName": "1.0.0",
"debug": false,
"icon": "$media:icon",
"label": "$string:app_name",
"description": "$string:description_application",
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 10,
"targetAPIVersion": 10,
"car": {
"apiCompatibleVersion": 10,
"singleUser": false
}
}
}
\ No newline at end of file
{
"string":[
{
"name":"app_name",
"value":"ohosProject"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2023 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
......@@ -14,25 +14,30 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsThirdTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_third_ets_assets",
":ace_third_ets_resources",
":ace_third_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsThirdTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_third_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_third_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_third_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_third_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_third_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_third_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
......@@ -3,8 +3,8 @@
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.example.actsaceetstest",
"package-name": "com.example.actsaceetstest",
"bundle-name": "com.example.actsaceetstest",
"module-name": "phone",
"shell-timeout": "600000"
},
"kits": [
......
{
"app": {
"bundleName": "com.example.actsaceetstest",
"vendor": "open",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"releaseType": "Release",
"target": 8
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsaceetstest",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"visible": true,
"srcPath": "TestAbility",
"name": ".TestAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"formsEnabled": false,
"label": "$string:TestAbility_label",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/TextArea",
"pages/TextInput",
"pages/Toggle",
"pages/ScrollBar",
"pages/Stepper",
"pages/Navigation"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
globalThis.stageOnCreateRun = 1;
globalThis.stageContext = this.context;
}
}
import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want,launchParam){
// Ability is creating, initialize resources for this ability
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
// Ability is destroying, release resources for this ability
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage)
globalThis.windowStage = windowStage
globalThis.abilityContext = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
onWindowStageDestroy() {
//Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2023 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 '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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')
},
/*
* Copyright (c) 2023 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 Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default class CommonFunc {
static rect_left;
static rect_top;
static rect_right;
static rect_bottom;
static rect_value;
static sleep(time){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
resolve("ok")
},time)
}).then(()=>{
console.info(`sleep ${time} over...`)
})
}
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
return this.rect_value = {
"left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
}
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Callback {
(message:any):void
}
export class MessageManager {
callback:Callback
callbacks:Map<string,Callback> = new Map()
constructor() {
}
registerCallback(callback:Callback , type?:string) {
if (type == undefined) {
console.error('registerCallback callback set')
this.callback = callback
return
}
this.callbacks.set(type,callback)
}
notify(message:any, type?:string) {
if (type == undefined) {
this.callback(message)
return
}
let tmpCallback:Callback = this.callbacks.get(type)
if (tmpCallback === undefined) {
console.error('callbacks has no callback for type ' + type)
return
}
tmpCallback(message)
}
clear() {
this.callbacks.clear()
this.callback = null
}
}
\ No newline at end of file
/*
* Copyright (c) 2023 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 Ability from '@ohos.app.ability.UIAbility'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
console.log('TestAbility onCreate')
}
onDestroy() {
console.log('TestAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('TestAbility onWindowStageCreate')
windowStage.loadContent("TestAbility/pages/index", (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
});
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.log('TestAbility onWindowStageDestroy')
}
onForeground() {
console.log('TestAbility onForeground')
}
onBackground() {
console.log('TestAbility onBackground')
}
};
\ No newline at end of file
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 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
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
import router from '@ohos.router';
@Entry
@Component
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
/*
* Copyright (c) 2023 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
......@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package'
'-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
targetParams = `${targetParams} ${key} ${parameters[key]}`
}
}
return targetParams.trim()
}
async function onAbilityCreateCallback() {
console.log('onAbilityCreateCallback');
console.log("onAbilityCreateCallback");
}
async function addAbilityMonitorCallback(err: any) {
console.info('addAbilityMonitorCallback : ' + JSON.stringify(err))
console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
}
export default class OpenHarmonyTestRunner implements TestRunner {
......@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
}
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
console.info("OpenHarmonyTestRunner OnPrepare ")
}
onRun() {
async onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
var cmd = 'aa start -d 0 -a com.example.actsaceetstest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
......@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
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
};
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function navigationJsunit() {
......@@ -38,7 +38,7 @@ export default function navigationJsunit() {
console.info('[navigationTest] before each called')
await sleep(1)
let options = {
uri: 'pages/Navigation',
uri: 'MainAbility/pages/Navigation',
}
try {
router.clear();
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function scrollbarJsunit() {
......@@ -37,7 +37,7 @@ export default function scrollbarJsunit() {
beforeEach(async function (done) {
console.info('[scrollbarTest] before each called')
let options = {
uri: 'pages/ScrollBar',
uri: 'MainAbility/pages/ScrollBar',
}
try {
let pages = router.getState()
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function stepperJsunit() {
......@@ -49,7 +49,7 @@ export default function stepperJsunit() {
it('testStepper010', 0, async function (done) {
console.info('testStepper010 START');
let options = {
uri: 'pages/Stepper',
uri: 'MainAbility/pages/Stepper',
}
try {
let result = await router.push(options)
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function textAreaJsunit() {
......@@ -37,7 +37,7 @@ export default function textAreaJsunit() {
beforeEach(async function (done) {
console.info('[textAreaTest] before each called')
let options = {
uri: 'pages/TextArea',
uri: 'MainAbility/pages/TextArea',
}
try {
let result = await router.push(options)
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function textInputJsunit() {
......@@ -36,7 +36,7 @@ export default function textInputJsunit() {
beforeEach(async function (done) {
console.info('[textInputTest] before each called')
let options = {
uri: 'pages/TextInput',
uri: 'MainAbility/pages/TextInput',
}
try {
let pages = router.getState()
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2023 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
......@@ -14,7 +14,7 @@
*/
// @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 router from '@system.router';
export default function toggleJsunit() {
......@@ -36,7 +36,7 @@ export default function toggleJsunit() {
beforeEach(async function (done) {
console.info('[toggleTest] before each called')
let options = {
uri: 'pages/Toggle',
uri: 'MainAbility/pages/Toggle',
}
try {
let pages = router.getState()
......@@ -140,7 +140,7 @@ export default function toggleJsunit() {
console.info('testToggle050 START');
let strJson = getInspectorByKey('toggle5');
let obj = JSON.parse(strJson);
console.info("[toggle5] get inspector value is: " + JSON.stringify(obj));
console.info("[toggle5] get inspector value is: " + JSON.stringify(obj.$attrs));
expect(obj.$type).assertEqual('Toggle')
expect(obj.$attrs.type).assertEqual('ToggleType.Button')
expect(obj.$attrs.isOn).assertEqual('false')
......
{
"module": {
"name": "phone",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet",
"default",
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"abilities": [{
"name": "com.example.actsaceetstest.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:phone_entry_main",
"icon": "$media:icon",
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
"skills": [{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}]
}]
}
}
......@@ -15,6 +15,34 @@
{
"name": "TestAbility_label",
"value": "label"
}
},
{
"name": "phone_entry_dsc",
"value": "i am an entry for phone"
},
{
"name": "phone_entry_main",
"value": "the phone entry ability"
},
{
"name": "entry_label",
"value": "ActsContextTest"
},
{
"name": "form_description",
"value": "my form"
},
{
"name": "serviceability_description",
"value": "my whether"
},
{
"name": "description_application",
"value": "demo for test"
},
{
"name": "app_name",
"value": "Demo"
}
]
}
\ No newline at end of file
{
"src": [
"MainAbility/pages/index/index",
"MainAbility/pages/second/second",
"MainAbility/pages/index",
"MainAbility/pages/TextArea",
"MainAbility/pages/TextInput",
"MainAbility/pages/Toggle",
"MainAbility/pages/ScrollBar",
"MainAbility/pages/Stepper",
"MainAbility/pages/Navigation"
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册