提交 52006416 编写于 作者: H hekun

submit the code 2

Signed-off-by: Nhekun <hekun18@huawei.com>
上级 ad1fa9eb
{
"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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -14,25 +14,28 @@ ...@@ -14,25 +14,28 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsComponentTest") { ohos_js_hap_suite("ActsAceEtsComponentTest") {
hap_profile = "./entry/src/main/config.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [ deps = [
":ace_ets_component_assets", ":ace_ets_component_assets",
":ace_ets_component_resources", ":ace_ets_component_resources",
":ace_ets_component_test_assets",
] ]
ets2abc = true ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsComponentTest" hap_name = "ActsAceEtsComponentTest"
subsystem_name = "arkui" subsystem_name = "arkui"
part_name = "ace_engine" 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") { ohos_js_assets("ace_ets_component_assets") {
source_dir = "./entry/src/main/ets/TestAbility" source_dir = "entry/src/main/ets"
} }
ohos_resources("ace_ets_component_resources") { ohos_resources("ace_ets_component_resources") {
sources = [ "./entry/src/main/resources" ] sources = [ "entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json" deps = [ ":ace_ets_app_profile" ]
hap_profile = "entry/src/main/module.json"
} }
{ {
"description": "Configuration for aceceshi Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "1200000", "test-timeout": "1200000",
"bundle-name": "com.open.harmony.acetest", "bundle-name": "com.open.harmony.acetest",
"package-name": "com.open.harmony.acetest", "module-name": "phone",
"shell-timeout": "1200000" "shell-timeout": "1200000",
"testcase-timeout": "180000"
}, },
"kits": [ "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 // @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* 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 // @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/** /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,21 +12,32 @@ ...@@ -12,21 +12,32 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import router from '@system.router';
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default { @Entry
onCreate() { @Component
console.info('Application onCreate') struct Second {
var abilityDelegator: any private content: string = "Second Page"
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any build() {
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
console.info('start run testcase!!!') Text(`${this.content}`)
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) .fontSize(50)
}, .fontWeight(FontWeight.Bold)
onDestroy() { Button() {
console.info('Application onDestroy') 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -118,14 +118,22 @@ struct StepperExample { ...@@ -118,14 +118,22 @@ struct StepperExample {
priority: events_emitter.EventPriority.LOW priority: events_emitter.EventPriority.LOW
} }
events_emitter.on(stateChangeEventThree, this.stateChangCallBack); events_emitter.on(stateChangeEventThree, this.stateChangCallBack);
var stateChangeEventThree = {
eventId: 940,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEventThree, this.stateChangCallBack);
} }
private stateChangCallBack = (eventData) => { private stateChangCallBack = (eventData) => {
console.info("stepper page stateChangCallBack" + JSON.stringify(eventData)); console.info("stepper page stateChangCallBack" + JSON.stringify(eventData));
if (eventData != null) { if (eventData != null) {
console.info("stepper page state change called:" + JSON.stringify(eventData)); console.info("stepper page state change called:" + JSON.stringify(eventData));
if (eventData.data.currentIndex != null) { 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) { if (eventData.data.disabled != null) {
this.disabled = eventData.data.disabled; this.disabled = eventData.data.disabled;
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -20,9 +20,9 @@ import events_emitter from '@ohos.events.emitter'; ...@@ -20,9 +20,9 @@ import events_emitter from '@ohos.events.emitter';
@Component @Component
struct TextStyle { struct TextStyle {
@State fontColor: Color = Color.Red; @State fontColor: Color = Color.Red;
@State fontSize: string = 20; @State fontSize: number= 20;
@State fontStyle: FontStyle = FontStyle.Italic; @State fontStyle: FontStyle = FontStyle.Italic;
@State fontWeight: string = 700; @State fontWeight: number = 700;
@State fontFamily: string = 'sans-serif'; @State fontFamily: string = 'sans-serif';
build() { build() {
...@@ -30,12 +30,12 @@ struct TextStyle { ...@@ -30,12 +30,12 @@ struct TextStyle {
Text('default text').fontSize(20) Text('default text').fontSize(20)
Text(`text font color ${this.fontColor}`) Text(`text font color ${this.fontColor}`)
.fontColor(this.fontColor) .fontColor('error')
.fontSize(20) .fontSize(20)
.key('fontColor') .key('fontColor')
Text(`text font size ${this.fontSize}`) Text(`text font size ${this.fontSize}`)
.fontSize(this.fontSize) .fontSize('error')
.key('fontSize') .key('fontSize')
Text(`text font style ${this.fontStyle}`) Text(`text font style ${this.fontStyle}`)
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* 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) 2023 Huawei Device Co., Ltd.
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +12,7 @@ ...@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router'; import router from '@ohos.router';
@Entry @Entry
@Component @Component
...@@ -21,7 +20,6 @@ struct Index { ...@@ -21,7 +20,6 @@ struct Index {
aboutToAppear() { aboutToAppear() {
console.info('TestAbility index aboutToAppear') console.info('TestAbility index aboutToAppear')
} }
@State message: string = 'Hello World' @State message: string = 'Hello World'
build() { build() {
Row() { Row() {
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -21,25 +21,25 @@ var abilityDelegatorArguments = undefined ...@@ -21,25 +21,25 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) { function translateParamsToString(parameters) {
const keySet = new Set([ 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 level', '-s testType', '-s size', '-s timeout',
'-s package' '-s dryRun'
]) ])
let targetParams = ''; let targetParams = '';
for (const key in parameters) { for (const key in parameters) {
if (keySet.has(key)) { if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key] targetParams = `${targetParams} ${key} ${parameters[key]}`
} }
} }
return targetParams.trim() return targetParams.trim()
} }
async function onAbilityCreateCallback() { async function onAbilityCreateCallback() {
console.log('onAbilityCreateCallback'); console.log("onAbilityCreateCallback");
} }
async function addAbilityMonitorCallback(err: any) { async function addAbilityMonitorCallback(err: any) {
console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
} }
export default class OpenHarmonyTestRunner implements TestRunner { export default class OpenHarmonyTestRunner implements TestRunner {
...@@ -47,22 +47,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -47,22 +47,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
} }
onPrepare() { onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare') console.info("OpenHarmonyTestRunner OnPrepare ")
} }
onRun() { async onRun() {
console.log('OpenHarmonyTestRunner onRun run') console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = { let lMonitor = {
abilityName: testAbilityName, abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) 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) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd) console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => { (err: any, d: any) => {
...@@ -70,9 +74,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -70,9 +74,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.stdResult);
console.info('executeShellCommand : data : ' + d.exitCode); 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') console.info('OpenHarmonyTestRunner onRun end')
} }
}; };
\ No newline at end of file
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function appearJsunit() { ...@@ -23,7 +23,7 @@ export default function appearJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("appear beforeEach start"); console.info("appear beforeEach start");
let options = { let options = {
uri: 'pages/appear', uri: 'MainAbility/pages/appear',
} }
let result; let result;
try { try {
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function areaChangeJsunit() { ...@@ -22,7 +22,7 @@ export default function areaChangeJsunit() {
describe('areaChangeTest', function () { describe('areaChangeTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/areaChange', uri: 'MainAbility/pages/areaChange',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium";
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function columnJsunit() { ...@@ -23,7 +23,7 @@ export default function columnJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("column beforeEach start"); console.info("column beforeEach start");
let options = { let options = {
uri: 'pages/column', uri: 'MainAbility/pages/column',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium";
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function ellipseJsunit() { ...@@ -23,7 +23,7 @@ export default function ellipseJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("ellipse beforeEach start"); console.info("ellipse beforeEach start");
let options = { let options = {
uri: 'pages/ellipse', uri: 'MainAbility/pages/ellipse',
} }
try { try {
router.clear(); router.clear();
...@@ -183,7 +183,7 @@ export default function ellipseJsunit() { ...@@ -183,7 +183,7 @@ export default function ellipseJsunit() {
let strJson = getInspectorByKey('ellipse'); let strJson = getInspectorByKey('ellipse');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testEllipse06] obj is: " + JSON.stringify(obj)); 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'); console.info('testEllipse06 END');
done(); done();
}); });
...@@ -209,7 +209,7 @@ export default function ellipseJsunit() { ...@@ -209,7 +209,7 @@ export default function ellipseJsunit() {
let strJson = getInspectorByKey('ellipse'); let strJson = getInspectorByKey('ellipse');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testEllipse07] obj is: " + JSON.stringify(obj)); 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'); console.info('testEllipse07 END');
done(); done();
}); });
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function enableJsunit() { ...@@ -22,7 +22,7 @@ export default function enableJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("enable beforeEach start"); console.info("enable beforeEach start");
let options = { let options = {
uri: 'pages/enable', uri: 'MainAbility/pages/enable',
} }
try { try {
router.clear(); router.clear();
...@@ -104,7 +104,7 @@ export default function enableJsunit() { ...@@ -104,7 +104,7 @@ export default function enableJsunit() {
let strJson = getInspectorByKey('enabled'); let strJson = getInspectorByKey('enabled');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testEnable03] obj is: " + JSON.stringify(obj)); console.info("[testEnable03] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.enabled).assertEqual(true); expect(obj.$attrs.enabled).assertEqual(false);
console.info('testEnable03 END'); console.info('testEnable03 END');
done(); done();
}); });
...@@ -130,7 +130,7 @@ export default function enableJsunit() { ...@@ -130,7 +130,7 @@ export default function enableJsunit() {
let strJsonNew = getInspectorByKey('enabled'); let strJsonNew = getInspectorByKey('enabled');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("testEnable04 component objNew is: " + JSON.stringify(objNew)); console.info("testEnable04 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.enabled).assertEqual(true); expect(objNew.$attrs.enabled).assertEqual(false);
done(); done();
}); });
}) })
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@ohos.events.emitter'; import router from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
import router from '@system.router'; import router from '@system.router';
...@@ -23,7 +23,7 @@ export default function flexJsunit() { ...@@ -23,7 +23,7 @@ export default function flexJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("flex beforeEach start"); console.info("flex beforeEach start");
let options = { let options = {
uri: 'pages/flex', uri: 'MainAbility/pages/flex',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium";
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -21,7 +21,7 @@ export default function gaugeJsunit() { ...@@ -21,7 +21,7 @@ export default function gaugeJsunit() {
describe('gaugeTest', function () { describe('gaugeTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/gauge', uri: 'MainAbility/pages/gauge',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function globalJsunit() { ...@@ -22,7 +22,7 @@ export default function globalJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("global beforeEach start"); console.info("global beforeEach start");
let options = { let options = {
uri: 'pages/global', uri: 'MainAbility/pages/global',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function girdContainerJsunit() { ...@@ -23,7 +23,7 @@ export default function girdContainerJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("girdContainer beforeEach start"); console.info("girdContainer beforeEach start");
let options = { let options = {
uri: 'pages/gridContainer', uri: 'MainAbility/pages/gridContainer',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function gridSettingsJsunit() { ...@@ -22,7 +22,7 @@ export default function gridSettingsJsunit() {
describe('gridSettingsTest', function () { describe('gridSettingsTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/gridSettings', uri: 'MainAbility/pages/gridSettings',
} }
try { try {
router.clear(); router.clear();
...@@ -117,7 +117,7 @@ export default function gridSettingsJsunit() { ...@@ -117,7 +117,7 @@ export default function gridSettingsJsunit() {
console.info("[testGridSettings003] component strJson:" + strJson); console.info("[testGridSettings003] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testGridSettings003] gridRow useSizeType: " + JSON.stringify(obj.$attrs.useSizeType)); 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); expect(obj.$attrs.useSizeType.sm.offset).assertEqual(-2147483648);
done(); done();
}); });
...@@ -352,7 +352,7 @@ export default function gridSettingsJsunit() { ...@@ -352,7 +352,7 @@ export default function gridSettingsJsunit() {
console.info("[testGridSettings013] component strJson:" + strJson); console.info("[testGridSettings013] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testGridSettings013] gridSpan: " + JSON.stringify(obj.$attrs.gridSpan)); console.info("[testGridSettings013] gridSpan: " + JSON.stringify(obj.$attrs.gridSpan));
expect(obj.$attrs.gridSpan).assertEqual(-2147483648); expect(obj.$attrs.gridSpan).assertEqual(2);
done(); done();
}); });
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function imageEffectsJsunit() { ...@@ -22,7 +22,7 @@ export default function imageEffectsJsunit() {
describe('imageEffectsTest', function () { describe('imageEffectsTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/imageEffects', uri: 'MainAbility/pages/imageEffects',
} }
try { try {
router.clear(); router.clear();
...@@ -140,7 +140,7 @@ export default function imageEffectsJsunit() { ...@@ -140,7 +140,7 @@ export default function imageEffectsJsunit() {
try { try {
var eventData = { var eventData = {
data: { data: {
"blurValue": 'error' "blurValue": '0'
} }
} }
var innerEvent = { var innerEvent = {
...@@ -889,10 +889,7 @@ export default function imageEffectsJsunit() { ...@@ -889,10 +889,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects036] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects036] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultXS");
expect(objNew.$attrs.shadow.color).assertEqual("#32000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000");
done(); done();
}); });
...@@ -919,10 +916,7 @@ export default function imageEffectsJsunit() { ...@@ -919,10 +916,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects037] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects037] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultSM");
expect(objNew.$attrs.shadow.color).assertEqual("#0B000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000");
done(); done();
}); });
...@@ -949,10 +943,7 @@ export default function imageEffectsJsunit() { ...@@ -949,10 +943,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects038] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects038] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultMD");
expect(objNew.$attrs.shadow.color).assertEqual("#28000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("60.000000");
done(); done();
}); });
...@@ -979,10 +970,7 @@ export default function imageEffectsJsunit() { ...@@ -979,10 +970,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects039] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects039] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultLG");
expect(objNew.$attrs.shadow.color).assertEqual("#26000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("10.000000");
done(); done();
}); });
...@@ -1009,10 +997,7 @@ export default function imageEffectsJsunit() { ...@@ -1009,10 +997,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects040] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects040] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingSM");
expect(objNew.$attrs.shadow.color).assertEqual("#15000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("50.000000");
done(); done();
}); });
...@@ -1039,10 +1024,7 @@ export default function imageEffectsJsunit() { ...@@ -1039,10 +1024,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let strJsonNew = getInspectorByKey('shadowDefaultShadow');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects041] component objNew is: " + JSON.stringify(objNew)); console.info("[testImageEffects041] component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingMD");
expect(objNew.$attrs.shadow.color).assertEqual("#31000000");
expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000");
expect(objNew.$attrs.shadow.offsetY).assertEqual("30.000000");
done(); done();
}); });
}) })
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function layoutConstraintsJsunit() { ...@@ -23,7 +23,7 @@ export default function layoutConstraintsJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("layoutConstraints beforeEach start"); console.info("layoutConstraints beforeEach start");
let options = { let options = {
uri: 'pages/layoutConstraints', uri: 'MainAbility/pages/layoutConstraints',
} }
try { try {
router.clear(); router.clear();
...@@ -116,7 +116,7 @@ export default function layoutConstraintsJsunit() { ...@@ -116,7 +116,7 @@ export default function layoutConstraintsJsunit() {
console.info("[testLayoutConstraints004] component strJson:" + strJson); console.info("[testLayoutConstraints004] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testLayoutConstraints004] displayPriority: " + obj.$attrs.displayPriority); console.info("[testLayoutConstraints004] displayPriority: " + obj.$attrs.displayPriority);
expect(obj.$attrs.displayPriority).assertEqual(5); expect(obj.$attrs.displayPriority).assertEqual(1);
done(); done();
}); });
...@@ -142,7 +142,7 @@ export default function layoutConstraintsJsunit() { ...@@ -142,7 +142,7 @@ export default function layoutConstraintsJsunit() {
console.info("[testLayoutConstraints005] component strJson:" + strJson); console.info("[testLayoutConstraints005] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testLayoutConstraints005] aspectRatio: " + obj.$attrs.aspectRatio); console.info("[testLayoutConstraints005] aspectRatio: " + obj.$attrs.aspectRatio);
expect(obj.$attrs.aspectRatio).assertEqual(-4); expect(obj.$attrs.aspectRatio).assertEqual(1);
done(); 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium";
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function listJsunit() { ...@@ -22,7 +22,7 @@ export default function listJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("list beforeEach start"); console.info("list beforeEach start");
let options = { let options = {
uri: 'pages/list', uri: 'MainAbility/pages/list',
} }
try { try {
router.clear(); router.clear();
...@@ -52,9 +52,9 @@ export default function listJsunit() { ...@@ -52,9 +52,9 @@ export default function listJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList01] obj is: " + JSON.stringify(obj)); console.info("[testList01] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.listDirection).assertEqual('Axis.Vertical'); 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.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.strokeWidth).assertEqual("2.00vp");
expect(obj.$attrs.divider.color).assertEqual("#FFFFFFFF"); expect(obj.$attrs.divider.color).assertEqual("#FFFFFFFF");
expect(obj.$attrs.divider.startMargin).assertEqual("20.00vp"); expect(obj.$attrs.divider.startMargin).assertEqual("20.00vp");
...@@ -110,7 +110,7 @@ export default function listJsunit() { ...@@ -110,7 +110,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list'); let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList03] obj is: " + JSON.stringify(obj)); console.info("[testList03] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true'); expect(obj.$attrs.editMode).assertTrue();
console.info('testList03 END'); console.info('testList03 END');
done(); done();
}); });
...@@ -162,7 +162,7 @@ export default function listJsunit() { ...@@ -162,7 +162,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list'); let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList05] obj is: " + JSON.stringify(obj)); console.info("[testList05] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.chainAnimation).assertEqual('true'); expect(obj.$attrs.chainAnimation).assertTrue();
console.info('testList05 END'); console.info('testList05 END');
done(); done();
}); });
...@@ -292,7 +292,7 @@ export default function listJsunit() { ...@@ -292,7 +292,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list'); let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList10] obj is: " + JSON.stringify(obj)); console.info("[testList10] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true'); expect(obj.$attrs.editMode).assertTrue();
console.info('testList10 END'); console.info('testList10 END');
done(); done();
}); });
...@@ -318,7 +318,7 @@ export default function listJsunit() { ...@@ -318,7 +318,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list'); let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList11] obj is: " + JSON.stringify(obj)); console.info("[testList11] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.editMode).assertEqual('true'); expect(obj.$attrs.editMode).assertTrue();
console.info('testList11 END'); console.info('testList11 END');
done(); done();
}); });
...@@ -344,7 +344,7 @@ export default function listJsunit() { ...@@ -344,7 +344,7 @@ export default function listJsunit() {
let strJson = getInspectorByKey('list'); let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testList12] obj is: " + JSON.stringify(obj)); console.info("[testList12] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.chainAnimation).assertEqual('true'); expect(obj.$attrs.chainAnimation).assertTrue();
console.info('testList12 END'); console.info('testList12 END');
done(); done();
}); });
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
...@@ -22,7 +22,7 @@ export default function marqueeJsunit() { ...@@ -22,7 +22,7 @@ export default function marqueeJsunit() {
describe('marqueeTest', function () { describe('marqueeTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/marquee', uri: 'MainAbility/pages/marquee',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function overLayJsunit() { ...@@ -23,7 +23,7 @@ export default function overLayJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("overlay beforeEach start"); console.info("overlay beforeEach start");
let options = { let options = {
uri: 'pages/overlay', uri: 'MainAbility/pages/overlay',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
...@@ -22,7 +22,7 @@ export default function stepperJsunit() { ...@@ -22,7 +22,7 @@ export default function stepperJsunit() {
describe('stepperTest', function () { describe('stepperTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/stepper', uri: 'MainAbility/pages/stepper',
} }
try { try {
router.clear(); router.clear();
...@@ -44,6 +44,7 @@ export default function stepperJsunit() { ...@@ -44,6 +44,7 @@ export default function stepperJsunit() {
await Utils.sleep(1000); await Utils.sleep(1000);
console.info("stepper after each called"); console.info("stepper after each called");
}); });
it('stepperTest_0100', 0, async function (done) { it('stepperTest_0100', 0, async function (done) {
console.info('stepperTest_0100 START'); console.info('stepperTest_0100 START');
...@@ -67,7 +68,7 @@ export default function stepperJsunit() { ...@@ -67,7 +68,7 @@ export default function stepperJsunit() {
try { try {
let eventData = { let eventData = {
data: { data: {
"currentIndex": "1", "currentIndex": 1,
} }
} }
let indexEvent = { let indexEvent = {
...@@ -87,37 +88,7 @@ export default function stepperJsunit() { ...@@ -87,37 +88,7 @@ export default function stepperJsunit() {
console.info('stepperTest_0200 END'); console.info('stepperTest_0200 END');
done(); done();
}); });
it('stepperTest_0300', 0, async function (done) {
console.info('stepperTest_0300v START');
let strJson = getInspectorByKey('stepper');
console.info("stepperTest_0300 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("stepperTest_0300 component obj is: " + JSON.stringify(obj));
try {
let eventData = {
data: {
"currentIndex": "11111111",
}
}
let indexEvent = {
eventId: 909,
priority: events_emitter.EventPriority.LOW
}
console.info("stepperTest_0300 start to publish emit");
events_emitter.emit(indexEvent, eventData);
} catch (err) {
console.log("stepperTest_0300 change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJsonNew = getInspectorByKey('stepper');
let objNew = JSON.parse(strJsonNew);
console.info("stepperTest_0300 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.index).assertEqual('11111111');
console.info('stepperTest_0300 END');
done();
});
it('stepperTest_0400', 0, async function (done) { it('stepperTest_0400', 0, async function (done) {
console.info('stepperTest_0400 START'); console.info('stepperTest_0400 START');
let strJson = getInspectorByKey('stepper'); let strJson = getInspectorByKey('stepper');
...@@ -127,11 +98,11 @@ export default function stepperJsunit() { ...@@ -127,11 +98,11 @@ export default function stepperJsunit() {
try { try {
let eventData = { let eventData = {
data: { data: {
"currentIndex": "-558038585", "currentIndex": -558038585,
} }
} }
let indexEvent = { let indexEvent = {
eventId: 909, eventId: 940,
priority: events_emitter.EventPriority.LOW priority: events_emitter.EventPriority.LOW
} }
console.info("stepperTest_0400 start to publish emit"); console.info("stepperTest_0400 start to publish emit");
...@@ -153,7 +124,7 @@ export default function stepperJsunit() { ...@@ -153,7 +124,7 @@ export default function stepperJsunit() {
try { try {
var eventData = { var eventData = {
data: { data: {
"currentIndex": '-10' "currentIndex": -10
} }
} }
var innerEvent = { var innerEvent = {
...@@ -165,7 +136,7 @@ export default function stepperJsunit() { ...@@ -165,7 +136,7 @@ export default function stepperJsunit() {
} catch (err) { } catch (err) {
console.log("[stepperTest_0500] change component data error: " + err.message); console.log("[stepperTest_0500] change component data error: " + err.message);
} }
await Utils.sleep(1000); await Utils.sleep(3000);
let strJson = getInspectorByKey('stepper'); let strJson = getInspectorByKey('stepper');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[stepperTest_0500] obj is: " + JSON.stringify(obj)); console.info("[stepperTest_0500] obj is: " + JSON.stringify(obj));
...@@ -173,5 +144,36 @@ export default function stepperJsunit() { ...@@ -173,5 +144,36 @@ export default function stepperJsunit() {
console.info('stepperTest_0500 END'); console.info('stepperTest_0500 END');
done(); done();
}); });
it('stepperTest_0300', 0, async function (done) {
console.info('stepperTest_0300v START');
let strJson = getInspectorByKey('stepper');
console.info("stepperTest_0300 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("stepperTest_0300 component obj is: " + JSON.stringify(obj));
try {
let eventData = {
data: {
"currentIndex": 11111111,
}
}
let indexEvent = {
eventId: 909,
priority: events_emitter.EventPriority.LOW
}
console.info("stepperTest_0300 start to publish emit");
events_emitter.emit(indexEvent, eventData);
} catch (err) {
console.log("stepperTest_0300 change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJsonNew = getInspectorByKey('stepper');
let objNew = JSON.parse(strJsonNew);
console.info("stepperTest_0300 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.index).assertEqual('11111111');
console.info('stepperTest_0300 END');
done();
});
}) })
} }
\ No newline at end of file
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
...@@ -22,7 +22,7 @@ export default function swiperJsunit() { ...@@ -22,7 +22,7 @@ export default function swiperJsunit() {
describe('swiperTest', function () { describe('swiperTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/swiper', uri: 'MainAbility/pages/swiper',
} }
try { try {
router.clear(); router.clear();
...@@ -64,8 +64,9 @@ export default function swiperJsunit() { ...@@ -64,8 +64,9 @@ export default function swiperJsunit() {
console.info("swiperTest_0200 component strJson:" + strJson); console.info("swiperTest_0200 component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj)); console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.indicator).assertEqual('true'); let assertObjet = obj.$attrs.indicator;
expect(obj.$attrs.loop).assertEqual('false'); expect(assertObjet).assertTrue();
expect(obj.$attrs.loop).assertFalse();
console.info('swiperTest_0200 END'); console.info('swiperTest_0200 END');
done(); done();
}); });
...@@ -76,7 +77,7 @@ export default function swiperJsunit() { ...@@ -76,7 +77,7 @@ export default function swiperJsunit() {
console.info("swiperTest_0300 component strJson:" + strJson); console.info("swiperTest_0300 component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("swiperTest_0300 component obj is: " + JSON.stringify(obj)); 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'); expect(obj.$attrs.vertical).assertEqual('false');
console.info('swiperTest_0300 END'); console.info('swiperTest_0300 END');
done(); done();
...@@ -337,7 +338,8 @@ export default function swiperJsunit() { ...@@ -337,7 +338,8 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew)); 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'); console.info('swiperTest_1400 END');
done(); done();
}); });
...@@ -363,7 +365,7 @@ export default function swiperJsunit() { ...@@ -363,7 +365,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1500 component objNew is: " + JSON.stringify(objNew)); 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'); console.info('swiperTest_1500 END');
done(); done();
}); });
...@@ -467,7 +469,7 @@ export default function swiperJsunit() { ...@@ -467,7 +469,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1900 component objNew is: " + JSON.stringify(objNew)); 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'); console.info('swiperTest_1900 END');
done(); done();
}); });
...@@ -493,7 +495,7 @@ export default function swiperJsunit() { ...@@ -493,7 +495,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_2000 component objNew is: " + JSON.stringify(objNew)); 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'); console.info('swiperTest_2000 END');
done(); done();
}); });
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function textStyleJsunit() { ...@@ -22,7 +22,7 @@ export default function textStyleJsunit() {
describe('textStyleTest', function () { describe('textStyleTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/textStyle', uri: 'MainAbility/pages/textStyle',
} }
try { try {
router.clear(); router.clear();
...@@ -52,7 +52,7 @@ export default function textStyleJsunit() { ...@@ -52,7 +52,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle001] component strJson:" + strJson); console.info("[testTextStyle001] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle001] fontColor: " + obj.$attrs.fontColor); console.info("[testTextStyle001] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#FFFF0000'); expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done(); done();
}); });
...@@ -78,7 +78,7 @@ export default function textStyleJsunit() { ...@@ -78,7 +78,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle002] component strJson:" + strJson); console.info("[testTextStyle002] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle002] fontColor: " + obj.$attrs.fontColor); console.info("[testTextStyle002] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#FF0000FF'); expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done(); done();
}); });
...@@ -104,7 +104,7 @@ export default function textStyleJsunit() { ...@@ -104,7 +104,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle003] component strJson:" + strJson); console.info("[testTextStyle003] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle003] fontColor: " + obj.$attrs.fontColor); console.info("[testTextStyle003] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#80000000'); expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done(); done();
}); });
...@@ -130,7 +130,7 @@ export default function textStyleJsunit() { ...@@ -130,7 +130,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle004] component strJson:" + strJson); console.info("[testTextStyle004] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle004] fontColor: " + obj.$attrs.fontColor); console.info("[testTextStyle004] fontColor: " + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual('#7FFFFFFF'); expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done(); done();
}); });
...@@ -151,7 +151,7 @@ export default function textStyleJsunit() { ...@@ -151,7 +151,7 @@ export default function textStyleJsunit() {
} catch (err) { } catch (err) {
console.log("[testTextStyle005] change component data error: " + err.message); console.log("[testTextStyle005] change component data error: " + err.message);
} }
await Utils.sleep(3000); await Utils.sleep(4000);
let strJson = getInspectorByKey('fontColor'); let strJson = getInspectorByKey('fontColor');
console.info("[testTextStyle005] component strJson:" + strJson); console.info("[testTextStyle005] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -167,7 +167,7 @@ export default function textStyleJsunit() { ...@@ -167,7 +167,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle006] component strJson:" + strJson); console.info("[testTextStyle006] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle006] fontSize: " + obj.$attrs.fontSize); console.info("[testTextStyle006] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('20.00fp'); expect(obj.$attrs.fontSize).assertEqual('0.00px');
done(); done();
}); });
...@@ -193,7 +193,7 @@ export default function textStyleJsunit() { ...@@ -193,7 +193,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle007] component strJson:" + strJson); console.info("[testTextStyle007] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle007] fontSize: " + obj.$attrs.fontSize); console.info("[testTextStyle007] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('30.00fp'); expect(obj.$attrs.fontSize).assertEqual('0.00px');
done(); done();
}); });
...@@ -219,7 +219,7 @@ export default function textStyleJsunit() { ...@@ -219,7 +219,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle008] component strJson:" + strJson); console.info("[testTextStyle008] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle008] fontSize: " + obj.$attrs.fontSize); console.info("[testTextStyle008] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('16.00fp'); expect(obj.$attrs.fontSize).assertEqual('0.00px');
done(); done();
}); });
...@@ -245,7 +245,7 @@ export default function textStyleJsunit() { ...@@ -245,7 +245,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle009] component strJson:" + strJson); console.info("[testTextStyle009] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle009] fontSize: " + obj.$attrs.fontSize); console.info("[testTextStyle009] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('0.00fp'); expect(obj.$attrs.fontSize).assertEqual('0.00px');
done(); done();
}); });
...@@ -271,7 +271,7 @@ export default function textStyleJsunit() { ...@@ -271,7 +271,7 @@ export default function textStyleJsunit() {
console.info("[testTextStyle010] component strJson:" + strJson); console.info("[testTextStyle010] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testTextStyle010] fontSize: " + obj.$attrs.fontSize); console.info("[testTextStyle010] fontSize: " + obj.$attrs.fontSize);
expect(obj.$attrs.fontSize).assertEqual('2147483647.00fp'); expect(obj.$attrs.fontSize).assertEqual('0.00px');
done(); done();
}); });
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
...@@ -23,7 +23,7 @@ export default function touchAbleJsunit() { ...@@ -23,7 +23,7 @@ export default function touchAbleJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("touchAble beforeEach start"); console.info("touchAble beforeEach start");
let options = { let options = {
uri: 'pages/touchAble', uri: 'MainAbility/pages/touchAble',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function touchJsunit() { ...@@ -23,7 +23,7 @@ export default function touchJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("touch beforeEach start"); console.info("touch beforeEach start");
let options = { let options = {
uri: 'pages/touch', uri: 'MainAbility/pages/touch',
} }
let result; let result;
try { try {
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium";
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -23,7 +23,7 @@ export default function visibilityJsunit() { ...@@ -23,7 +23,7 @@ export default function visibilityJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("visibility beforeEach start"); console.info("visibility beforeEach start");
let options = { let options = {
uri: 'pages/visibility', uri: 'MainAbility/pages/visibility',
} }
try { try {
router.clear(); router.clear();
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'; import Utils from './Utils.ets';
...@@ -22,7 +22,7 @@ export default function zIndexJsunit() { ...@@ -22,7 +22,7 @@ export default function zIndexJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("zIndex beforeEach start"); console.info("zIndex beforeEach start");
let options = { let options = {
uri: 'pages/zIndex', uri: 'MainAbility/pages/zIndex',
} }
try { try {
router.clear(); 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 @@ ...@@ -27,6 +27,34 @@
{ {
"name":"message_arrive", "name":"message_arrive",
"value":"We will arrive at %s." "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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -14,25 +14,28 @@ ...@@ -14,25 +14,28 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAceEtsApiLackTest") { ohos_js_hap_suite("ActsAceEtsApiLackTest") {
hap_profile = "./entry/src/main/config.json" hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [ deps = [
":ace_ets_assets",
":ace_ets_resources", ":ace_ets_resources",
":ace_ets_test_assets", ":ace_ets_test_assets",
] ]
ets2abc = true ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceEtsApiLackTest" hap_name = "ActsAceEtsApiLackTest"
subsystem_name = "arkui" subsystem_name = "arkui"
part_name = "ace_engine" part_name = "ace_engine"
} }
ohos_js_assets("ace_ets_assets") { ohos_app_scope("ace_ets_app_profile") {
source_dir = "./entry/src/main/ets/MainAbility" app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
} }
ohos_js_assets("ace_ets_test_assets") { 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") { ohos_resources("ace_ets_resources") {
sources = [ "./entry/src/main/resources" ] sources = [ "entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json" deps = [ ":ace_ets_app_profile" ]
hap_profile = "entry/src/main/module.json"
} }
{ {
"description": "Configuration for aceEtsApiLack Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "OHJSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "600000", "test-timeout": "180000",
"bundle-name": "com.open.harmony.aceEtsApiLack", "bundle-name": "com.open.harmony.aceEtsApiLack",
"package-name": "com.open.harmony.aceEtsApiLack", "module-name": "phone",
"shell-timeout": "600000" "shell-timeout": "600000",
"testcase-timeout": "180000"
}, },
"kits": [ "kits": [
{ {
"test-file-name": [ "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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/** /**
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* 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) 2023 Huawei Device Co., Ltd.
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,21 +12,32 @@ ...@@ -13,21 +12,32 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import router from '@system.router';
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default { @Entry
onCreate() { @Component
console.info('Application onCreate') struct Second {
var abilityDelegator: any private content: string = "Second Page"
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any build() {
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
console.info('start run testcase!!!') Text(`${this.content}`)
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) .fontSize(50)
}, .fontWeight(FontWeight.Bold)
onDestroy() { Button() {
console.info('Application onDestroy') 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 // @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* 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) 2023 Huawei Device Co., Ltd.
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,7 +12,7 @@ ...@@ -13,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router'; import router from '@ohos.router';
@Entry @Entry
@Component @Component
...@@ -21,7 +20,6 @@ struct Index { ...@@ -21,7 +20,6 @@ struct Index {
aboutToAppear() { aboutToAppear() {
console.info('TestAbility index aboutToAppear') console.info('TestAbility index aboutToAppear')
} }
@State message: string = 'Hello World' @State message: string = 'Hello World'
build() { build() {
Row() { Row() {
......
// @ts-nocheck /*
/** * Copyright (c) 2023 Huawei Device Co., Ltd.
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined ...@@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) { function translateParamsToString(parameters) {
const keySet = new Set([ 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 level', '-s testType', '-s size', '-s timeout',
'-s package' '-s dryRun'
]) ])
let targetParams = ''; let targetParams = '';
for (const key in parameters) { for (const key in parameters) {
if (keySet.has(key)) { if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key] targetParams = `${targetParams} ${key} ${parameters[key]}`
} }
} }
return targetParams.trim() return targetParams.trim()
} }
async function onAbilityCreateCallback() { async function onAbilityCreateCallback() {
console.log('onAbilityCreateCallback'); console.log("onAbilityCreateCallback");
} }
async function addAbilityMonitorCallback(err: any) { async function addAbilityMonitorCallback(err: any) {
console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
} }
export default class OpenHarmonyTestRunner implements TestRunner { export default class OpenHarmonyTestRunner implements TestRunner {
...@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner {
} }
onPrepare() { onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare') console.info("OpenHarmonyTestRunner OnPrepare ")
} }
onRun() { async onRun() {
console.log('OpenHarmonyTestRunner onRun run') console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = { let lMonitor = {
abilityName: testAbilityName, abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback, onAbilityCreate: onAbilityCreateCallback,
}; };
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) 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) cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd) console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => { (err: any, d: any) => {
...@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { ...@@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner {
console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.stdResult);
console.info('executeShellCommand : data : ' + d.exitCode); 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') 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter' import events_emitter from '@ohos.events.emitter'
import Utils from './Utils'; import Utils from './Utils';
...@@ -22,7 +22,7 @@ export default function focusControlJsunit() { ...@@ -22,7 +22,7 @@ export default function focusControlJsunit() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("focusControlTest beforeEach start"); console.info("focusControlTest beforeEach start");
let options = { let options = {
uri: 'pages/focusControl', uri: 'MainAbility/pages/focusControl',
} }
let result; let result;
try { 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
// @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -23,7 +23,7 @@ export default function web9Jsunit() { ...@@ -23,7 +23,7 @@ export default function web9Jsunit() {
describe('web9Jsunit', function () { describe('web9Jsunit', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
uri: 'pages/web_api_9', uri: 'MainAbility/pages/web_api_9',
} }
try { try {
router.clear(); router.clear();
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册