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

!8546 【ACE子系统】修改适配测试用例 & 切换模型

Merge pull request !8546 from hekun/master
{
"app": {
"bundleName": "com.open.harmony.acetest",
"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,28 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsComponentTest") {
hap_profile = "./entry/src/main/config.json"
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_component_assets",
":ace_ets_component_resources",
":ace_ets_component_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsComponentTest"
subsystem_name = "arkui"
part_name = "ace_engine"
}
ohos_js_assets("ace_ets_component_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
ohos_app_scope("ace_ets_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_component_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
ohos_js_assets("ace_ets_component_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ace_ets_component_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
{
"description": "Configuration for aceceshi Tests",
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "1200000",
"bundle-name": "com.open.harmony.acetest",
"package-name": "com.open.harmony.acetest",
"shell-timeout": "1200000"
"bundle-name": "com.open.harmony.acetest",
"module-name": "phone",
"shell-timeout": "1200000",
"testcase-timeout": "180000"
},
"kits": [
{
......
{
"app": {
"bundleName": "com.open.harmony.acetest",
"vendor": "open",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"releaseType": "Release",
"target": 8
}
},
"deviceConfig": {},
"module": {
"package": "com.open.harmony.acetest",
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetest.MainAbility",
"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/appear",
"pages/areaChange",
"pages/ellipse",
"pages/enable",
"pages/flex",
"pages/gauge",
"pages/global",
"pages/gridContainer",
"pages/gridSettings",
"pages/imageEffects",
"pages/layoutConstraints",
"pages/list",
"pages/marquee",
"pages/overlay",
"pages/stepper",
"pages/swiper",
"pages/textStyle",
"pages/touchAble",
"pages/touch",
"pages/visibility",
"pages/zIndex"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
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
......
// @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
......
// @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) 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.
* 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
......@@ -12,21 +12,32 @@
* 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'
import router from '@system.router';
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')
},
@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
// @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
......@@ -15,7 +15,7 @@
*/
import events_emitter from '@ohos.events.emitter'
import {MessageManager,Callback} from '../utils/MessageManager';
@Entry
@Component
struct StepperExample {
......@@ -24,6 +24,8 @@ struct StepperExample {
@State secondState: ItemState = ItemState.Normal
@State disabled: ItemState = ItemState.Normal
messageManager:MessageManager = new MessageManager()
build() {
Stepper({
index: this.currentIndex
......@@ -100,6 +102,18 @@ struct StepperExample {
}
onPageShow() {
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == 'index') {
this.currentIndex = message.value
}
}
this.messageManager.registerCallback(callback)
console.info('stepper page show called');
var stateChangeEvent = {
eventId: 202,
......@@ -118,14 +132,22 @@ struct StepperExample {
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventThree, this.stateChangCallBack);
var stateChangeEventFour = {
eventId: 940,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventFour, this.stateChangCallBack);
}
private stateChangCallBack = (eventData) => {
console.info("stepper page stateChangCallBack" + JSON.stringify(eventData));
if (eventData != null) {
console.info("stepper page state change called:" + JSON.stringify(eventData));
if (eventData.data.currentIndex != null) {
this.currentIndex = parseInt(eventData.data.currentIndex);
this.currentIndex = eventData.data.currentIndex;
console.info("stepper page.." + this.currentIndex);
}
if (eventData.data.disabled != null) {
this.disabled = eventData.data.disabled;
......
// @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
......@@ -20,9 +20,9 @@ import events_emitter from '@ohos.events.emitter';
@Component
struct TextStyle {
@State fontColor: Color = Color.Red;
@State fontSize: string = 20;
@State fontSize: number= 20;
@State fontStyle: FontStyle = FontStyle.Italic;
@State fontWeight: string = 700;
@State fontWeight: number = 700;
@State fontFamily: string = 'sans-serif';
build() {
......@@ -30,12 +30,12 @@ struct TextStyle {
Text('default text').fontSize(20)
Text(`text font color ${this.fontColor}`)
.fontColor(this.fontColor)
.fontColor('error')
.fontSize(20)
.key('fontColor')
Text(`text font size ${this.fontSize}`)
.fontSize(this.fontSize)
.fontSize('error')
.key('fontSize')
Text(`text font style ${this.fontStyle}`)
......
// @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) 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.
* 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.
*/
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
......@@ -21,7 +20,6 @@ struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
......
// @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 +21,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 +47,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.acetest.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 +74,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
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function appearJsunit() {
beforeEach(async function (done) {
console.info("appear beforeEach start");
let options = {
uri: 'pages/appear',
uri: 'MainAbility/pages/appear',
}
let result;
try {
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function areaChangeJsunit() {
describe('areaChangeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/areaChange',
uri: 'MainAbility/pages/areaChange',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function columnJsunit() {
beforeEach(async function (done) {
console.info("column beforeEach start");
let options = {
uri: 'pages/column',
uri: 'MainAbility/pages/column',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function ellipseJsunit() {
beforeEach(async function (done) {
console.info("ellipse beforeEach start");
let options = {
uri: 'pages/ellipse',
uri: 'MainAbility/pages/ellipse',
}
try {
router.clear();
......@@ -183,7 +183,7 @@ export default function ellipseJsunit() {
let strJson = getInspectorByKey('ellipse');
let obj = JSON.parse(strJson);
console.info("[testEllipse06] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.height).assertEqual('-40.00px');
expect(obj.$attrs.height).assertEqual('0.00px');
console.info('testEllipse06 END');
done();
});
......@@ -209,7 +209,7 @@ export default function ellipseJsunit() {
let strJson = getInspectorByKey('ellipse');
let obj = JSON.parse(strJson);
console.info("[testEllipse07] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.width).assertEqual('-10.00px');
expect(obj.$attrs.width).assertEqual('0.00px');
console.info('testEllipse07 END');
done();
});
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function enableJsunit() {
beforeEach(async function (done) {
console.info("enable beforeEach start");
let options = {
uri: 'pages/enable',
uri: 'MainAbility/pages/enable',
}
try {
router.clear();
......@@ -104,7 +104,7 @@ export default function enableJsunit() {
let strJson = getInspectorByKey('enabled');
let obj = JSON.parse(strJson);
console.info("[testEnable03] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.enabled).assertEqual(true);
expect(obj.$attrs.enabled).assertEqual(false);
console.info('testEnable03 END');
done();
});
......@@ -130,7 +130,7 @@ export default function enableJsunit() {
let strJsonNew = getInspectorByKey('enabled');
let objNew = JSON.parse(strJsonNew);
console.info("testEnable04 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.enabled).assertEqual(true);
expect(objNew.$attrs.enabled).assertEqual(false);
done();
});
})
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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 '@ohos.events.emitter';
import Utils from './Utils.ets';
import router from '@system.router';
......@@ -23,7 +23,7 @@ export default function flexJsunit() {
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/flex',
uri: 'MainAbility/pages/flex',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -21,7 +21,7 @@ export default function gaugeJsunit() {
describe('gaugeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/gauge',
uri: 'MainAbility/pages/gauge',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function globalJsunit() {
beforeEach(async function (done) {
console.info("global beforeEach start");
let options = {
uri: 'pages/global',
uri: 'MainAbility/pages/global',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function girdContainerJsunit() {
beforeEach(async function (done) {
console.info("girdContainer beforeEach start");
let options = {
uri: 'pages/gridContainer',
uri: 'MainAbility/pages/gridContainer',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function gridSettingsJsunit() {
describe('gridSettingsTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/gridSettings',
uri: 'MainAbility/pages/gridSettings',
}
try {
router.clear();
......@@ -117,7 +117,7 @@ export default function gridSettingsJsunit() {
console.info("[testGridSettings003] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testGridSettings003] gridRow useSizeType: " + JSON.stringify(obj.$attrs.useSizeType));
expect(obj.$attrs.useSizeType.sm.span).assertEqual(-2147483648);
expect(obj.$attrs.useSizeType.sm.span).assertEqual(1);
expect(obj.$attrs.useSizeType.sm.offset).assertEqual(-2147483648);
done();
});
......@@ -352,7 +352,7 @@ export default function gridSettingsJsunit() {
console.info("[testGridSettings013] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testGridSettings013] gridSpan: " + JSON.stringify(obj.$attrs.gridSpan));
expect(obj.$attrs.gridSpan).assertEqual(-2147483648);
expect(obj.$attrs.gridSpan).assertEqual(2);
done();
});
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function imageEffectsJsunit() {
describe('imageEffectsTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/imageEffects',
uri: 'MainAbility/pages/imageEffects',
}
try {
router.clear();
......@@ -140,7 +140,7 @@ export default function imageEffectsJsunit() {
try {
var eventData = {
data: {
"blurValue": 'error'
"blurValue": '0'
}
}
var innerEvent = {
......@@ -889,10 +889,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects036] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#32000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultXS");
done();
});
......@@ -919,10 +916,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects037] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#0B000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultSM");
done();
});
......@@ -949,10 +943,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects038] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#28000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("60.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultMD");
done();
});
......@@ -979,10 +970,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects039] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#26000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("10.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultLG");
done();
});
......@@ -1009,10 +997,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects040] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#15000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("50.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingSM");
done();
});
......@@ -1039,10 +1024,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects041] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000");
expect(objNew.$attrs.shadow.color).assertEqual("#31000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("30.000000");
expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingMD");
done();
});
})
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function layoutConstraintsJsunit() {
beforeEach(async function (done) {
console.info("layoutConstraints beforeEach start");
let options = {
uri: 'pages/layoutConstraints',
uri: 'MainAbility/pages/layoutConstraints',
}
try {
router.clear();
......@@ -116,7 +116,7 @@ export default function layoutConstraintsJsunit() {
console.info("[testLayoutConstraints004] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testLayoutConstraints004] displayPriority: " + obj.$attrs.displayPriority);
expect(obj.$attrs.displayPriority).assertEqual(5);
expect(obj.$attrs.displayPriority).assertEqual(1);
done();
});
......@@ -142,7 +142,7 @@ export default function layoutConstraintsJsunit() {
console.info("[testLayoutConstraints005] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testLayoutConstraints005] aspectRatio: " + obj.$attrs.aspectRatio);
expect(obj.$attrs.aspectRatio).assertEqual(-4);
expect(obj.$attrs.aspectRatio).assertEqual(1);
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
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function listJsunit() {
beforeEach(async function (done) {
console.info("list beforeEach start");
let options = {
uri: 'pages/list',
uri: 'MainAbility/pages/list',
}
try {
router.clear();
......@@ -52,9 +52,9 @@ export default function listJsunit() {
let obj = JSON.parse(strJson);
console.info("[testList01] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.listDirection).assertEqual('Axis.Vertical');
expect(obj.$attrs.editMode).assertEqual('false');
expect(obj.$attrs.editMode).assertFalse();
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.None');
expect(obj.$attrs.chainAnimation).assertEqual('false');
expect(obj.$attrs.chainAnimation).assertFalse();
expect(obj.$attrs.divider.strokeWidth).assertEqual("2.00vp");
expect(obj.$attrs.divider.color).assertEqual("#FFFFFFFF");
expect(obj.$attrs.divider.startMargin).assertEqual("20.00vp");
......@@ -110,7 +110,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[testList03] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true');
expect(obj.$attrs.editMode).assertTrue();
console.info('testList03 END');
done();
});
......@@ -162,7 +162,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[testList05] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.chainAnimation).assertEqual('true');
expect(obj.$attrs.chainAnimation).assertTrue();
console.info('testList05 END');
done();
});
......@@ -292,7 +292,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[testList10] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true');
expect(obj.$attrs.editMode).assertTrue();
console.info('testList10 END');
done();
});
......@@ -318,7 +318,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[testList11] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true');
expect(obj.$attrs.editMode).assertTrue();
console.info('testList11 END');
done();
});
......@@ -344,7 +344,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[testList12] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.chainAnimation).assertEqual('true');
expect(obj.$attrs.chainAnimation).assertTrue();
console.info('testList12 END');
done();
});
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter';
......@@ -22,7 +22,7 @@ export default function marqueeJsunit() {
describe('marqueeTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/marquee',
uri: 'MainAbility/pages/marquee',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function overLayJsunit() {
beforeEach(async function (done) {
console.info("overlay beforeEach start");
let options = {
uri: 'pages/overlay',
uri: 'MainAbility/pages/overlay',
}
try {
router.clear();
......
// @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,16 +13,18 @@
* See the License for the specific language governing permissions and
* 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';
import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter';
import CommonFunc from '../MainAbility/utils/Common';
import {MessageManager,Callback} from '../MainAbility/utils/MessageManager';
export default function stepperJsunit() {
describe('stepperTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/stepper',
uri: 'MainAbility/pages/stepper',
}
try {
router.clear();
......@@ -44,6 +46,7 @@ export default function stepperJsunit() {
await Utils.sleep(1000);
console.info("stepper after each called");
});
it('stepperTest_0100', 0, async function (done) {
console.info('stepperTest_0100 START');
......@@ -67,7 +70,7 @@ export default function stepperJsunit() {
try {
let eventData = {
data: {
"currentIndex": "1",
"currentIndex": 1,
}
}
let indexEvent = {
......@@ -87,6 +90,59 @@ export default function stepperJsunit() {
console.info('stepperTest_0200 END');
done();
});
it('stepperTest_0400', 0, async function (done) {
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'index',value:-558038585})
await CommonFunc.sleep(2000);
let strJsonNew = getInspectorByKey('stepper');
let objNew = JSON.parse(strJsonNew);
console.info("stepperTest_0400 component objNew is: " + objNew.$attrs.index);
expect(objNew.$attrs.index).assertEqual('-558038585');
console.info('stepperTest_0400 END');
done();
//console.info('stepperTest_0400 START');
//let strJson = getInspectorByKey('stepper');
//console.info("stepperTest_0400 component strJson:" + strJson);
//let obj = JSON.parse(strJson);
//console.info("stepperTest_0400 component obj is: " + JSON.stringify(obj));
// try {
// let eventData = {
// data: {
// "currentIndex": -558038585,
// }
// }
// let indexEvent = {
// eventId: 940,
// priority: events_emitter.EventPriority.LOW
// }
//console.info("stepperTest_0400 start to publish emit");
// events_emitter.emit(indexEvent, eventData);
// } catch (err) {
// console.log("stepperTest_0400 change component data error: " + err.message);
//}
// await Utils.sleep(3000);
//let strJsonNew = getInspectorByKey('stepper');
//let objNew = JSON.parse(strJsonNew);
// console.info("stepperTest_0400 component objNew is: " + JSON.stringify(objNew));
//expect(objNew.$attrs.index).assertEqual('-558038585');
//console.info('stepperTest_0400 END');
//done();
});
it('stepperTest_0500', 0, async function (done) {
console.info('[stepperTest_0500] START');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'index',value:-10})
await CommonFunc.sleep(2000);
let strJsonNew = getInspectorByKey('stepper');
let objNew = JSON.parse(strJsonNew);
console.info("stepperTest_0500 component objNew is: " + objNew.$attrs.index);
expect(objNew.$attrs.index).assertEqual('-10');
console.info('stepperTest_0400 END');
done();
});
it('stepperTest_0300', 0, async function (done) {
console.info('stepperTest_0300v START');
......@@ -97,7 +153,7 @@ export default function stepperJsunit() {
try {
let eventData = {
data: {
"currentIndex": "11111111",
"currentIndex": 11111111,
}
}
let indexEvent = {
......@@ -118,60 +174,5 @@ export default function stepperJsunit() {
done();
});
it('stepperTest_0400', 0, async function (done) {
console.info('stepperTest_0400 START');
let strJson = getInspectorByKey('stepper');
console.info("stepperTest_0400 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("stepperTest_0400 component obj is: " + JSON.stringify(obj));
try {
let eventData = {
data: {
"currentIndex": "-558038585",
}
}
let indexEvent = {
eventId: 909,
priority: events_emitter.EventPriority.LOW
}
console.info("stepperTest_0400 start to publish emit");
events_emitter.emit(indexEvent, eventData);
} catch (err) {
console.log("stepperTest_0400 change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJsonNew = getInspectorByKey('stepper');
let objNew = JSON.parse(strJsonNew);
console.info("stepperTest_0400 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.index).assertEqual('-558038585');
console.info('stepperTest_0400 END');
done();
});
it('stepperTest_0500', 0, async function (done) {
console.info('[stepperTest_0500] START');
try {
var eventData = {
data: {
"currentIndex": '-10'
}
}
var innerEvent = {
eventId: 910,
priority: events_emitter.EventPriority.LOW
}
console.info("[stepperTest_0500] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[stepperTest_0500] change component data error: " + err.message);
}
await Utils.sleep(1000);
let strJson = getInspectorByKey('stepper');
let obj = JSON.parse(strJson);
console.info("[stepperTest_0500] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.index).assertEqual('-10');
console.info('stepperTest_0500 END');
done();
});
})
}
\ 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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter';
......@@ -22,7 +22,7 @@ export default function swiperJsunit() {
describe('swiperTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/swiper',
uri: 'MainAbility/pages/swiper',
}
try {
router.clear();
......@@ -64,8 +64,9 @@ export default function swiperJsunit() {
console.info("swiperTest_0200 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.indicator).assertEqual('true');
expect(obj.$attrs.loop).assertEqual('false');
let assertObjet = obj.$attrs.indicator;
expect(assertObjet).assertTrue();
expect(obj.$attrs.loop).assertFalse();
console.info('swiperTest_0200 END');
done();
});
......@@ -76,7 +77,7 @@ export default function swiperJsunit() {
console.info("swiperTest_0300 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("swiperTest_0300 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.duration).assertEqual('1000.000000');
expect(obj.$attrs.duration).assertEqual('1000');
expect(obj.$attrs.vertical).assertEqual('false');
console.info('swiperTest_0300 END');
done();
......@@ -337,7 +338,8 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.indicator).assertEqual('false');
let assertObjet = obj.$attrs.indicator;
expect(assertObjet).assertTrue();
console.info('swiperTest_1400 END');
done();
});
......@@ -363,7 +365,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1500 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.duration).assertEqual('500.000000');
expect(objNew.$attrs.duration).assertEqual('500');
console.info('swiperTest_1500 END');
done();
});
......@@ -467,7 +469,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1900 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.duration).assertEqual('0.000000');
expect(objNew.$attrs.duration).assertEqual('0');
console.info('swiperTest_1900 END');
done();
});
......@@ -493,7 +495,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_2000 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.duration).assertEqual('400.000000');
expect(objNew.$attrs.duration).assertEqual('400');
console.info('swiperTest_2000 END');
done();
});
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function textStyleJsunit() {
describe('textStyleTest', function () {
beforeEach(async function (done) {
let options = {
uri: 'pages/textStyle',
uri: 'MainAbility/pages/textStyle',
}
try {
router.clear();
......@@ -52,7 +52,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle001] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle001] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#FFFF0000');
expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done();
});
......@@ -78,7 +78,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle002] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle002] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#FF0000FF');
expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done();
});
......@@ -104,7 +104,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle003] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle003] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#80000000');
expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done();
});
......@@ -130,7 +130,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle004] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle004] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#7FFFFFFF');
expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done();
});
......@@ -151,7 +151,7 @@ export default function textStyleJsunit() {
} catch (err) {
console.log("[testTextStyle005] change component data error: " + err.message);
}
await Utils.sleep(3000);
await Utils.sleep(4000);
let strJson = getInspectorByKey('fontColor');
console.info("[testTextStyle005] component strJson:" + strJson);
let obj = JSON.parse(strJson);
......@@ -167,7 +167,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle006] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle006] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('20.00fp');
expect(obj.$attrs.fontSize).assertEqual('0.00px');
done();
});
......@@ -193,7 +193,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle007] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle007] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('30.00fp');
expect(obj.$attrs.fontSize).assertEqual('0.00px');
done();
});
......@@ -219,7 +219,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle008] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle008] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('16.00fp');
expect(obj.$attrs.fontSize).assertEqual('0.00px');
done();
});
......@@ -245,7 +245,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle009] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle009] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('0.00fp');
expect(obj.$attrs.fontSize).assertEqual('0.00px');
done();
});
......@@ -271,7 +271,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle010] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testTextStyle010] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('2147483647.00fp');
expect(obj.$attrs.fontSize).assertEqual('0.00px');
done();
});
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter';
......@@ -23,7 +23,7 @@ export default function touchAbleJsunit() {
beforeEach(async function (done) {
console.info("touchAble beforeEach start");
let options = {
uri: 'pages/touchAble',
uri: 'MainAbility/pages/touchAble',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function touchJsunit() {
beforeEach(async function (done) {
console.info("touch beforeEach start");
let options = {
uri: 'pages/touch',
uri: 'MainAbility/pages/touch',
}
let result;
try {
......
// @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
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -23,7 +23,7 @@ export default function visibilityJsunit() {
beforeEach(async function (done) {
console.info("visibility beforeEach start");
let options = {
uri: 'pages/visibility',
uri: 'MainAbility/pages/visibility',
}
try {
router.clear();
......
// @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 +13,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
......@@ -22,7 +22,7 @@ export default function zIndexJsunit() {
beforeEach(async function (done) {
console.info("zIndex beforeEach start");
let options = {
uri: 'pages/zIndex',
uri: 'MainAbility/pages/zIndex',
}
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",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"abilities": [{
"name": "com.open.harmony.acetest.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"
]
}]
}]
}
}
\ No newline at end of file
......@@ -27,6 +27,34 @@
{
"name":"message_arrive",
"value":"We will arrive at %s."
}
},
{
"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/appear",
"MainAbility/pages/second/second",
"MainAbility/pages/index/index",
"MainAbility/pages/areaChange",
"MainAbility/pages/ellipse",
"MainAbility/pages/enable",
"MainAbility/pages/flex",
"MainAbility/pages/gauge",
"MainAbility/pages/global",
"MainAbility/pages/gridContainer",
"MainAbility/pages/gridSettings",
"MainAbility/pages/imageEffects",
"MainAbility/pages/layoutConstraints",
"MainAbility/pages/list",
"MainAbility/pages/marquee",
"MainAbility/pages/overlay",
"MainAbility/pages/stepper",
"MainAbility/pages/swiper",
"MainAbility/pages/textStyle",
"MainAbility/pages/touchAble",
"MainAbility/pages/touch",
"MainAbility/pages/visibility",
"MainAbility/pages/zIndex"
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.open.harmony.aceEtsApiLack",
"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,28 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsApiLackTest") {
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 = "ActsAceEtsApiLackTest"
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_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
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_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
{
"description": "Configuration for aceEtsApiLack Tests",
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"test-timeout": "180000",
"bundle-name": "com.open.harmony.aceEtsApiLack",
"package-name": "com.open.harmony.aceEtsApiLack",
"shell-timeout": "600000"
"module-name": "phone",
"shell-timeout": "600000",
"testcase-timeout": "180000"
},
"kits": [
{
"test-file-name": [
......
{
"app": {
"bundleName": "com.open.harmony.aceEtsApiLack",
"vendor": "open",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"releaseType": "Release",
"target": 8
}
},
"deviceConfig": {},
"module": {
"package": "com.open.harmony.aceEtsApiLack",
"name": ".MyApplication",
"mainAbility": "com.open.harmony.aceEtsApiLack.MainAbility",
"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/abilityComponent",
"pages/alphabetIndexer",
"pages/checkBoxGroup",
"pages/circle",
"pages/common",
"pages/common_ts_ets_api",
"pages/curves",
"pages/dom",
"pages/ellipse",
"pages/featureAbility",
"pages/focusControl",
"pages/form_component",
"pages/gauge",
"pages/global",
"pages/grid",
"pages/grid_col",
"pages/grid_row",
"pages/gridItem",
"pages/image",
"pages/inspector",
"pages/lazyForEach",
"pages/line",
"pages/list",
"pages/list_item",
"pages/mediaQuery",
"pages/navigator",
"pages/onVisibleAreaChange",
"pages/page1",
"pages/pageRoute",
"pages/page_transition",
"pages/panel",
"pages/path",
"pages/pluginComponent",
"pages/polygon",
"pages/polyLine",
"pages/progress",
"pages/prompt",
"pages/rect",
"pages/router",
"pages/scroll",
"pages/search",
"pages/select",
"pages/shape",
"pages/sideBar",
"pages/stack",
"pages/stateManagement",
"pages/swiper",
"pages/tabs",
"pages/text",
"pages/textArea",
"pages/textInput",
"pages/textPicker",
"pages/uiAppearance",
"pages/video",
"pages/web",
"pages/xcomponent"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
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) 2022 Shenzhen Kaihong Digital Industry Development 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
......
// @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
......
// @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) 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.
/*
* 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,21 +12,32 @@
* 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'
import router from '@system.router';
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')
},
@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
// @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) 2022 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 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
......@@ -21,7 +20,6 @@ struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
......
// @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.aceEtsApiLack.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
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* 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';
import events_emitter from '@ohos.events.emitter'
import Utils from './Utils';
......@@ -22,7 +22,7 @@ export default function focusControlJsunit() {
beforeEach(async function (done) {
console.info("focusControlTest beforeEach start");
let options = {
uri: 'pages/focusControl',
uri: 'MainAbility/pages/focusControl',
}
let result;
try {
......
/**
* 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
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册