diff --git a/arkui/ace_ets_component/AppScope/app.json b/arkui/ace_ets_component/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..8ef85dccdc80fba7a9a5c9cd346e3c5a82c75c24 --- /dev/null +++ b/arkui/ace_ets_component/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "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 diff --git a/arkui/ace_ets_component/AppScope/resources/base/element/string.json b/arkui/ace_ets_component/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/arkui/ace_ets_component/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_component/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/arkui/ace_ets_component/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_component/BUILD.gn b/arkui/ace_ets_component/BUILD.gn index 8739645e6b222b4b34589143ff6f35970a32cf0a..34a6192bb1c91426adc05736b0ea7e35bca99f1f 100644 --- a/arkui/ace_ets_component/BUILD.gn +++ b/arkui/ace_ets_component/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,25 +14,28 @@ import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsAceEtsComponentTest") { - hap_profile = "./entry/src/main/config.json" + hap_profile = "entry/src/main/module.json" + js_build_mode = "debug" deps = [ ":ace_ets_component_assets", ":ace_ets_component_resources", - ":ace_ets_component_test_assets", ] ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsAceEtsComponentTest" subsystem_name = "arkui" part_name = "ace_engine" } -ohos_js_assets("ace_ets_component_assets") { - source_dir = "./entry/src/main/ets/MainAbility" + +ohos_app_scope("ace_ets_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] } -ohos_js_assets("ace_ets_component_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" +ohos_js_assets("ace_ets_component_assets") { + source_dir = "entry/src/main/ets" } ohos_resources("ace_ets_component_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "entry/src/main/resources" ] + deps = [ ":ace_ets_app_profile" ] + hap_profile = "entry/src/main/module.json" } diff --git a/arkui/ace_ets_component/Test.json b/arkui/ace_ets_component/Test.json index 66d0d6f5eb1baa5680bc21396b2fd6b08e9156ec..6f11851a4c99d0c351abde0cfe2c32def41ec363 100644 --- a/arkui/ace_ets_component/Test.json +++ b/arkui/ace_ets_component/Test.json @@ -1,11 +1,12 @@ { - "description": "Configuration for aceceshi Tests", + "description": "Configuration for hjunit demo Tests", "driver": { "type": "OHJSUnitTest", "test-timeout": "1200000", - "bundle-name": "com.open.harmony.acetest", - "package-name": "com.open.harmony.acetest", - "shell-timeout": "1200000" + "bundle-name": "com.open.harmony.acetest", + "module-name": "phone", + "shell-timeout": "1200000", + "testcase-timeout": "180000" }, "kits": [ { diff --git a/arkui/ace_ets_component/entry/src/main/config.json b/arkui/ace_ets_component/entry/src/main/config.json deleted file mode 100644 index b0dd0cac84f8a9531453dd3c5417d44fe01ee3d9..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component/entry/src/main/config.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "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 - } - } - ] - } -} diff --git a/arkui/ace_ets_component/entry/src/main/ets/Application/AbilityStage.ts b/arkui/ace_ets_component/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e0206ea9fb5ce94ef140d69510b6280969dd8e --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +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; + } +} diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/MainAbility.ts b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d66065e88c907379883364a43ec02989cfd626b --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,37 @@ +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 diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets index 73c6e8b1206dcc98099e8e5ddc763c39485d946c..79b22c5fbbccc46e0d026753d834a3fe3dcf2261 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets index 1aa54fa0ae8d336a717d7537b12a20380ff19b1f..e337cb938cf5bf51a914774faa347603b86d7ba1 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/column.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/column.ets index 0f3c1500d1ae263369b0490fc43d48ea687be2b4..49abd9c2d696a7a934df61772721d059722ec52e 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/column.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/column.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/ellipse.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/ellipse.ets index f8a81cf736c63b32c5df34ca796525d9022c293f..58ae0e8e2583f0d2db1aa7c0fee2a23b69ebecc9 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/ellipse.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/ellipse.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets index b33e6d78d1c3ab79f52cf1b2beb89ac775cd6afd..08a8afe413038e0e6d334f05c5f3ec5ad1055b57 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/flex.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/flex.ets index f6f8d3434ab39e2cf35a56b04f893d73c103cfec..35282baccb10ffd113d9cc70ee7e1102cbafa08b 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/flex.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/flex.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gauge.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gauge.ets index 0ef849eccc2455043a4a45ae4c1a7d5d2c7b04d6..09f86f4124e6595dd21231534e4e668e39fa0315 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gauge.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gauge.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets index 1b4a677937b94b92f00f9634b914c58390b83da4..fde821d49aa36b9a1d0a1522568fe6d1c3ffa81a 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridContainer.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridContainer.ets index ed2b11174e27b9b5ce34521f39a5dd7af4d4ca01..5121fe6eb305065fc2b059b72ec53126cf6547d2 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridContainer.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridContainer.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridSettings.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridSettings.ets index e7c10875d9e5fd549b4d47e9313c4396b3adbbc3..74bc2f34e6f250f902b2e2ed1b534e7c5cf4257f 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridSettings.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/gridSettings.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/imageEffects.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/imageEffects.ets index 885387c894d7fe0fa948b416093ed74c3705e3df..e3c61127bed253aeb4cff710a219c4fc09975e32 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/imageEffects.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/imageEffects.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index.ets index 5be55e99f496a3ceb6a27d86a7785c7ae30909f2..5b0b229e33e35b7282d87c42356945c421a6385d 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index/index.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e231258d8a2c81943958dd04a85d57a68d3dd58 --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,56 @@ +/* + * 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 diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/layoutConstraints.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/layoutConstraints.ets index c338a9bc7e0e3784904e6b39bac3d1d8870e8a18..b0e6a079ea58cb2755146c7d8bd0b021fdbcacc9 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/layoutConstraints.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/layoutConstraints.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/list.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/list.ets index b3cd85b5bbdfb821e39bb3985f9aefc8bbb0fee5..a637e61f46ddeb89ba4b438b219d6688fe6ba078 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/list.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/list.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/marquee.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/marquee.ets index bbe0e08fecdd3394e647a877678db49aa84640b6..1fd44deda53dc0cbb92b4dbce1c225c38b940b51 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/marquee.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/marquee.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/overlay.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/overlay.ets index 01a27912b2bab610911741d8b55da573988746d4..b7c39a52b88135ac697e3dc1954a12befaa64d73 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/overlay.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/overlay.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/second/second.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..7396425947cd4d9c1016f77855e792bfb6869629 --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/stepper.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/stepper.ets index 89590da070b8d188625385b6688a2a0c972c5b37..3aecfc3eec2a257563002a260f599bfb677a228d 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/stepper.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/stepper.ets @@ -1,6 +1,6 @@ -// @ts-nocheck + /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -118,14 +118,22 @@ struct StepperExample { priority: events_emitter.EventPriority.LOW } events_emitter.on(stateChangeEventThree, this.stateChangCallBack); + + var stateChangeEventThree = { + eventId: 940, + priority: events_emitter.EventPriority.LOW + } + events_emitter.on(stateChangeEventThree, this.stateChangCallBack); } + private stateChangCallBack = (eventData) => { console.info("stepper page stateChangCallBack" + JSON.stringify(eventData)); if (eventData != null) { console.info("stepper page state change called:" + JSON.stringify(eventData)); if (eventData.data.currentIndex != null) { - this.currentIndex = parseInt(eventData.data.currentIndex); + this.currentIndex = eventData.data.currentIndex; + console.info("stepper page.." + this.currentIndex); } if (eventData.data.disabled != null) { this.disabled = eventData.data.disabled; diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets index 285f05337f9167adf4b5c33597c6bd3883374974..b49df38f03fb469ab1d556d41c6122ff8c7e22d4 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/textStyle.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/textStyle.ets index 6a8e1cbde2936b6074411091af18c724b8406096..811dac9690b653e802e4bbb26aae9d1a6bca0f50 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/textStyle.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/textStyle.ets @@ -1,6 +1,6 @@ -// @ts-nocheck + /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,9 +20,9 @@ import events_emitter from '@ohos.events.emitter'; @Component struct TextStyle { @State fontColor: Color = Color.Red; - @State fontSize: string = 20; + @State fontSize: number= 20; @State fontStyle: FontStyle = FontStyle.Italic; - @State fontWeight: string = 700; + @State fontWeight: number = 700; @State fontFamily: string = 'sans-serif'; build() { @@ -30,12 +30,12 @@ struct TextStyle { Text('default text').fontSize(20) Text(`text font color ${this.fontColor}`) - .fontColor(this.fontColor) + .fontColor('error') .fontSize(20) .key('fontColor') Text(`text font size ${this.fontSize}`) - .fontSize(this.fontSize) + .fontSize('error') .key('fontSize') Text(`text font style ${this.fontStyle}`) diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touch.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touch.ets index 10b87aff22e2d1082706d2fbccb937382b74535e..b65aa43978780c0f7c5de52ef70530f003662333 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touch.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touch.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets index 7efd3aeeb82f4195c41a6197c865913a8605a9bf..d3de336fab692cafbc4403112df9f92ed4a9f964 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets index 3af4e73de7ff6705ba618ee732b62a9cc34f7da7..bcea9bf0badde23180480a3565f28eaa932f3c5f 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/zIndex.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/zIndex.ets index bb102120ce94228dde8f8e869600fa7b637d1807..5580663cdefc6f250632e0625dc23243d6efaacf 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/zIndex.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/zIndex.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/utils/Constants.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/utils/Constants.ets index 13a6c0d16e7277756efb5136ce8b02ac6b601d50..0928a8f340d0c726291af7f7b0109088cabbff41 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/utils/Constants.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/utils/Constants.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/TestAbility/TestAbility.ts b/arkui/ace_ets_component/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..871dc89b25426b48a4575c64948ef5d916477140 --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 diff --git a/arkui/ace_ets_component/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component/entry/src/main/ets/TestAbility/pages/index.ets index f87ca6e18f4a4dd9c1804b8edabe664029341e78..441f24058499e3ea4c4c3d96a776f02192e02549 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -21,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/arkui/ace_ets_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index dfbf1f268a45e4a2f30b8c836f42d76f3a9f5ad3..faefa78af85c1edc00c8f8645884e43b420ac887 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,25 +21,25 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', + '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', - '-s package' + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] + targetParams = `${targetParams} ${key} ${parameters[key]}` } } return targetParams.trim() } async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); + console.log("onAbilityCreateCallback"); } async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) } export default class OpenHarmonyTestRunner implements TestRunner { @@ -47,22 +47,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info("OpenHarmonyTestRunner OnPrepare ") } - onRun() { + async onRun() { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a com.open.harmony.acetest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { @@ -70,9 +74,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.exitCode); }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) console.info('OpenHarmonyTestRunner onRun end') } }; \ No newline at end of file diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets index 2851ba567d871ccb42eaa0256bb77754b8d17ae0..9af5a878f82ce32248f7c7c91128de523890bd8f 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function appearJsunit() { beforeEach(async function (done) { console.info("appear beforeEach start"); let options = { - uri: 'pages/appear', + uri: 'MainAbility/pages/appear', } let result; try { diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets index de746a9537cc6725d81bcf91c2c28e80f8d65bb5..11b50aae406e8696bec9a635e65d75a80126a732 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function areaChangeJsunit() { describe('areaChangeTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/areaChange', + uri: 'MainAbility/pages/areaChange', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/ColumnJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/ColumnJsunit.test.ets index 8f3edfcfb7e9de56a812a69763fe041e899376ed..988f5b0e3b9b9a94b712b3d80a4b7fc8a64de323 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/ColumnJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/ColumnJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function columnJsunit() { beforeEach(async function (done) { console.info("column beforeEach start"); let options = { - uri: 'pages/column', + uri: 'MainAbility/pages/column', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/EllipseJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/EllipseJsunit.test.ets index 1ab48f542438e576505a6414f30e8f278f84b716..9a7d8b9ad39d5533a675bcc6fb04d2029781692d 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/EllipseJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/EllipseJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function ellipseJsunit() { beforeEach(async function (done) { console.info("ellipse beforeEach start"); let options = { - uri: 'pages/ellipse', + uri: 'MainAbility/pages/ellipse', } try { router.clear(); @@ -183,7 +183,7 @@ export default function ellipseJsunit() { let strJson = getInspectorByKey('ellipse'); let obj = JSON.parse(strJson); console.info("[testEllipse06] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.height).assertEqual('-40.00px'); + expect(obj.$attrs.height).assertEqual('0.00px'); console.info('testEllipse06 END'); done(); }); @@ -209,7 +209,7 @@ export default function ellipseJsunit() { let strJson = getInspectorByKey('ellipse'); let obj = JSON.parse(strJson); console.info("[testEllipse07] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.width).assertEqual('-10.00px'); + expect(obj.$attrs.width).assertEqual('0.00px'); console.info('testEllipse07 END'); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets index fe09bdbc327bd86b979a12be86c84fd0fb90101a..f90fa5fae9e1d6f940545818f6171ef39ad60d1e 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function enableJsunit() { beforeEach(async function (done) { console.info("enable beforeEach start"); let options = { - uri: 'pages/enable', + uri: 'MainAbility/pages/enable', } try { router.clear(); @@ -104,7 +104,7 @@ export default function enableJsunit() { let strJson = getInspectorByKey('enabled'); let obj = JSON.parse(strJson); console.info("[testEnable03] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.enabled).assertEqual(true); + expect(obj.$attrs.enabled).assertEqual(false); console.info('testEnable03 END'); done(); }); @@ -130,7 +130,7 @@ export default function enableJsunit() { let strJsonNew = getInspectorByKey('enabled'); let objNew = JSON.parse(strJsonNew); console.info("testEnable04 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.enabled).assertEqual(true); + expect(objNew.$attrs.enabled).assertEqual(false); done(); }); }) diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/FlexJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/FlexJsunit.test.ets index 1d766238596186b81ab70f9a7f766ae5f4dbab52..fd8aea89a56580638a91917814005881119bc167 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/FlexJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/FlexJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@ohos.events.emitter'; import Utils from './Utils.ets'; import router from '@system.router'; @@ -23,7 +23,7 @@ export default function flexJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/flex', + uri: 'MainAbility/pages/flex', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/GaugeJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/GaugeJsunit.test.ets index 8f49baf861e8470f9d39a832af1377af299b0554..bb3e121a73ef3422d489c90a03620ed5128e78e9 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/GaugeJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/GaugeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -21,7 +21,7 @@ export default function gaugeJsunit() { describe('gaugeTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/gauge', + uri: 'MainAbility/pages/gauge', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/GlobalJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/GlobalJsunit.test.ets index 2355b5507e5e13db08000fd2f4dece507c317cd3..0fb5b93dce3db07a26c5adefb45733aa85a76cf2 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/GlobalJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/GlobalJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function globalJsunit() { beforeEach(async function (done) { console.info("global beforeEach start"); let options = { - uri: 'pages/global', + uri: 'MainAbility/pages/global', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/GridContainerJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/GridContainerJsunit.test.ets index 67dc4c63f17fe17ce31d4b3f271c2a1fe28d184f..15a37307b447cea2e91671d3a0be197f23e1c7dc 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/GridContainerJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/GridContainerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function girdContainerJsunit() { beforeEach(async function (done) { console.info("girdContainer beforeEach start"); let options = { - uri: 'pages/gridContainer', + uri: 'MainAbility/pages/gridContainer', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/GridSettingsJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/GridSettingsJsunit.test.ets index 38017056a9607647299811e9731d07f5194276d7..f3aac7b76961362ee27dd57baa06eaa627174140 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/GridSettingsJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/GridSettingsJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function gridSettingsJsunit() { describe('gridSettingsTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/gridSettings', + uri: 'MainAbility/pages/gridSettings', } try { router.clear(); @@ -117,7 +117,7 @@ export default function gridSettingsJsunit() { console.info("[testGridSettings003] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testGridSettings003] gridRow useSizeType: " + JSON.stringify(obj.$attrs.useSizeType)); - expect(obj.$attrs.useSizeType.sm.span).assertEqual(-2147483648); + expect(obj.$attrs.useSizeType.sm.span).assertEqual(1); expect(obj.$attrs.useSizeType.sm.offset).assertEqual(-2147483648); done(); }); @@ -352,7 +352,7 @@ export default function gridSettingsJsunit() { console.info("[testGridSettings013] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testGridSettings013] gridSpan: " + JSON.stringify(obj.$attrs.gridSpan)); - expect(obj.$attrs.gridSpan).assertEqual(-2147483648); + expect(obj.$attrs.gridSpan).assertEqual(2); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets index 5aa3be362b156423963f224395706df84ea0f003..8a91a0f848fc1d64365c42daca24a4ee7c1afcbf 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function imageEffectsJsunit() { describe('imageEffectsTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/imageEffects', + uri: 'MainAbility/pages/imageEffects', } try { router.clear(); @@ -140,7 +140,7 @@ export default function imageEffectsJsunit() { try { var eventData = { data: { - "blurValue": 'error' + "blurValue": '0' } } var innerEvent = { @@ -889,10 +889,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects036] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#32000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultXS"); done(); }); @@ -919,10 +916,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects037] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#0B000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("0.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultSM"); done(); }); @@ -949,10 +943,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects038] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#28000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("60.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultMD"); done(); }); @@ -979,10 +970,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects039] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#26000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("10.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterDefaultLG"); done(); }); @@ -1009,10 +997,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects040] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#15000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("50.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingSM"); done(); }); @@ -1039,10 +1024,7 @@ export default function imageEffectsJsunit() { let strJsonNew = getInspectorByKey('shadowDefaultShadow'); let objNew = JSON.parse(strJsonNew); console.info("[testImageEffects041] component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.shadow.radius).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.color).assertEqual("#31000000"); - expect(objNew.$attrs.shadow.offsetX).assertEqual("0.000000"); - expect(objNew.$attrs.shadow.offsetY).assertEqual("30.000000"); + expect(objNew.$attrs.shadow).assertEqual("ShadowStyle.OuterFloatingMD"); done(); }); }) diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/LayoutConstraintsJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/LayoutConstraintsJsunit.test.ets index 7bbf196a51ff4b99cfd8ffea6a89be57bb1aa7fb..d6e12144cc9dfe5412fe7cd8a36e2bc4e0682a71 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/LayoutConstraintsJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/LayoutConstraintsJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function layoutConstraintsJsunit() { beforeEach(async function (done) { console.info("layoutConstraints beforeEach start"); let options = { - uri: 'pages/layoutConstraints', + uri: 'MainAbility/pages/layoutConstraints', } try { router.clear(); @@ -116,7 +116,7 @@ export default function layoutConstraintsJsunit() { console.info("[testLayoutConstraints004] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testLayoutConstraints004] displayPriority: " + obj.$attrs.displayPriority); - expect(obj.$attrs.displayPriority).assertEqual(5); + expect(obj.$attrs.displayPriority).assertEqual(1); done(); }); @@ -142,7 +142,7 @@ export default function layoutConstraintsJsunit() { console.info("[testLayoutConstraints005] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testLayoutConstraints005] aspectRatio: " + obj.$attrs.aspectRatio); - expect(obj.$attrs.aspectRatio).assertEqual(-4); + expect(obj.$attrs.aspectRatio).assertEqual(1); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/List.test.ets index 7e3419c983847ee80b24bb00da9d469a770a7b23..b5648484db9558e05442e3bad2f71e4ea5a90fcd 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/List.test.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/ListJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/ListJsunit.test.ets index 0604d175e9f26729b3c2168a12bce260458d1d61..011b069f9fdc77adaa4bf5f966a84b0f42999675 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/ListJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/ListJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function listJsunit() { beforeEach(async function (done) { console.info("list beforeEach start"); let options = { - uri: 'pages/list', + uri: 'MainAbility/pages/list', } try { router.clear(); @@ -52,9 +52,9 @@ export default function listJsunit() { let obj = JSON.parse(strJson); console.info("[testList01] obj is: " + JSON.stringify(obj)); expect(obj.$attrs.listDirection).assertEqual('Axis.Vertical'); - expect(obj.$attrs.editMode).assertEqual('false'); + expect(obj.$attrs.editMode).assertFalse(); expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.None'); - expect(obj.$attrs.chainAnimation).assertEqual('false'); + expect(obj.$attrs.chainAnimation).assertFalse(); expect(obj.$attrs.divider.strokeWidth).assertEqual("2.00vp"); expect(obj.$attrs.divider.color).assertEqual("#FFFFFFFF"); expect(obj.$attrs.divider.startMargin).assertEqual("20.00vp"); @@ -110,7 +110,7 @@ export default function listJsunit() { let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); console.info("[testList03] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.editMode).assertEqual('true'); + expect(obj.$attrs.editMode).assertTrue(); console.info('testList03 END'); done(); }); @@ -162,7 +162,7 @@ export default function listJsunit() { let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); console.info("[testList05] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.chainAnimation).assertEqual('true'); + expect(obj.$attrs.chainAnimation).assertTrue(); console.info('testList05 END'); done(); }); @@ -292,7 +292,7 @@ export default function listJsunit() { let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); console.info("[testList10] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.editMode).assertEqual('true'); + expect(obj.$attrs.editMode).assertTrue(); console.info('testList10 END'); done(); }); @@ -318,7 +318,7 @@ export default function listJsunit() { let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); console.info("[testList11] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.editMode).assertEqual('true'); + expect(obj.$attrs.editMode).assertTrue(); console.info('testList11 END'); done(); }); @@ -344,7 +344,7 @@ export default function listJsunit() { let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); console.info("[testList12] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.chainAnimation).assertEqual('true'); + expect(obj.$attrs.chainAnimation).assertTrue(); console.info('testList12 END'); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets index 05e5295167fb06666c25834a9c72e57b6ff85f77..3db2aed2b9d9fe0f059af23073ae7796e5f1e985 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils.ets'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function marqueeJsunit() { describe('marqueeTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/marquee', + uri: 'MainAbility/pages/marquee', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/OverlayJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/OverlayJsunit.test.ets index ba1d6945503af778bbeef97eae0167171d934587..035aed543f3d7cd3b7232b360b4dc219e39d87d7 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/OverlayJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/OverlayJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function overLayJsunit() { beforeEach(async function (done) { console.info("overlay beforeEach start"); let options = { - uri: 'pages/overlay', + uri: 'MainAbility/pages/overlay', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets index 68e4f2663bfa6fbbc983fd637f1aa782f2f50392..3559edbeeca0e48426d12a367c9a363c4f9c6915 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils.ets'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function stepperJsunit() { describe('stepperTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/stepper', + uri: 'MainAbility/pages/stepper', } try { router.clear(); @@ -44,6 +44,7 @@ export default function stepperJsunit() { await Utils.sleep(1000); console.info("stepper after each called"); }); + it('stepperTest_0100', 0, async function (done) { console.info('stepperTest_0100 START'); @@ -67,7 +68,7 @@ export default function stepperJsunit() { try { let eventData = { data: { - "currentIndex": "1", + "currentIndex": 1, } } let indexEvent = { @@ -87,37 +88,7 @@ export default function stepperJsunit() { console.info('stepperTest_0200 END'); 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) { console.info('stepperTest_0400 START'); let strJson = getInspectorByKey('stepper'); @@ -127,11 +98,11 @@ export default function stepperJsunit() { try { let eventData = { data: { - "currentIndex": "-558038585", + "currentIndex": -558038585, } } let indexEvent = { - eventId: 909, + eventId: 940, priority: events_emitter.EventPriority.LOW } console.info("stepperTest_0400 start to publish emit"); @@ -153,7 +124,7 @@ export default function stepperJsunit() { try { var eventData = { data: { - "currentIndex": '-10' + "currentIndex": -10 } } var innerEvent = { @@ -165,7 +136,7 @@ export default function stepperJsunit() { } catch (err) { console.log("[stepperTest_0500] change component data error: " + err.message); } - await Utils.sleep(1000); + await Utils.sleep(3000); let strJson = getInspectorByKey('stepper'); let obj = JSON.parse(strJson); console.info("[stepperTest_0500] obj is: " + JSON.stringify(obj)); @@ -173,5 +144,36 @@ export default function stepperJsunit() { console.info('stepperTest_0500 END'); 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 diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets index c49927d7fa3cd355926495bdb6b41d08f623cab4..ab0da30e1bea6fb5aea0ac402cd164af23376f6a 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils.ets'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function swiperJsunit() { describe('swiperTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/swiper', + uri: 'MainAbility/pages/swiper', } try { router.clear(); @@ -64,8 +64,9 @@ export default function swiperJsunit() { console.info("swiperTest_0200 component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.indicator).assertEqual('true'); - expect(obj.$attrs.loop).assertEqual('false'); + let assertObjet = obj.$attrs.indicator; + expect(assertObjet).assertTrue(); + expect(obj.$attrs.loop).assertFalse(); console.info('swiperTest_0200 END'); done(); }); @@ -76,7 +77,7 @@ export default function swiperJsunit() { console.info("swiperTest_0300 component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("swiperTest_0300 component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.duration).assertEqual('1000.000000'); + expect(obj.$attrs.duration).assertEqual('1000'); expect(obj.$attrs.vertical).assertEqual('false'); console.info('swiperTest_0300 END'); done(); @@ -337,7 +338,8 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.indicator).assertEqual('false'); + let assertObjet = obj.$attrs.indicator; + expect(assertObjet).assertTrue(); console.info('swiperTest_1400 END'); done(); }); @@ -363,7 +365,7 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_1500 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.duration).assertEqual('500.000000'); + expect(objNew.$attrs.duration).assertEqual('500'); console.info('swiperTest_1500 END'); done(); }); @@ -467,7 +469,7 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_1900 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.duration).assertEqual('0.000000'); + expect(objNew.$attrs.duration).assertEqual('0'); console.info('swiperTest_1900 END'); done(); }); @@ -493,7 +495,7 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_2000 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.duration).assertEqual('400.000000'); + expect(objNew.$attrs.duration).assertEqual('400'); console.info('swiperTest_2000 END'); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets index e5896ae665dc6857381c89829fe2eb0dc7e27cbe..aca91372536fddfb6a50f539920c8f72f35e078b 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function textStyleJsunit() { describe('textStyleTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/textStyle', + uri: 'MainAbility/pages/textStyle', } try { router.clear(); @@ -52,7 +52,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle001] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle001] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FFFF0000'); + expect(obj.$attrs.fontColor).assertEqual('#FF000000'); done(); }); @@ -78,7 +78,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle002] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle002] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF0000FF'); + expect(obj.$attrs.fontColor).assertEqual('#FF000000'); done(); }); @@ -104,7 +104,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle003] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle003] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#80000000'); + expect(obj.$attrs.fontColor).assertEqual('#FF000000'); done(); }); @@ -130,7 +130,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle004] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle004] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#7FFFFFFF'); + expect(obj.$attrs.fontColor).assertEqual('#FF000000'); done(); }); @@ -151,7 +151,7 @@ export default function textStyleJsunit() { } catch (err) { console.log("[testTextStyle005] change component data error: " + err.message); } - await Utils.sleep(3000); + await Utils.sleep(4000); let strJson = getInspectorByKey('fontColor'); console.info("[testTextStyle005] component strJson:" + strJson); let obj = JSON.parse(strJson); @@ -167,7 +167,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle006] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle006] fontSize: " + obj.$attrs.fontSize); - expect(obj.$attrs.fontSize).assertEqual('20.00fp'); + expect(obj.$attrs.fontSize).assertEqual('0.00px'); done(); }); @@ -193,7 +193,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle007] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle007] fontSize: " + obj.$attrs.fontSize); - expect(obj.$attrs.fontSize).assertEqual('30.00fp'); + expect(obj.$attrs.fontSize).assertEqual('0.00px'); done(); }); @@ -219,7 +219,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle008] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle008] fontSize: " + obj.$attrs.fontSize); - expect(obj.$attrs.fontSize).assertEqual('16.00fp'); + expect(obj.$attrs.fontSize).assertEqual('0.00px'); done(); }); @@ -245,7 +245,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle009] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle009] fontSize: " + obj.$attrs.fontSize); - expect(obj.$attrs.fontSize).assertEqual('0.00fp'); + expect(obj.$attrs.fontSize).assertEqual('0.00px'); done(); }); @@ -271,7 +271,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle010] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle010] fontSize: " + obj.$attrs.fontSize); - expect(obj.$attrs.fontSize).assertEqual('2147483647.00fp'); + expect(obj.$attrs.fontSize).assertEqual('0.00px'); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets index 6ca13464c02c0faaa04c9ffff87196eba3e42eb6..526c53c522692d8fc8b4f0ad4cf7b5904bf088da 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils.ets'; import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function touchAbleJsunit() { beforeEach(async function (done) { console.info("touchAble beforeEach start"); let options = { - uri: 'pages/touchAble', + uri: 'MainAbility/pages/touchAble', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets index 8b1bc86b9f746ce7582fd97afebed74b4547ced5..49e11d786b23917d48aca972d065c1b1f589f25d 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function touchJsunit() { beforeEach(async function (done) { console.info("touch beforeEach start"); let options = { - uri: 'pages/touch', + uri: 'MainAbility/pages/touch', } let result; try { diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component/entry/src/main/ets/test/Utils.ets index 0f4b16d766f1feeb75edd8cc84cd1448d61e569a..bb1f4a49ebf2db8543071ec5999d44fff08a94d1 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets index 87a981ad4908357170d5293e797ed807f1b570ea..038a9c287a81912ac2f0d554c6451bafc54df8b7 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function visibilityJsunit() { beforeEach(async function (done) { console.info("visibility beforeEach start"); let options = { - uri: 'pages/visibility', + uri: 'MainAbility/pages/visibility', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/ZIndexJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/ZIndexJsunit.test.ets index cd099cc4b7671f352cd84e49a52cc316436ab432..83a468819ec0e0a14d8040d8b0995d2b7b070c2b 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/ZIndexJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/ZIndexJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -22,7 +22,7 @@ export default function zIndexJsunit() { beforeEach(async function (done) { console.info("zIndex beforeEach start"); let options = { - uri: 'pages/zIndex', + uri: 'MainAbility/pages/zIndex', } try { router.clear(); diff --git a/arkui/ace_ets_component/entry/src/main/module.json b/arkui/ace_ets_component/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..ceb34b03ce477ab8cd86b6880ad7e3ae53af4b9e --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/module.json @@ -0,0 +1,41 @@ +{ + "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 diff --git a/arkui/ace_ets_component/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component/entry/src/main/resources/base/element/string.json index f6488bb9ccc6588f4a68440a5a320c1d2d952a99..f9f9529435996599eaf1069ead7cb6f832f34968 100644 --- a/arkui/ace_ets_component/entry/src/main/resources/base/element/string.json +++ b/arkui/ace_ets_component/entry/src/main/resources/base/element/string.json @@ -27,6 +27,34 @@ { "name":"message_arrive", "value":"We will arrive at %s." - } + }, + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } ] } \ No newline at end of file diff --git a/arkui/ace_ets_component/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_component/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..3efd0d79c89fe49fd726bd0019b56bd1c7e2da09 --- /dev/null +++ b/arkui/ace_ets_component/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,27 @@ +{ + "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 diff --git a/arkui/ace_ets_component_apilack/AppScope/app.json b/arkui/ace_ets_component_apilack/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..e8c9effe19d8b09f8fc4fa3693ebe1744531d0b6 --- /dev/null +++ b/arkui/ace_ets_component_apilack/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "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 diff --git a/arkui/ace_ets_component_apilack/AppScope/resources/base/element/string.json b/arkui/ace_ets_component_apilack/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/arkui/ace_ets_component_apilack/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_component_apilack/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/arkui/ace_ets_component_apilack/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_component_apilack/BUILD.gn b/arkui/ace_ets_component_apilack/BUILD.gn index b10a77056f2aa80a93d65f71b3536a37cf110e31..cf2ca9ea05c1e987ad6fd2b81b19cd63f8e36424 100644 --- a/arkui/ace_ets_component_apilack/BUILD.gn +++ b/arkui/ace_ets_component_apilack/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,25 +14,28 @@ import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsAceEtsApiLackTest") { - hap_profile = "./entry/src/main/config.json" + hap_profile = "entry/src/main/module.json" + js_build_mode = "debug" deps = [ - ":ace_ets_assets", ":ace_ets_resources", ":ace_ets_test_assets", ] ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsAceEtsApiLackTest" subsystem_name = "arkui" part_name = "ace_engine" } -ohos_js_assets("ace_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" +ohos_app_scope("ace_ets_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] } + ohos_js_assets("ace_ets_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" + source_dir = "entry/src/main/ets" } ohos_resources("ace_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "entry/src/main/resources" ] + deps = [ ":ace_ets_app_profile" ] + hap_profile = "entry/src/main/module.json" } diff --git a/arkui/ace_ets_component_apilack/Test.json b/arkui/ace_ets_component_apilack/Test.json index 0ef09c69cd641ca5e16e67a8c79796bb903203c6..5d51ee145276795fb695e4e205a249a162799ace 100644 --- a/arkui/ace_ets_component_apilack/Test.json +++ b/arkui/ace_ets_component_apilack/Test.json @@ -1,12 +1,14 @@ { - "description": "Configuration for aceEtsApiLack Tests", + "description": "Configuration for hjunit demo Tests", "driver": { "type": "OHJSUnitTest", - "test-timeout": "600000", + "test-timeout": "180000", "bundle-name": "com.open.harmony.aceEtsApiLack", - "package-name": "com.open.harmony.aceEtsApiLack", - "shell-timeout": "600000" + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": "180000" }, + "kits": [ { "test-file-name": [ diff --git a/arkui/ace_ets_component_apilack/entry/src/main/config.json b/arkui/ace_ets_component_apilack/entry/src/main/config.json deleted file mode 100644 index 4585556cf1f00f20728579b36648bec87255e275..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_apilack/entry/src/main/config.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "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 - } - } - ] - } -} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/Application/AbilityStage.ts b/arkui/ace_ets_component_apilack/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e0206ea9fb5ce94ef140d69510b6280969dd8e --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +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; + } +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/MainAbility.ts b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d66065e88c907379883364a43ec02989cfd626b --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,37 @@ +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 diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 07722b56d3d02df5fb59b51789007b844b43e63c..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/AlphabetIndexer_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/AlphabetIndexer_y.ets index a647a132965733b06bc15da00d81b339ca57b1f2..349ec8e724ef2812741aa9522f58f9739fef2dd0 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/AlphabetIndexer_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/AlphabetIndexer_y.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/WebPageg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/WebPageg.ets index c32c6a8218449f8053565992f785da6c1d59a103..4753388c5416ccdb8f4521cfc9b3126332bac360 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/WebPageg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/WebPageg.ets @@ -1,6 +1,6 @@ // @ts-nocheck /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/animatorOption_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/animatorOption_y.ets index 11c225daabe86db3787ba4b46d10e093a2028541..4394c7218635f473f19fa88771589f6b6141a999 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/animatorOption_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/animatorOption_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/navigation_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/navigation_y.ets index 03f9e8501e99bcd525c8261601a64258f4e8cbed..90e8ec17771608b9bc0ec8380a6e3a00ac131631 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/navigation_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/navigation_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets index 79deb67d97e5109a379f56c5ce8465bf50c8acc2..c760603cb09c1e5fccecbd8851eb2495427e94af 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets index 6c6b322aa9ba979d8535b731707219015256028a..5aa6e4a93eb2d2bef6def2fb3351cd76a49d7e82 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets index 39bcc0f214e40db7918319c100f8a0dba5dcb77f..f0289b8d05148fa25651ea0a3689504d748f4f35 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterAg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterAg.ets index 3cbeaf9f5b4f833136dba631f5415c42142688b1..e8bfd8e8e0df6e59ff4137ea9abb3609e5448c9d 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterAg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterAg.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterBg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterBg.ets index 02ca54add2c4369c84735888d633220de31cc79e..e286b95312ffe4d1abb5b522e823f838d0c80779 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterBg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterBg.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/positionSetting_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/positionSetting_y.ets index 4827c630ef0d2784a9bdb6ea7dde6fe85af69d8f..945175fd39ec1b41a65a23ce0341a8bc83d06b3c 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/positionSetting_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/positionSetting_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets index 6ebc28c60b6a3d9fed074987ac04c9c0d5d260dd..fe9b098613d2ae2d72a9bbcd422b1ec944ecfcad 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets index 3803e664448a65a705b213e790035029584498e7..0db70ec6debc11dabdfa582036a9704f0d070917 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets index 8e6bc7cf7e3a3c3f46cc91ac47ec94abd251725c..a15b5288e3276331b6e6b15f68a14a26695e0e15 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets index 1fbe15140fe6844b86875686773d66ff66f7dbb8..d27cced4ba62ffe547480d9f6677962cb381d1d1 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets index 6b9b0a166f4f0defab64d79db1b48489650efdd6..c0397eac0a48b8f6f2d78acd2c1b59ee23cfe74e 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index/index.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e231258d8a2c81943958dd04a85d57a68d3dd58 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,56 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/second/second.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..7396425947cd4d9c1016f77855e792bfb6869629 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets index 474402dab20209a448aa83bc6fcc0bd62ae5054f..5e71d88286796cb7aa35303739cdaf2f5bc5d7cc 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets @@ -1,6 +1,6 @@ // @ts-nocheck /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web_api_9.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web_api_9.ets index 20f61cdaf04ec921ceca6d3f86aa94c6b4e05403..7ddd708b81025411917c9551c080018416ed78e7 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web_api_9.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web_api_9.ets @@ -1,6 +1,6 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets index cc02206352c151fec73bfe787bba3d3d19b498b5..a68224b7e63d71923db87a832aa852d45da0c919 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/TestAbility.ts b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..871dc89b25426b48a4575c64948ef5d916477140 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index 6b29cb8048a4edbca5f8fbc6197c0fb227c00f64..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets index 0d0efe0a85177331cccf9524a7cd747c966dcbe5..1cf6eda5d963e40bc2e277218b30397f3ad43b09 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -21,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 07cb0b784984c6c4cc6d911c3c82643bff9df263..1c38a834b5bf47eb788acfa5bcd69da083edfcd6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', + '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', - '-s package' + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] + targetParams = `${targetParams} ${key} ${parameters[key]}` } } return targetParams.trim() } async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); + console.log("onAbilityCreateCallback"); } async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) } export default class OpenHarmonyTestRunner implements TestRunner { @@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info("OpenHarmonyTestRunner OnPrepare ") } - onRun() { + async onRun() { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a com.open.harmony.aceEtsApiLack.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { @@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.exitCode); }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) console.info('OpenHarmonyTestRunner onRun end') } }; \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets index cc24bb089574b838dc00a3635034bf487863c6c6..f27579d70bd6f6b94832f2f28fda5a03f43dab2c 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function focusControlJsunit() { beforeEach(async function (done) { console.info("focusControlTest beforeEach start"); let options = { - uri: 'pages/focusControl', + uri: 'MainAbility/pages/focusControl', } let result; try { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets index ead1df032237f27f1495b033b71e891db91813bf..9a7c8064a4af3fb1590e3a4f4b8620de4881d8bc 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets index aa94fe4f7e0a3a0c066b9141e118b2229c839a96..b4d1ad3df1329db4f69ec4522db1676d8069735e 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Web9Jsunit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Web9Jsunit.test.ets index 6377da1d7b433858c760cab5f278ddf2d2c9330d..86ff5bf374cf0a59ed4cb476e93ba0ed04f5cba6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Web9Jsunit.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Web9Jsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,7 @@ export default function web9Jsunit() { describe('web9Jsunit', function () { beforeEach(async function (done) { let options = { - uri: 'pages/web_api_9', + uri: 'MainAbility/pages/web_api_9', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets index 67a0333dadc3f75b90371ab2e5f1ee62cfb32602..735e985340292b649fce83e122ecb6eadbe06769 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/WebJsunitApi9.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets index bffd448cdfcef4ccb67811152cea7e265005c839..9badc779176ac642f1bba891e452f1401487f144 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function alphabetIndexerOnSelectJsunit() { @@ -23,7 +23,7 @@ export default function alphabetIndexerOnSelectJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/alphabetIndexer', + uri: 'MainAbility/pages/alphabetIndexer', } try { router.clear(); @@ -160,7 +160,7 @@ export default function alphabetIndexerOnSelectJsunit() { console.info("[testalphabetIndexerPopupBackground0007] component lineHeight strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('AlphabetIndexer'); - expect(obj.$attrs.popupBackground).assertEqual("#E500DDDD"); + expect(obj.$attrs.popupBackground).assertEqual("#FF00DDDD"); console.info("[testalphabetIndexerPopupBackground0007] popupBackground value :" + obj.$attrs.popupBackground); done(); }); @@ -177,7 +177,7 @@ export default function alphabetIndexerOnSelectJsunit() { console.info("[testalphabetIndexerUsingPopup0009] component padding strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('AlphabetIndexer'); - expect(obj.$attrs.usingPopup).assertEqual(true); + expect(obj.$attrs.usingPopup).assertEqual('true'); console.info("[testalphabetIndexerUsingPopup0009] usingPopup value :" + obj.$attrs.usingPopup); done(); }); @@ -194,7 +194,7 @@ export default function alphabetIndexerOnSelectJsunit() { console.info("[testalphabetIndexerItemSize0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('AlphabetIndexer'); - expect(obj.$attrs.itemSize).assertEqual("28.000000"); + expect(obj.$attrs.itemSize).assertEqual("28.00vp"); console.info("[testalphabetIndexerItemSize0010] itemSize value :" + obj.$attrs.itemSize); done(); }); @@ -211,7 +211,7 @@ export default function alphabetIndexerOnSelectJsunit() { console.info("[testalphabetIndexerAlignStyle0011] component strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('AlphabetIndexer'); - expect(obj.$attrs.alignStyle).assertEqual("AlignStyle.Left"); + expect(obj.$attrs.alignStyle).assertEqual("IndexerAlign.Left"); console.info("[testalphabetIndexerItemSize0010] alignStyle value :" + obj.$attrs.alignStyle); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets index a5dafdaaaaa17c6273d18c0feaacd43ceaafb909..cde9b20c3f3ab3cbb6eccf6e60109b89436b9587 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function checkBoxGroupSelectAllJsunit() { @@ -23,7 +23,7 @@ export default function checkBoxGroupSelectAllJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/checkBoxGroup', + uri: 'MainAbility/pages/checkBoxGroup', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets index 8103bd827ba1ad14121dfb88edc8957dc26c99d9..6799ffb223c8815879f5a09f54b2dcc0ea40a737 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function circleNewJsunit() { @@ -22,7 +22,7 @@ export default function circleNewJsunit() { beforeAll(async function (done) { console.info("circle beforeEach start"); let options = { - uri: 'pages/circle', + uri: 'MainAbility/pages/circle', } try { router.clear(); @@ -56,7 +56,7 @@ export default function circleNewJsunit() { let strJson = getInspectorByKey('circle'); console.info("[testcircleNew001] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Circle'); expect(obj.$attrs.width).assertEqual("100.00px"); console.info("[testcircleNew001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function circleNewJsunit() { let strJson = getInspectorByKey('circle'); console.info("[testcircleNew002] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Circle'); expect(obj.$attrs.height).assertEqual("100.00px"); console.info("[testcircleNew002] width value :" + obj.$attrs.width); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets index 71a6d9ac64b0fbad1f47e35e5a8cf56776e4be65..b00523f157fa63ef5cbe9faec390e07b01d2a541 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "hypium/index" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import Utils from './Utils.ets' export default function commonBackgroundBlurStyleJsunit() { @@ -22,7 +22,7 @@ export default function commonBackgroundBlurStyleJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/common', + uri: 'MainAbility/pages/common', } try { router.clear(); @@ -73,8 +73,8 @@ export default function commonBackgroundBlurStyleJsunit() { repeat: RepeatMode.Stretch, fill: false }; - expect(obj.$attrs.borderImage).assertEqual(undefined); - console.info("[testcommonBackgroundBlurStyle001] borderImage value :" + JSON.stringify(obj.$attrs.borderImage)); + let jsonObject = JSON.parse(obj.$attrs.borderImage); + expect(jsonObject.width).assertEqual("10.00px"); done(); }); @@ -90,7 +90,7 @@ export default function commonBackgroundBlurStyleJsunit() { console.info("[testcommonBackgroundBlurStyle002] component tabIndex strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.tabIndex).assertEqual(undefined); + expect(obj.$attrs.tabIndex).assertEqual(1); console.info("[testcommonBackgroundBlurStyle002] tabIndex value :" + obj.$attrs.textAlign); done(); }); @@ -148,7 +148,8 @@ export default function commonBackgroundBlurStyleJsunit() { let strJson = getInspectorByKey('backgroundBlurStyleText'); console.info("[testcommonBackgroundBlurStyle005] component backgroundBlurStyle strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined); + let testL = obj.$attrs.backgroundBlurStyle; + expect(testL instanceof Object).assertTrue(); console.info("[testcommonBackgroundBlurStyle005] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle); done(); }); @@ -175,7 +176,7 @@ export default function commonBackgroundBlurStyleJsunit() { let strJson = getInspectorByKey('hoverEffectText'); console.info("[testcommonHoverEffectHighlight0001] component hoverEffect strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$attrs.hoverEffect).assertEqual(undefined); + expect(obj.$attrs.hoverEffect).assertEqual('HoverEffect.Highlight'); console.info("[testcommonHoverEffectHighlight0001] hoverEffect value :" + obj.$attrs.hoverEffect); done(); }); @@ -191,7 +192,7 @@ export default function commonBackgroundBlurStyleJsunit() { let strJson = getInspectorByKey('hoverEffectScaleText'); console.info("[testcommonHoverEffectScale0001] component hoverEffect strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$attrs.hoverEffect).assertEqual(undefined); + expect(obj.$attrs.hoverEffect).assertEqual('HoverEffect.Scale'); console.info("[testcommonHoverEffectScale0001] hoverEffect value :" + obj.$attrs.hoverEffect); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets index f708fc0574a856c56091739b1af6bc3c6cc948bf..1b3d97d91cc3ce1c455909be91f4a1145d1b30fe 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import font from '@ohos.font' @@ -24,7 +24,7 @@ export default function common_ts_ets_apiStaticClearJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/common_ts_ets_api', + uri: 'MainAbility/pages/common_ts_ets_api', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/AlphabetIndexerJsunit.test_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/AlphabetIndexerJsunit.test_y.ets index 58effbc39261b0ae3fd77f10221b4a4b13743127..0fb23a19bbe38771cafce9e0859459621669d5e6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/AlphabetIndexerJsunit.test_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/AlphabetIndexerJsunit.test_y.ets @@ -1,6 +1,6 @@ // @ts-nocheck /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosPromptJsunit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosPromptJsunit.test.ets index 305059547bec38a4c23af658c0b60f12333ec839..1116bc2a2eaea7a75727a39fd1767f722017a60c 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosPromptJsunit.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosPromptJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosRouterJsnuit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosRouterJsnuit.test.ets index afdea6850f6eb02805a2170ce4c36e48ab550086..527cae775f82bc4a5b2f4957624f5cc8d64d61d5 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosRouterJsnuit.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/OhosRouterJsnuit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/PositionSettingJsunit_y.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/PositionSettingJsunit_y.test.ets index 9349f9b77abd4ccfafc2cd01ea735b79ac2cad6c..4eeeea6ba97d7092009d1d10a058c34a22a48f09 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/PositionSettingJsunit_y.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/PositionSettingJsunit_y.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/ShapeClippingJsunit_y.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/ShapeClippingJsunit_y.test.ets index 41aa609d10572a269b1bd1982f5b3ff662a1a0de..4e699070bf674f488624396aa734e618058767d3 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/ShapeClippingJsunit_y.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/ShapeClippingJsunit_y.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/WebJsunit.test_g.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/WebJsunit.test_g.ets index c80747ca465409a0d0b17f7fcc2c48d6fd7b899c..a47be65edfc6139d5a0daec929b346b2ed89840c 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/WebJsunit.test_g.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/componettest/WebJsunit.test_g.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets index b88e91194994842e54df01ecec234eff0aa5666b..1fa542efa5e37f647004bf37680ce45cd521bd9e 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function curvesStepsJsunit() { @@ -29,7 +29,7 @@ export default function curvesStepsJsunit() { let result; let options = { - uri: 'pages/curves' + uri: 'MainAbility/pages/curves' } try { result = router.push(options) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets index e0ec74a398c381554af21da2acf80478d6f98616..acc4336df5a6c735802a8b37d3586a18d09177eb 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function ellipseNeJsunit() { @@ -22,7 +22,7 @@ export default function ellipseNeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/ellipse', + uri: 'MainAbility/pages/ellipse', } try { router.clear(); @@ -56,7 +56,7 @@ export default function ellipseNeJsunit() { let strJson = getInspectorByKey('ellipse'); console.info("[testellipseNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Ellipse'); expect(obj.$attrs.width).assertEqual("300.00px"); console.info("[testellipseNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function ellipseNeJsunit() { let strJson = getInspectorByKey('ellipse'); console.info("[testellipseNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Ellipse'); expect(obj.$attrs.height).assertEqual("300.00px"); console.info("[testellipseNe0002] height value :" + obj.$attrs.height); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets index f62604e03f4e86c095c7153b659433aac35ff0ac..dae0bad8729f085ba9f0b9152f37c0c62502a2cb 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function featureAbilityStartAbilityJsunit() { @@ -22,7 +22,7 @@ export default function featureAbilityStartAbilityJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/featureAbility', + uri: 'MainAbility/pages/featureAbility', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets index ae819ae0bccb40f6f6c6f07f9ce34ab0883c91ea..1813a6ab15d1ffd1b093bf05f8371bf75d44fa4f 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gaugeColorsJsunit() { @@ -22,7 +22,7 @@ export default function gaugeColorsJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gauge', + uri: 'MainAbility/pages/gauge', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets index b5859c8793b8d35a775a2581e4f840dbace13fbe..f36033d486093f54b689b8460cb14bfb15c316f6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gestureSetDirectionJsunit() { @@ -23,7 +23,7 @@ export default function gestureSetDirectionJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gesture', + uri: 'MainAbility/pages/gesture', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets index e0ed2bfefaf2e86faa0885cfa7da6f529d747b6a..3d9c3a19322b59ae5e240ad2c8a3a344e2b392cb 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets @@ -16,7 +16,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function globalJsunit() { @@ -24,7 +24,7 @@ export default function globalJsunit() { beforeEach(async function (done) { console.info("global beforeEach start"); let options = { - uri: 'pages/global', + uri: 'MainAbility/pages/global', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets index 137a40f4813114592cc0c84d03d3b1699b7e3bd3..9f590e5c0961e86913e73c1ac3254f9fc9dc2bd2 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gridMaxCountJsunit() { @@ -23,7 +23,7 @@ export default function gridMaxCountJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/grid', + uri: 'MainAbility/pages/grid', } try { router.clear(); @@ -50,11 +50,10 @@ export default function gridMaxCountJsunit() { console.info('testcheckgridMaxCount testcheckgridMaxCount0001 START'); await Utils.sleep(2000); let strJson = getInspectorByKey('maxCountTest'); - console.info("[testcheckgridMaxCount0001] component selectedMaxcount strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Grid'); - expect(obj.$attrs.maxCount).assertEqual("5"); console.info("[testcheckgridMaxCount0001] selectedMaxCount value :" + obj.$attrs.maxCount); + expect(obj.$attrs.maxCount).assertEqual("5"); done(); }); }) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets index 62ea6348b9b60b90400d38c2152ecbe26488703e..2ba31379d5bc7aaa34e7ec4bb058c05396c12f7a 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets @@ -15,7 +15,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -24,7 +24,7 @@ export default function gridItemOnSelectJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gridItem', + uri: 'MainAbility/pages/gridItem', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets index 13bbd28b904957798da51e9508a1aeaf94f3abb4..026f35f3913a0347b6919ed5f3388df9418999a5 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function grid_colSpanJsunit() { @@ -22,7 +22,7 @@ export default function grid_colSpanJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/grid_col', + uri: 'MainAbility/pages/grid_col', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets index 26ce142740b502d35bde75e70285f52a53e268b2..bc7a62c64f58a17da960f064f0e942825edba8ce 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function grid_rowOnBreakpointChangeJsunit() { @@ -22,7 +22,7 @@ export default function grid_rowOnBreakpointChangeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/grid_row', + uri: 'MainAbility/pages/grid_row', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets index 7e069eeed4342bf4795a7bd31d74464b14698e2c..d909ded5d726f7681edc44425da05e85b93bbd31 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function inspectorJsunit() { @@ -23,7 +23,7 @@ export default function inspectorJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/inspector', + uri: 'MainAbility/pages/inspector', } try { router.clear(); @@ -134,11 +134,13 @@ export default function inspectorJsunit() { }catch(err){ console.info("inspector_102 on events_emitter err : " + JSON.stringify(err)); } - done(); + } try{ console.info("inspector_102 click result is: " + JSON.stringify(sendEventByKey('inspectorApiTwo', 10, ""))); events_emitter.on(innerEvent2, callback2); + await Utils.sleep(2000); + done(); }catch(err){ console.info("inspector_102 on events_emitter err : " + JSON.stringify(err)); } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets index b7843c5e44f2cb038e08470d3e069dcef9edf08d..9dd74b2b14d0a03eaab071dbeb425d4db4ed6b1b 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function lazyForEachOnDataAddJsunit() { @@ -23,7 +23,7 @@ export default function lazyForEachOnDataAddJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/lazyForEach', + uri: 'MainAbility/pages/lazyForEach', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets index 20958552a1e7dc2fc888f9b4ccad40bbf43402b9..2e3cae30913b1710fabfb7cf117707981fd377f5 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function lineNeJsunit() { @@ -22,7 +22,7 @@ export default function lineNeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/line', + uri: 'MainAbility/pages/line', } try { router.clear(); @@ -56,7 +56,7 @@ export default function lineNeJsunit() { let strJson = getInspectorByKey('line1'); console.info("[testlineNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Line'); expect(obj.$attrs.width).assertEqual("50.00vp"); console.info("[testlineNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function lineNeJsunit() { let strJson = getInspectorByKey('line1'); console.info("[testlineNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Line'); expect(obj.$attrs.height).assertEqual("100.00vp"); console.info("[testlineNe0002] height value :" + obj.$attrs.height); done(); @@ -90,7 +90,7 @@ export default function lineNeJsunit() { let strJson = getInspectorByKey('line2'); console.info("[testlineNe0005] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Line'); expect(obj.$attrs.width).assertEqual("200.00vp"); console.info("[testlineNe0005] width value :" + obj.$attrs.width); done(); @@ -107,7 +107,7 @@ export default function lineNeJsunit() { let strJson = getInspectorByKey('line2'); console.info("[testlineNe0006] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Line'); expect(obj.$attrs.height).assertEqual("200.00vp"); console.info("[testlineNe0006] height value :" + obj.$attrs.height); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets index 83a3668e78ebb7c00baa571a1113a9ae9d2f5621..dcc6b423b7599ee8ae6af7892e181925b117f123 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function listNewJsunit() { @@ -23,7 +23,7 @@ export default function listNewJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/list', + uri: 'MainAbility/pages/list', } try { router.clear(); @@ -92,7 +92,7 @@ export default function listNewJsunit() { console.info("[testListNe0003] component editMode strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.editMode).assertEqual("true"); + expect(obj.$attrs.editMode).assertTrue(); console.info("[testListNe0003] editMode value :" + obj.$attrs.editMode); done(); }); @@ -109,7 +109,7 @@ export default function listNewJsunit() { console.info("[testListNe0004] component alignListItem strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.alignListItem).assertEqual(undefined); + expect(obj.$attrs.alignListItem).assertEqual("ListItemAlign.Start"); console.info("[testListNe0004] alignListItem value :" + obj.$attrs.alignListItem); done(); }); @@ -119,14 +119,14 @@ export default function listNewJsunit() { * @tc.name testListNe0006 * @tc.desic acelistNeEtsTest0006 */ - it('testListNe0006', 0, async function (done) { + it('testListNe0005', 0, async function (done) { console.info('listNe testListNe0006 START'); await Utils.sleep(2000); let strJson = getInspectorByKey('list1'); console.info("[testListNe0006] component lanes strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.lanes).assertEqual(undefined); + expect(obj.$attrs.lanes).assertEqual('0'); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); done(); }); @@ -143,7 +143,7 @@ export default function listNewJsunit() { console.info("[testListNe0006] component lanes strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.lanes).assertEqual(undefined); + expect(obj.$attrs.lanes).assertEqual('0'); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets index 4520c9cbda705b24d154d9958b84161f4ed6a223..3e2392fd75112851e5312a1be1a89802b55d12f6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function list_itemOnSelectJsunit() { @@ -23,7 +23,7 @@ export default function list_itemOnSelectJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/list_item', + uri: 'MainAbility/pages/list_item', } try { router.clear(); @@ -75,7 +75,7 @@ export default function list_itemOnSelectJsunit() { console.info("[testlist_itemOnSelect0002] component border strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('ListItem'); - expect(obj.$attrs.selectable).assertEqual("false"); + expect(obj.$attrs.selectable).assertFalse(); console.info("[testlist_itemOnSelect0002] selectable value :" + obj.$attrs.selectable); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets index c4db15026871176dcea7f84edbd896b8c7a4c46e..d46b2759688904303c906190246e2c3ce9207ac6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -29,7 +29,7 @@ export default function mediaQueryOffJsunit() { let result; let options = { - uri: 'pages/mediaQuery' + uri: 'MainAbility/pages/mediaQuery' } try { result = router.push(options) @@ -197,7 +197,7 @@ export default function mediaQueryOffJsunit() { console.info("[testmediaQueryOff0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testmediaQueryOff0010] textAlign value :" + obj.$attrs.textAlign); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets index 540890439a82bd6e9d07bb4d07c0de06d79d560e..fcbffd90dde049921ff3f424e306e84e5ce3e70a 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function navigatorTargetJsunit() { @@ -22,7 +22,7 @@ export default function navigatorTargetJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/navigator', + uri: 'MainAbility/pages/navigator', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets index fac4fc55c035f646fafff3627baef2740edb0cc8..305fc8077c324ee4dea4ac4abdf329743facd8ce 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets @@ -23,7 +23,7 @@ export default function pageRouteTest() { beforeEach(async function (done) { console.info("pageRouteTest beforeEach start"); let options = { - uri: 'pages/pageRoute', + uri: 'MainAbility/pages/pageRoute', } let result; try { @@ -65,6 +65,7 @@ export default function pageRouteTest() { console.info("[testOnPageHide01] on events_emitter err : " + JSON.stringify(err)); } console.info('[testOnPageHide01] testSendTouchEvent END'); + done(); }); }) } \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets index 07d434e17712d6c5d0703b7af9c1b368ee92fd27..c579ffac0134ef4111ecef3ea677d38767386263 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function panelBackgroundMaskJsunit() { @@ -23,7 +23,7 @@ export default function panelBackgroundMaskJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/panel', + uri: 'MainAbility/pages/panel', } try { router.clear(); @@ -60,7 +60,7 @@ export default function panelBackgroundMaskJsunit() { console.log(JSON.stringify(obj.$type)) expect(obj.$type).assertEqual('Panel') console.log('Panel‘s backgroundMask is ' + JSON.stringify(obj.$attrs.backgroundMask)) - expect(obj.$attrs.backgroundMask).assertEqual('#FFFF0000'); + expect(obj.$attrs.backgroundMask).assertEqual('#FF00FF00'); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets index 53d8c756b002df03d66d5b886ae26d137f618e08..bfbefa2be4440073ec871bd9b09d54b8f091a0e1 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function pathNewTest() { @@ -22,7 +22,7 @@ export default function pathNewTest() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/path', + uri: 'MainAbility/pages/path', } try { router.clear(); @@ -56,7 +56,7 @@ export default function pathNewTest() { let strJson = getInspectorByKey('Path'); console.info("[testpathNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Path'); expect(obj.$attrs.width).assertEqual("100.00px"); console.info("[testpathNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function pathNewTest() { let strJson = getInspectorByKey('Path'); console.info("[testpathNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Path'); expect(obj.$attrs.height).assertEqual("100.00px"); console.info("[testpathNe0002] height value :" + obj.$attrs.height); done(); @@ -90,7 +90,7 @@ export default function pathNewTest() { let strJson = getInspectorByKey('Path'); console.info("[testpathNe0003] component fontSize strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Path'); expect(obj.$attrs.commands).assertEqual("M150 0 L300 300 L0 300 Z"); console.info("[testpathNe0003] commands value :" + obj.$attrs.commands); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets index 1f871bf4713138bb3cb70684378ddfe13f8f0c9c..9e337ae671c9032bb0a578c2c1c778b740324c80 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function polyLineNeJsunit() { @@ -22,7 +22,7 @@ export default function polyLineNeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/polyLine', + uri: 'MainAbility/pages/polyLine', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets index 24d6c478f48d7cf54d67271e5eee6dc85cc9f055..aa7bae1067afc2eb828d5ea720ef5ec677716a19 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function polygonNewJsunit() { @@ -22,7 +22,7 @@ export default function polygonNewJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/polygon', + uri: 'MainAbility/pages/polygon', } try { router.clear(); @@ -56,7 +56,7 @@ export default function polygonNewJsunit() { let strJson = getInspectorByKey('Polygon'); console.info("[testpolygonNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Polygon'); expect(obj.$attrs.width).assertEqual("100.00px"); console.info("[testpolygonNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function polygonNewJsunit() { let strJson = getInspectorByKey('Polygon'); console.info("[testpolygonNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Polygon'); expect(obj.$attrs.height).assertEqual("100.00px"); console.info("[testpolygonNe0002] height value :" + obj.$attrs.height); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets index a01034c224cc8c3a2c46db398abbc6323d9b5945..c546dca80873e8e5dcdbad446b80f555f373ed60 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function progressStyleJsunit() { @@ -22,7 +22,7 @@ export default function progressStyleJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/progress', + uri: 'MainAbility/pages/progress', } try { router.clear(); @@ -108,8 +108,9 @@ export default function progressStyleJsunit() { console.info("[testprogressStyle0004] component style strokeWidth strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Progress'); - expect(obj.$attrs.style.strokeWidth).assertEqual("20.00vp"); - console.info("[testprogressStyle0004] style strokeWidth value :" + obj.$attrs.style.strokeWidth); + console.info("[testprogressStyle0004] component style strokeWidth strJson:" + obj.$attrs.style); + let jsonObject = JSON.parse(obj.$attrs.style); + expect(jsonObject.strokeWidth).assertEqual("20.00vp"); done(); }); @@ -125,8 +126,8 @@ export default function progressStyleJsunit() { console.info("[testprogressStyle0005] component style scaleCount strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Progress'); - expect(obj.$attrs.style.scaleCount).assertEqual("30"); - console.info("[testprogressStyle0005] style scaleCount value :" + obj.$attrs.style.scaleCount); + let jsonObject = JSON.parse(obj.$attrs.style); + expect(jsonObject.scaleCount).assertEqual("30"); done(); }); @@ -142,8 +143,8 @@ export default function progressStyleJsunit() { console.info("[testprogressStyle0006] component style scaleWidth strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Progress'); - expect(obj.$attrs.style.scaleWidth).assertEqual("20.00vp"); - console.info("[testprogressStyle0006] style scaleWidth value :" + obj.$attrs.style.scaleWidth); + let jsonObject = JSON.parse(obj.$attrs.style); + expect(jsonObject.scaleWidth).assertEqual("20.00vp"); done(); }); }) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets index 459ef283f67d03cce873afa1605f66f1a0c1be12..5130dd1776677b51c36d304fb32690930bb5f709 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function promptShowDialogJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/prompt', + uri: 'MainAbility/pages/prompt', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets index 10604cdf8e57a4256924de2e4762fcabe2b217cf..933aeda34c603215a9c227d581b84a46a7618364 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function rectNeJsunit() { @@ -22,7 +22,7 @@ export default function rectNeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/rect', + uri: 'MainAbility/pages/rect', } try { router.clear(); @@ -56,7 +56,7 @@ export default function rectNeJsunit() { let strJson = getInspectorByKey('Rect'); console.info("[testrectNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Rect'); expect(obj.$attrs.width).assertEqual("90.00%"); console.info("[testrectNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function rectNeJsunit() { let strJson = getInspectorByKey('Rect'); console.info("[testrectNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Rect'); expect(obj.$attrs.height).assertEqual("50.00px"); console.info("[testrectNe0002] height value :" + obj.$attrs.height); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets index 19fc8d379ece82fa719317c5b0875a97c68f072f..468e6037e05187737ca2f16afb12231055408b03 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function scrollOnScrollBeginJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/scroll', + uri: 'MainAbility/pages/scroll', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets index 567a45048076c18d9b7e42936d9204bc297ab421..870eb37f05016ea3bf926816b7f9abd95850db9b 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function searchOnCutJsunit() { @@ -22,7 +22,7 @@ export default function searchOnCutJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/search', + uri: 'MainAbility/pages/search', } try { router.clear(); @@ -193,7 +193,7 @@ export default function searchOnCutJsunit() { console.info("[testsearchOnCut0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testsearchOnCut0010] textAlign value :" + obj.$attrs.textAlign); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets index bbefe189d4fc7e9672cc7b5c1db22b77cffd6d5e..5eae8014fe48f954fc0dac8cc3625dd1aab98e6b 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function selectOnSelectJsunit() { @@ -23,7 +23,7 @@ export default function selectOnSelectJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/select', + uri: 'MainAbility/pages/select', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets index 73bdb6e5f9224f1ffc34a1f2f2741f76ab5e926b..38ad0895176eee5d2c3eceb5c867ef1a46fb4763 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function sideBarShowSideBarJsunit() { @@ -22,7 +22,7 @@ export default function sideBarShowSideBarJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/sideBar', + uri: 'MainAbility/pages/sideBar', } try { router.clear(); @@ -74,7 +74,7 @@ export default function sideBarShowSideBarJsunit() { console.info("[testsideBarShowSideBar0002] component autoHide strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('SideBarContainer'); - expect(obj.$attrs.autoHide).assertEqual(undefined); + expect(obj.$attrs.autoHide).assertEqual('false'); console.info("[testsideBarShowSideBar0002] autoHide value :" + obj.$attrs.autoHide); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets index b3e2c91c61ad7dd62dd94b6f186f3ee43d3285cf..7e86c72aaa0d3f560bdd8177f9ef232a0b06b246 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function stackAlignContentJsunit() { @@ -22,7 +22,7 @@ export default function stackAlignContentJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/stack', + uri: 'MainAbility/pages/stack', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets index e61fbd0234876992e03a6f1d9c15c9cbcfcd7cf3..c2750384cabec6769bee5145352efac9e76e96f2 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function stateManagementGetSharedJsunit() { @@ -23,7 +23,7 @@ export default function stateManagementGetSharedJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/stateManagement', + uri: 'MainAbility/pages/stateManagement', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets index d1ab4f572a3eb7f680c176b3676e7dc3c9403670..3868adbbb8459f7800446921f19c2effb0f93b61 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function swiperCurveJsunit() { @@ -22,7 +22,7 @@ export default function swiperCurveJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/swiper', + uri: 'MainAbility/pages/swiper', } try { router.clear(); @@ -142,7 +142,9 @@ export default function swiperCurveJsunit() { console.info("[testswiperCurve0006] component indicator strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Swiper'); - expect(obj.$attrs.indicator).assertEqual("true"); + let testObj = obj.$attrs.indicator; + console.info("curve006_" + testObj); + expect(testObj).assertTrue(); console.info("[testswiperCurve0006] indicator value :" + obj.$attrs.indicator); done(); }); @@ -176,7 +178,7 @@ export default function swiperCurveJsunit() { console.info("[testswiperCurve0008] component duration strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Swiper'); - expect(obj.$attrs.duration).assertEqual("1000.000000"); + expect(obj.$attrs.duration).assertEqual("1000"); console.info("[testswiperCurve0008] duration value :" + obj.$attrs.duration); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets index c73b2403af693e5b1501072b746a50e633c5b201..e6f0944756d104f4becb24a5cbb2451f923633ac 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function tabsBarPositionJsunit() { @@ -22,7 +22,7 @@ export default function tabsBarPositionJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/tabs', + uri: 'MainAbility/pages/tabs', } try { router.clear(); @@ -193,7 +193,7 @@ export default function tabsBarPositionJsunit() { console.info("[testtabsBarPosition0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets index 2e0706dd05482641d5123ede0d0cb5b380b2f775..6ef06d10eccf0cc079a009b56ee260912c9166c2 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function textMinFontSizeJsunit() { @@ -22,7 +22,7 @@ export default function textMinFontSizeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/text', + uri: 'MainAbility/pages/text', } try { router.clear(); @@ -194,7 +194,7 @@ export default function textMinFontSizeJsunit() { console.info("[testtextMinFontSize0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testtextMinFontSize0010] textAlign value :" + obj.$attrs.textAlign); done(); }); @@ -206,7 +206,7 @@ export default function textMinFontSizeJsunit() { console.info("[testtextMinFontSize0011] component minFontSize strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.minFontSize).assertEqual(undefined); + expect(obj.$attrs.minFontSize).assertEqual("50.00px"); console.info("[testtextMinFontSize0011] minFontSize value :" + obj.$attrs.minFontSize); done(); }); @@ -218,7 +218,7 @@ export default function textMinFontSizeJsunit() { console.info("[testtextCopyOptionText0001] component copyOption strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.copyOption).assertEqual(undefined); + expect(obj.$attrs.copyOption).assertEqual("CopyOptions.None"); console.info("[testtextCopyOptionText0001] copyOption value :" + obj.$attrs.copyOption); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets index d109dcb851f57e3a50c6fddc55dfb13afc70c65d..d60341930f089101c43add7e958ef217028f7ee0 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function textAreaOnCutJsunit() { @@ -22,7 +22,7 @@ export default function textAreaOnCutJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/textArea', + uri: 'MainAbility/pages/textArea', } try { router.clear(); @@ -176,7 +176,7 @@ export default function textAreaOnCutJsunit() { console.info("[testtextAreaOnCut0009] component padding strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextArea'); - expect(obj.$attrs.padding).assertEqual("0.00px"); + expect(obj.$attrs.padding).assertEqual("10.00vp"); console.info("[testtextAreaOnCut0009] padding value :" + obj.$attrs.padding); done(); }); @@ -210,7 +210,7 @@ export default function textAreaOnCutJsunit() { console.info("[testtextAreaCopyOption0011] component copyOption strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextArea'); - expect(obj.$attrs.copyOption).assertEqual(undefined); + expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); console.info("[testtextAreaCopyOption0011] copyOption value :" + obj.$attrs.copyOption); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets index a5225f0775f78bde9e27497563b8dc506a6b5021..2aaa246d213b4e697bb69582d22227bd00adf6d1 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function textInputOnEditChangeJsunit() { @@ -22,7 +22,7 @@ export default function textInputOnEditChangeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/textInput', + uri: 'MainAbility/pages/textInput', } try { router.clear(); @@ -176,7 +176,7 @@ export default function textInputOnEditChangeJsunit() { console.info("[testtextInputOnEditChange0009] component padding strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextInput'); - expect(obj.$attrs.padding).assertEqual("0.00px"); + expect(obj.$attrs.padding).assertEqual("10.00vp"); console.info("[testtextInputOnEditChange0009] padding value :" + obj.$attrs.padding); done(); }); @@ -193,7 +193,7 @@ export default function textInputOnEditChangeJsunit() { console.info("[testtextInputOnEditChange0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextInput'); - expect(obj.$attrs.textAlign).assertEqual(undefined); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign); done(); }); @@ -205,7 +205,7 @@ export default function textInputOnEditChangeJsunit() { console.info("[testtextInputCopyOption0001] component copyOption strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextInput'); - expect(obj.$attrs.copyOption).assertEqual(undefined); + expect(obj.$attrs.copyOption).assertEqual("CopyOptions.None"); console.info("[testtextInputCopyOption0001] copyOption value :" + obj.$attrs.copyOption); done(); }); @@ -217,7 +217,7 @@ export default function textInputOnEditChangeJsunit() { console.info("[testtextInputShowPasswordIcon0001] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextInput'); - expect(obj.$attrs.showPasswordIcon).assertEqual(undefined); + expect(obj.$attrs.showPasswordIcon).assertTrue(); console.info("[testtextInputShowPasswordIcon0001] showPasswordIcon value :" + obj.$attrs.showPasswordIcon); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets index 2c48faf0096ac00e2a0e81ee37968b3aa80323b0..620d49efaec1f9142645a8322a0009864962b73d 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function textPickerDefaultPickerItemHeightJsunit() { @@ -22,7 +22,7 @@ export default function textPickerDefaultPickerItemHeightJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/textPicker', + uri: 'MainAbility/pages/textPicker', } try { router.clear(); @@ -176,7 +176,7 @@ export default function textPickerDefaultPickerItemHeightJsunit() { console.info("[testtextPickerDefaultPickerItemHeight0009] component padding strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('TextPicker'); - expect(obj.$attrs.padding).assertEqual("0.00px"); + expect(obj.$attrs.padding).assertEqual("0.00vp"); console.info("[testtextPickerDefaultPickerItemHeight0009] padding value :" + obj.$attrs.padding); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets index 119e66d8d1b2707d424dafd866d98fbb3d6fe88e..3e50ddf926a5c0eaaded9202e5cf3d29951d3bb0 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function videoOnFullscreenChangeJsunit() { @@ -23,7 +23,7 @@ export default function videoOnFullscreenChangeJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/video', + uri: 'MainAbility/pages/video', } try { router.clear(); @@ -177,7 +177,7 @@ export default function videoOnFullscreenChangeJsunit() { console.info("[testvideoOnFullscreenChange0009] component padding strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Video'); - expect(obj.$attrs.padding).assertEqual("0.00px"); + expect(obj.$attrs.padding).assertEqual("0.00vp"); console.info("[testvideoOnFullscreenChange0009] padding value :" + obj.$attrs.padding); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets index 9c81590f4103627bbaad237e49620dae016dcbbd..53a73cf7ced2a363b9ef57b5cce082a96c31ce0d 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function webGetTitleJsunit() { @@ -22,7 +22,7 @@ export default function webGetTitleJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/web', + uri: 'MainAbility/pages/web', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets index 7673cee33e4cdea09323f37823f9b273bb48531e..beb75cad3c335e956cf0861ff61860ca556efa95 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function xcomponentGetXComponentContextJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/xcomponent', + uri: 'MainAbility/pages/xcomponent', } try { router.clear(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/module.json b/arkui/ace_ets_component_apilack/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..76cc5e5e6be9de829a72095d038168a6ab43224d --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/module.json @@ -0,0 +1,35 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.open.harmony.aceEtsApiLack.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 diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json index ea42b011821112702135f8fa17059eec183ef638..df38772969be0d5509b39bb2ae990eefded26617 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json +++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json @@ -27,6 +27,34 @@ { "name":"message_arrive", "value":"We will arrive at %s." - } + }, + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } ] } \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..74150e7f68cb1bbf35ec006e7726befcb59c0f88 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,62 @@ +{ + "src": [ + "MainAbility/pages/index", + "MainAbility/pages/index/index", + "MainAbility/pages/abilityComponent", + "MainAbility/pages/alphabetIndexer", + "MainAbility/pages/checkBoxGroup", + "MainAbility/pages/circle", + "MainAbility/pages/common", + "MainAbility/pages/common_ts_ets_api", + "MainAbility/pages/curves", + "MainAbility/pages/dom", + "MainAbility/pages/ellipse", + "MainAbility/pages/featureAbility", + "MainAbility/pages/focusControl", + "MainAbility/pages/form_component", + "MainAbility/pages/gauge", + "MainAbility/pages/global", + "MainAbility/pages/grid", + "MainAbility/pages/grid_col", + "MainAbility/pages/grid_row", + "MainAbility/pages/gridItem", + "MainAbility/pages/image", + "MainAbility/pages/inspector", + "MainAbility/pages/lazyForEach", + "MainAbility/pages/line", + "MainAbility/pages/list", + "MainAbility/pages/list_item", + "MainAbility/pages/mediaQuery", + "MainAbility/pages/navigator", + "MainAbility/pages/onVisibleAreaChange", + "MainAbility/pages/page1", + "MainAbility/pages/pageRoute", + "MainAbility/pages/page_transition", + "MainAbility/pages/panel", + "MainAbility/pages/path", + "MainAbility/pages/pluginComponent", + "MainAbility/pages/polygon", + "MainAbility/pages/polyLine", + "MainAbility/pages/progress", + "MainAbility/pages/prompt", + "MainAbility/pages/rect", + "MainAbility/pages/router", + "MainAbility/pages/scroll", + "MainAbility/pages/search", + "MainAbility/pages/select", + "MainAbility/pages/shape", + "MainAbility/pages/sideBar", + "MainAbility/pages/stack", + "MainAbility/pages/stateManagement", + "MainAbility/pages/swiper", + "MainAbility/pages/tabs", + "MainAbility/pages/text", + "MainAbility/pages/textArea", + "MainAbility/pages/textInput", + "MainAbility/pages/textPicker", + "MainAbility/pages/uiAppearance", + "MainAbility/pages/video", + "MainAbility/pages/web", + "MainAbility/pages/xcomponent" + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/AppScope/app.json b/arkui/ace_ets_component_attrlack/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..f390cf727d2bb9fc558c8d6153d080e0e107e390 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.open.harmony.aceEtsAttrLack", + "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 diff --git a/arkui/ace_ets_component_attrlack/AppScope/resources/base/element/string.json b/arkui/ace_ets_component_attrlack/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_component_attrlack/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/arkui/ace_ets_component_attrlack/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_component_attrlack/BUILD.gn b/arkui/ace_ets_component_attrlack/BUILD.gn index afada8b8fbb59d885f37f9ff3b48eddceee06925..a630edca310990d5c05c13008fb5157ee76d1521 100644 --- a/arkui/ace_ets_component_attrlack/BUILD.gn +++ b/arkui/ace_ets_component_attrlack/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,23 +14,27 @@ import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsAceEtsAttrLackTest") { - hap_profile = "./entry/src/main/config.json" + hap_profile = "entry/src/main/module.json" + js_build_mode = "debug" deps = [ ":ace_ets_dev_assets", ":ace_ets_dev_resources", - ":ace_ets_dev_test_assets", ] ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsAceEtsAttrLackTest" } ohos_js_assets("ace_ets_dev_assets") { - source_dir = "./entry/src/main/ets/MainAbility" + source_dir = "entry/src/main/ets" } -ohos_js_assets("ace_ets_dev_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" + +ohos_app_scope("ace_ets_dev_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] } + ohos_resources("ace_ets_dev_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "entry/src/main/resources" ] + deps = [ ":ace_ets_dev_app_profile" ] + hap_profile = "entry/src/main/module.json" } diff --git a/arkui/ace_ets_component_attrlack/Test.json b/arkui/ace_ets_component_attrlack/Test.json index 7603408bb5f60b10633cea101e5eda2d1cad05f6..6a6ef2b0515569a39316d7bedbb44e21fb12e88b 100644 --- a/arkui/ace_ets_component_attrlack/Test.json +++ b/arkui/ace_ets_component_attrlack/Test.json @@ -1,10 +1,10 @@ { - "description": "Configuration for aceEtsAttrLack Tests", + "description": "Configuration for hjunit demo Tests", "driver": { "type": "OHJSUnitTest", "test-timeout": "600000", "bundle-name": "com.open.harmony.aceEtsAttrLack", - "package-name": "com.open.harmony.aceEtsAttrLack", + "module-name": "phone", "shell-timeout": "600000", "testcase-timeout":"10000" }, diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/config.json b/arkui/ace_ets_component_attrlack/entry/src/main/config.json deleted file mode 100644 index c07e34e5849b71a835f1a653aaab0dd4cab38acd..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_attrlack/entry/src/main/config.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.aceEtsAttrLack", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.aceEtsAttrLack", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.aceEtsAttrLack.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/page1", - "pages/page2", - "pages/alertDialog", - "pages/animate_play_mode", - "pages/animator", - "pages/app", - "pages/attr_animate", - "pages/canvas", - "pages/checkBox", - "pages/checkBoxGroup", - "pages/common", - "pages/curves", - "pages/datePicker", - "pages/edgeEffect", - "pages/enums", - "pages/featureAbility", - "pages/fill_mode", - "pages/gesture", - "pages/gridCol", - "pages/gridRow", - "pages/listtest", - "pages/list_item_group", - "pages/loadingProgress", - "pages/pluginComponent", - "pages/progress", - "pages/radio", - "pages/refresh", - "pages/remoteWindow", - "pages/router", - "pages/scroll_edge", - "pages/sidebar", - "pages/slider", - "pages/stateManagement", - "pages/stepperItem", - "pages/swiper", - "pages/text_input", - "pages/units", - "pages/web", - "pages/copyOption", - "pages/responseType", - "pages/hoverEffect", - "pages/hitTestMode", - "pages/color", - "pages/navigation_lack", - "pages/gestureSetting" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/Application/AbilityStage.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e0206ea9fb5ce94ef140d69510b6280969dd8e --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +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; + } +} diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/MainAbility.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d66065e88c907379883364a43ec02989cfd626b --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,37 @@ +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 diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 07722b56d3d02df5fb59b51789007b844b43e63c..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets index 9ca8c904c5373019759b101f63fe919e1fab5658..7bb2974e8a4ed01b99839743b5770c58f55a93b7 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets index fb499e08453ac1aa9ba0ee94c90371ee52d290d0..a07ccabc0e0e7d3a175ba303e6b3370183f57e22 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets index 48ea7769373274c8e64d77a2e7a9629beb595409..b8dd5648c108a433b3298554f616d1e2cbfdbca9 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import app from '@system.app'; +import appS from '@system.app'; import events_emitter from '@ohos.events.emitter'; import Log from '../common/Log.ets'; @@ -49,11 +49,11 @@ struct AppVersionCode { .textOverflow({ overflow: TextOverflow.None }) .key("versionCodeText") .onClick(()=>{ - app.getInfo().versionCode = 1 try { + let versionCode = appS.getInfo().versionCode; var backData = { data: { - "Code": app.getInfo().versionCode + "Code": appS.getInfo().versionCode } } let backEvent = { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets index c1a2014a7efd7631a6f99029b85133cd5cb619b9..60423ba8ad5a27840333225ee9dc160894cb85fa 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets index 7be4f5545d0b194f859f2a6baa7c4125c5bfec01..504a08128e8f4ef92cd86e0486ba94aad40069ac 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets index 6f5db39807d791c938aa184e7f61c75d86a97d38..6067482a9c89fb86ab0000b5305b39cc020f5c57 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets index 57eb7a70fe83ea7156a4e2123d271fb4328eb83a..705c94bad832be5e62d209b556b69a19d81c8753 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gestureSetting.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gestureSetting.ets index 75d8adface2404ef57db159f1c026c312b9a7787..0fd2fcd2223c1135f64295f31babf112e715c4fa 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gestureSetting.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gestureSetting.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets index ab75d75fd05fb39d7edb81d852e1dd3422babd33..d0fce29ed7309ce17976e6d1c4fa9a8d904b493f 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets @@ -32,23 +32,25 @@ struct HoverEffect { build(){ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){ - Text("hoverEffect-Scale") + Text("ScaleText") .width(100) .height(70) - .fontSize(20) + .fontSize('30px') .opacity(1) .align(Alignment.TopStart) .fontColor(0xCCCCCC) .lineHeight(25) .border({ width: 1 }) .padding(10) + .hoverEffect(HoverEffect.Scale) .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("ScaleText") - .hoverEffect(HoverEffect.Scale) - .visibility(Visibility.None) + .minFontSize('50px') + .onClick(() => { + }) - Text("hoverEffect-Highlight") + Text("HighlightText") .width(100) .height(70) .fontSize(20) @@ -60,9 +62,9 @@ struct HoverEffect { .padding(10) .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) - .key("HighlightText") .hoverEffect(HoverEffect.Highlight) - .visibility(Visibility.None) + .key("HighlightText") + .copyOption(0) }.width("100%").height("100%") } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index/index.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e231258d8a2c81943958dd04a85d57a68d3dd58 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,56 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets index fe91c2bb2cdb3b7c76d12949f5229ad33648cdff..764f0d411b723c318dd18b264eb409c022321edf 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/navigation_lack.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/navigation_lack.ets index 841c5babb3c8b12f90bb1719c7841bce901ecdc9..9b2c2acad2c40ad60d8a28b5a5d120b7120c5bb3 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/navigation_lack.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/navigation_lack.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets index 4fd2052f3a1e7cc3d4da105fe2aebf2641b7cdc3..c6b2689506750ab9d4c02bdc65d31519d38b71ee 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets index 804eff11e4081e94edf75bbaa0502a4dc957f186..881c621689a925ff5bfa737ad9f3a6405d38bc21 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets index fd5d474520843724d499a8fd7ad37780ad1c40e9..1daf95408318a20ea385b184c5593d056b8acda7 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets index 66f889a177338ef50f69cf573eb8f3ad8190de4b..033917cbd1a40727192b797b9d6b231a076835aa 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets index 8b9cc0077bf0b50a1bbcbb1ee5693b5b790796f4..3392f6412e724f45f5d2f456006af6fbce3c2ee4 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/second/second.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..7396425947cd4d9c1016f77855e792bfb6869629 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets index 5f54312353397991afa517cd9b63ea84917090d3..318422b871b99e76c0a382e179811947199e919c 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets @@ -73,7 +73,7 @@ struct SliderMoving { try { var backData = { data: { - "Mode": (mode==0)||(mode==1)||(mode==2) + "Mode": 0 } } let backEvent = { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/TestAbility.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..871dc89b25426b48a4575c64948ef5d916477140 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index 0d04e3a8354e1f9224f2fef1df0ecccfd5311f25..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets index c12e9993796c2c412a0846a03ef8bd2333d51e5f..1cf6eda5d963e40bc2e277218b30397f3ad43b09 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -20,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index af65ea87c0e54067f9f4b2d80003c81f7b14f53c..2b98d96b6fa9580aa166a16ee53a2609df5f4ca5 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,25 +20,25 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', + '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', - '-s package' + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] + targetParams = `${targetParams} ${key} ${parameters[key]}` } } return targetParams.trim() } async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); + console.log("onAbilityCreateCallback"); } async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) } export default class OpenHarmonyTestRunner implements TestRunner { @@ -46,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info("OpenHarmonyTestRunner OnPrepare ") } - onRun() { + async onRun() { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a com.open.harmony.aceEtsAttrLack.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { @@ -69,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.exitCode); }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) console.info('OpenHarmonyTestRunner onRun end') } }; \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets index aa94fe4f7e0a3a0c066b9141e118b2229c839a96..b4d1ad3df1329db4f69ec4522db1676d8069735e 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets index 76d8c8d126632e99c06bb69fc817fe72fcc8a09a..2d244ec46c6e55b655500eb3c91b1a43221a00ff 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; import measure from '@ohos.measure' @@ -24,7 +24,7 @@ export default function alertDialogCenterStartJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/alertDialog', + uri: 'MainAbility/pages/alertDialog', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets index d27f16274cc72bd705cd0bb66f060d9b8ec2a661..d5bfe8c107b923aadf9954c1313c5cbdc256722d 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets @@ -14,14 +14,14 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function playModeReverseJsunit() { describe('playModeReverseTest', function () { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/animate_play_mode', + uri: 'MainAbility/pages/animate_play_mode', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets index 24f65f9b3227120a5e752ec2cc0c810b71c5210d..20c71152c77934d913a4c2c20eed051b08808937 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function animatorOnframeJsunit() { @@ -22,7 +22,7 @@ export default function animatorOnframeJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/animator', + uri: 'MainAbility/pages/animator', } try { router.clear(); @@ -194,7 +194,7 @@ export default function animatorOnframeJsunit() { console.info("[testanimatorOnframe0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left"); + expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center"); console.info("[testanimatorOnframe0010] textAlign value :" + obj.$attrs.textAlign); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets index 22391561f22653c402ec10f63c508c3a7d866786..948afd16a0310eb28c2dade2aed94f0072a26988 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets' @@ -23,7 +23,7 @@ export default function appVersionCodeJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/app', + uri: 'MainAbility/pages/app', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets index 27e88fa4f8102087e174ed2e3f61812383795834..100a26c363e42e4a467d8ce1298ce944493288ab 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function canvasActualBoundingBoxAscentJsunit() { @@ -22,7 +22,7 @@ export default function canvasActualBoundingBoxAscentJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/canvas', + uri: 'MainAbility/pages/canvas', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets index 753af21a4fe9f9788d054dcb199c674f8c2b9811..5dc6f04da09e75b1540e5d961ddd19137ead6b57 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function checkBoxGroupJsunit() { @@ -22,7 +22,7 @@ export default function checkBoxGroupJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/checkBox', + uri: 'MainAbility/pages/checkBox', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets index 934dbcd0f300d7f98b41f09df1d546522734b1a8..9687ecd2e488dcfe4797859817f0747d5ed9030f 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets' @@ -23,7 +23,7 @@ export default function checkBoxGroupPartJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/checkBoxGroup', + uri: 'MainAbility/pages/checkBoxGroup', } try { router.clear(); @@ -51,6 +51,7 @@ export default function checkBoxGroupPartJsunit() { await Utils.sleep(2000); try { console.info("testcheckBoxGroupPart_0011 click result is: " + JSON.stringify(sendEventByKey('CheckboxGroup', 10, ""))); + await Utils.sleep(2000); let strJson = getInspectorByKey('Checkbox2'); console.info("[testcheckBoxGroupPart0011] component select strJson:" + strJson); let obj = JSON.parse(strJson); @@ -69,20 +70,22 @@ export default function checkBoxGroupPartJsunit() { await Utils.sleep(2000); try { console.info("testcheckBoxGroup0001 click result is: " + JSON.stringify(sendEventByKey('CheckboxGroup', 10, ""))); + await Utils.sleep(2000); var innerEvent = { eventId: 60301, priority: events_emitter.EventPriority.LOW } var callback = (eventData) => { console.info("testcheckBoxGroup0001 get event state result is: " + JSON.stringify(eventData)); - expect(eventData.data.STATUS).assertEqual(0); - done(); + expect(eventData.data.STATUS).assertEqual(2); + } events_emitter.on(innerEvent, callback); } catch (err) { console.info("testcheckBoxGroup0001 on click err : " + JSON.stringify(err)); } console.info('testcheckBoxGroup0001 END'); + done(); }) }) } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets index cdbe5eb083729b80a632264a20894d5a08dd0934..276f83a452b4a63a4ee1e0c4471c72554b09291c 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function colorEnumJsunit() { @@ -22,7 +22,7 @@ export default function colorEnumJsunit() { beforeEach(async function (done) { console.info("color beforeEach start"); let options = { - uri: 'pages/color', + uri: 'MainAbility/pages/color', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets index 95f35a18b1919ee687d3e0c145732f332575aea3..5b76804e7ca220bc912ab3cde7f365d10f44be76 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function commonColorModeJsunit() { @@ -23,7 +23,7 @@ export default function commonColorModeJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/common', + uri: 'MainAbility/pages/common', } try { router.clear(); @@ -58,8 +58,9 @@ export default function commonColorModeJsunit() { console.info("[testCommonColorMode0011] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined); console.info("[testCommonColorMode0011] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle); + let testObject = obj.$attrs.backgroundBlurStyle; + expect(testObject instanceof Object).assertTrue(); done(); }); @@ -75,8 +76,9 @@ export default function commonColorModeJsunit() { console.info("[testCommonColorMode0012] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined); console.info("[testCommonColorMode0012] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle); + let testObject = obj.$attrs.backgroundBlurStyle; + expect(testObject instanceof Object).assertTrue(); done(); }); @@ -111,8 +113,8 @@ export default function commonColorModeJsunit() { let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage); - expect(obj.$attrs.borderImage).assertEqual(undefined); - console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage); + let jsonObject = JSON.parse(obj.$attrs.borderImage); + expect(jsonObject.width).assertEqual("10.00px"); done(); }); @@ -128,8 +130,9 @@ export default function commonColorModeJsunit() { console.info("[testCommonRepeat0001] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.borderImage).assertEqual(undefined); console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage); + let jsonObject = JSON.parse(obj.$attrs.borderImage); + expect(jsonObject.width).assertEqual("10.00px"); done(); }); @@ -145,8 +148,9 @@ export default function commonColorModeJsunit() { console.info("[testCommonSpace0001] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.borderImage).assertEqual(undefined); console.info("[testCommonSpace0001] borderImage value :" + obj.$attrs.borderImage); + let jsonObject = JSON.parse(obj.$attrs.borderImage); + expect(jsonObject.width).assertEqual("10.00px"); done(); }); @@ -163,8 +167,8 @@ export default function commonColorModeJsunit() { let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); console.info("[testCommonSlice0001] borderImage value :" + obj.$attrs.borderImage); - expect(obj.$attrs.borderImage).assertEqual(undefined); - console.info("[testCommonSlice0001] borderImage value :" + obj.$attrs.borderImage); + let jsonObject = JSON.parse(obj.$attrs.borderImage); + expect(jsonObject.width).assertEqual("10.00px"); done(); }); @@ -184,13 +188,14 @@ export default function commonColorModeJsunit() { var callback = (eventData) => { console.info("testCommonArea0001 get event state result is: " + JSON.stringify(eventData)); expect(eventData.data.STATUS).assertEqual(320); - done(); } - console.info("testCommonArea0001 click result is: " + JSON.stringify(sendEventByKey('areaText', 10, ""))); events_emitter.on(innerEvent, callback); + console.info("testCommonArea0001 click result is: " + JSON.stringify(sendEventByKey('areaText', 10, ""))); + await Utils.sleep(2000); } catch (err) { console.info("testCommonArea0001 on click err : " + JSON.stringify(err)); } + done(); }); /* @@ -209,13 +214,15 @@ export default function commonColorModeJsunit() { var callback = (eventData) => { console.info("testCommonTouches0001 get event state result is: " + JSON.stringify(eventData)); expect(eventData.data.STATUS).assertEqual(undefined); - done(); + } - console.info("testCommonTouches0001 click result is: " + JSON.stringify(sendEventByKey('touchesText', 10, ""))); events_emitter.on(innerEvent, callback); + console.info("testCommonTouches0001 click result is: " + JSON.stringify(sendEventByKey('touchesText', 10, ""))); + await Utils.sleep(2000); } catch (err) { console.info("testCommonTouches0001 on click err : " + JSON.stringify(err)); } + done(); }); /* @@ -234,13 +241,14 @@ export default function commonColorModeJsunit() { var callback = (eventData) => { console.info("testCommonChangedTouches0001 get event state result is: " + JSON.stringify(eventData)); expect(eventData.data.STATUS).assertEqual(undefined); - done(); } - console.info("changedTouches0001 click is: " + JSON.stringify(sendEventByKey('changedTouchesText', 10, ""))); events_emitter.on(innerEvent, callback); + console.info("changedTouches0001 click is: " + JSON.stringify(sendEventByKey('changedTouchesText', 10, ""))); + await Utils.sleep(2000); } catch (err) { console.info("testCommonChangedTouches0001 on click err : " + JSON.stringify(err)); } + done(); }); }) } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets index b12cd1d3284d4fdc5d6bc205e246dd15defa4876..1736dd24deb2bf381e67167275c384dcb3be4aa4 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function copyOptionJsunit() { @@ -22,7 +22,7 @@ export default function copyOptionJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/copyOption', + uri: 'MainAbility/pages/copyOption', } try { router.clear(); @@ -57,7 +57,7 @@ export default function copyOptionJsunit() { console.info("[testcopyOption0001] component copyOption strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.copyOption).assertEqual(undefined); + expect(obj.$attrs.copyOption).assertEqual("CopyOptions.None"); console.info("[testcopyOption0001] copyOption value :" + obj.$attrs.copyOption); done(); }); @@ -74,7 +74,7 @@ export default function copyOptionJsunit() { console.info("[testcopyOption0002] component copyOption strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.copyOption).assertEqual(undefined); + expect(obj.$attrs.copyOption).assertEqual("CopyOptions.None"); console.info("[testcopyOption0002] copyOption value :" + obj.$attrs.copyOption); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets index 677aeb0f476a7a818474bfccda3631efb2f3f871..8c41033fe8df78741abc2dace09c873543aedf67 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function curvesEaseOutJsunit() { @@ -22,7 +22,7 @@ export default function curvesEaseOutJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/curves', + uri: 'MainAbility/pages/curves', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets index c9590348458738454ac8b6f2a050db998bc97019..b3f61d786c4bee3ba1892e709b9b283095cf3498 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function datePickerLunarJsunit() { @@ -22,7 +22,7 @@ export default function datePickerLunarJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/datePicker', + uri: 'MainAbility/pages/datePicker', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets index daf073cbe404c4a91de46129d1dd7321934e8fb5..e55f9bd2e887c55678d4a288397ac59fc8b804ac 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function enumsCancelJsunit() { @@ -22,7 +22,7 @@ export default function enumsCancelJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/enums', + uri: 'MainAbility/pages/enums', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets index c2985a5ce30a1079d35a7c71c8b47e76b1da37b8..8c70d5649385a78073608a6d8cafb6dff159757d 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function fillModeForwardJsunit() { @@ -22,7 +22,7 @@ export default function fillModeForwardJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/fill_mode', + uri: 'MainAbility/pages/fill_mode', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets index 5cc59adc00f72447ca340430514ba9e8261c5733..6360833fe4782d4b5845c0946dfe3857d8798659 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gestureParallelJsunit() { @@ -22,7 +22,7 @@ export default function gestureParallelJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gesture', + uri: 'MainAbility/pages/gesture', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets index a63d57bea0867ba5315c2854502de291f43a3eb8..12fd10982b31eb98aebbea17154a02dc6136639f 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gridColXlJsunit() { @@ -22,7 +22,7 @@ export default function gridColXlJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gridCol', + uri: 'MainAbility/pages/gridCol', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets index e330facb710d599a6ea91ade48fc93839a88d92b..ca137f1462bbc8a42d7945229ea3412b312e4fe5 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function gridRowXlJsunit() { @@ -22,7 +22,7 @@ export default function gridRowXlJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/gridRow', + uri: 'MainAbility/pages/gridRow', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets index 863bee97f754eff2c079125d49206b49176aa356..0b54f23e0c247b88dc691a17dcf5c16fe3f2ca6b 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function hitTestModeJsunit() { @@ -22,7 +22,7 @@ export default function hitTestModeJsunit() { beforeEach(async function (done) { console.info("hitTestMode beforeEach start"); let options = { - uri: 'pages/hitTestMode', + uri: 'MainAbility/pages/hitTestMode', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets index 7a321fdd96ce308060bc8ee0df322e497b563ec6..dc063bd56e6e7a3f5e89064f0313918194b63241 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets @@ -15,7 +15,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function hoverEffectJsunit() { @@ -23,7 +23,7 @@ export default function hoverEffectJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/hoverEffect', + uri: 'MainAbility/pages/hoverEffect', } try { router.clear(); @@ -58,7 +58,7 @@ export default function hoverEffectJsunit() { console.info("[testhoverEffect0001] component hoverEffect strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.hoverEffect).assertEqual(undefined); + expect(obj.$attrs.hoverEffect).assertEqual('HoverEffect.Auto'); console.info("[testhoverEffect0001] hoverEffect value :" + obj.$attrs.hoverEffect); done(); }); @@ -75,7 +75,7 @@ export default function hoverEffectJsunit() { console.info("[testhoverEffect0002] component hoverEffect strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.hoverEffect).assertEqual(undefined); + expect(obj.$attrs.hoverEffect).assertEqual('HoverEffect.Auto'); console.info("[testhoverEffect0002] hoverEffect value :" + obj.$attrs.hoverEffect); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets index 1acde951290c8ccca89fe9ab153ea649d72b4c4f..b1c4390c8dbd8841fc4ce8348fa0a162c783a461 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets @@ -15,7 +15,7 @@ import events_emitter from '@ohos.events.emitter'; import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function list_item_groupJsunit() { @@ -23,7 +23,7 @@ export default function list_item_groupJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/list_item_group', + uri: 'MainAbility/pages/list_item_group', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets index adad4c0d01e48288ac5142c0964985e8086411c3..473ccea0fccd389c65f7aadfa2d84f1a49122b58 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function listtestIdleJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/listtest', + uri: 'MainAbility/pages/listtest', } try { router.clear(); @@ -58,7 +58,7 @@ export default function listtestIdleJsunit() { console.info("[testlisttestIdle0001] component controlButton strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.editMode).assertEqual("true"); + expect(obj.$attrs.editMode).assertEqual(true); console.info("[testlisttestIdle0001] editMode value :" + obj.$attrs.editMode); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets index dfd9fe6c19c3be79bfed429a59fcca3936dcded1..14dc97f1f97d39a27919adbebe242f62a4d11f5a 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function loadingProgressCircularJsunit() { @@ -22,7 +22,7 @@ export default function loadingProgressCircularJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/loadingProgress', + uri: 'MainAbility/pages/loadingProgress', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/ohosrouter.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/ohosrouter.test.ets index 3d255021b12f859ca9e8dd9f02764f90a1f332bf..6558da29aff072bd781c8dbfa5b215993f265bbf 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/ohosrouter.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/ohosrouter.test.ets @@ -14,7 +14,7 @@ */ import router from '@ohos.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function ohosrouterJsunit() { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets index 7ab1af3997cd58b6e0fbe8149ca896883f49b7c8..f738c0c21b9baa66398b2cfeb8879648bcd6cc13 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function pluginComponentKVObjectJsunit() { @@ -22,7 +22,7 @@ export default function pluginComponentKVObjectJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/pluginComponent', + uri: 'MainAbility/pages/pluginComponent', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets index ed59e82d59b948d11600f1dec9eedefd735a1f59..d70831bb6e2f864d8881d5b8984b04e563dc32ae 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function progressScaleCountJsunit() { @@ -22,7 +22,7 @@ export default function progressScaleCountJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/progress', + uri: 'MainAbility/pages/progress', } try { router.clear(); @@ -57,8 +57,9 @@ export default function progressScaleCountJsunit() { console.info("[testprogressScaleCount0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Progress'); - expect(obj.$attrs.style.scaleCount).assertEqual("15"); - console.info("[testprogressScaleCount0001] style.scaleCount value :" + obj.$attrs.style.scaleCount); + console.info("[testprogressScaleCount0001] style.scaleCount value :" + obj.$attrs.style); + let jsonObject = JSON.parse(obj.$attrs.style); + expect(jsonObject.scaleCount).assertEqual("15"); done(); }); @@ -74,8 +75,9 @@ export default function progressScaleCountJsunit() { console.info("[testprogressScaleCount0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Progress'); - expect(obj.$attrs.style.scaleWidth).assertEqual('5.00vp'); - console.info("[testprogressScaleCount0002] style.scaleWidth value :" + obj.$attrs.style.scaleWidth); + console.info("[testprogressScaleCount0002] style.scaleWidth value :" + obj.$attrs.style); + let jsonObject = JSON.parse(obj.$attrs.style); + expect(jsonObject.scaleWidth).assertEqual('5.00vp'); done(); }); }) diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets index 9413f4ab7156af3ee4ed00a15a840e91e860e907..5ad404566a723bf57ea014bcc24b802123ca88a3 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function radioGroupJsunit() { @@ -22,7 +22,7 @@ export default function radioGroupJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/radio', + uri: 'MainAbility/pages/radio', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets index d8eeefd2e654496d3d55e3ad517df0eae3ac7dc1..198b5564ea9cdc23de4747fdd57a43a6be58d1d1 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function refreshDragJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/refresh', + uri: 'MainAbility/pages/refresh', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets index 748eb758e41ba810942a19cfedde51247741a76f..2080e1288e3fd7fee279351d2ed0f011e2c63cf0 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function remoteWindowJsunit() { @@ -22,7 +22,7 @@ export default function remoteWindowJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/remoteWindow', + uri: 'MainAbility/pages/remoteWindow', } try { router.clear(); @@ -193,7 +193,7 @@ export default function remoteWindowJsunit() { console.info("[testRemoteWindow0010] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.textAlign).assertEqual('TextAlign.Left'); + expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); console.info("[testRemoteWindow0010] textAlign value :" + obj.$attrs.textAlign); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets index 2722356a164cbc6591c499b29261365eeee29431..13a0b867d10f66c47b97136c288cd7a6cc5efe8d 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets @@ -15,7 +15,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function responseTypeJsunit() { @@ -23,7 +23,7 @@ export default function responseTypeJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/responseType', + uri: 'MainAbility/pages/responseType', } try { router.clear(); @@ -58,7 +58,7 @@ export default function responseTypeJsunit() { console.info("[testresponseType0002] component bindContextMenu strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.bindContextMenu).assertEqual("ResponseType.LongPress"); + expect(obj.$attrs.bindContextMenu).assertEqual(undefined); console.info("[testresponseType0002] bindContextMenu value :" + obj.$attrs.bindContextMenu); done(); }); @@ -75,7 +75,7 @@ export default function responseTypeJsunit() { console.info("[testresponseType0003] component bindContextMenu strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.bindContextMenu).assertEqual("ResponseType.LongPress"); + expect(obj.$attrs.bindContextMenu).assertEqual(undefined); console.info("[testresponseType0003] bindContextMenu value :" + obj.$attrs.bindContextMenu); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets index 955c82893abf8a7072b068da078a61accbc309fa..b0f967735fc9ebc30ab95f21032ffd96130d3e92 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function routerStandardJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/router', + uri: 'MainAbility/pages/router', } try { router.clear(); @@ -57,16 +57,18 @@ export default function routerStandardJsunit() { var callback1 = (eventData) => { console.info("testrouterStandard_0011 get event data is: " + JSON.stringify(eventData)); expect(eventData.data.ArrayData).assertEqual("45"); - done(); + } + events_emitter.on(standardEvent, callback1); console.info("testrouterStandard_0011 click result1 is: " + JSON.stringify(sendEventByKey('StandardText', 10, ""))); await Utils.sleep(2000); console.info("testrouterStandard_0011 click result2 is: " + JSON.stringify(sendEventByKey('DataText', 10, ""))); - events_emitter.on(standardEvent, callback1); + await Utils.sleep(2000); } catch (err) { console.info("testrouterStandard_0011 on events_emitter err : " + JSON.stringify(err)); } console.info('testrouterStandard0011 END'); + done(); }); it('testrouterSingle0001', 0, async function (done) { @@ -80,16 +82,17 @@ export default function routerStandardJsunit() { var callback2 = (eventData) => { console.info("testrouterSingle_0001 get event data is: " + JSON.stringify(eventData)); expect(eventData.data.ArrayData).assertEqual("46"); - done(); } + events_emitter.on(singleEvent, callback2); console.info("testrouterSingle_0001 click result1 is: " + JSON.stringify(sendEventByKey('SingleText', 10, ""))); await Utils.sleep(2000); console.info("testrouterSingle_0001 click result2 is: " + JSON.stringify(sendEventByKey('SingleDataText', 10, ""))); - events_emitter.on(singleEvent, callback2); + await Utils.sleep(2000); } catch (err) { console.info("testrouterSingle_0001 on events_emitter err : " + JSON.stringify(err)); } console.info('testrouterSingle_0001 END'); + done(); }); }) } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets index af1ae76fc8e34ebcdeb80ad79788b7da232a83fd..62e4aeeb1a1101dd4c878c1f5b551b6bad1685c3 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function ScrollExampleJsunit() { @@ -23,7 +23,7 @@ export default function ScrollExampleJsunit() { beforeAll(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/scroll_edge', + uri: 'MainAbility/pages/scroll_edge', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets index ec91cfaa0fee9c4c337877753f9d038411407b49..6fb89f68c9e00b8af4d76e009d1ba5682734627c 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function sidebarIconsJsunit() { @@ -22,7 +22,7 @@ export default function sidebarIconsJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/sidebar', + uri: 'MainAbility/pages/sidebar', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets index 4fc8e17b0ed3f2931133ea1981e175019869fe23..5e0956bfdc003d96f8eeae57134a39d5edc33851 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function sliderMovingJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/slider', + uri: 'MainAbility/pages/slider', } try { router.clear(); @@ -55,16 +55,22 @@ export default function sliderMovingJsunit() { priority: events_emitter.EventPriority.LOW } var callback = (eventData) => { - console.info("testsliderMoving0011 get event data is: " + JSON.stringify(eventData)); - expect(eventData.data.Mode).assertEqual(false); - done(); + try + { + console.info("testsliderMoving0011 get event data is: " + JSON.stringify(eventData)); + expect(eventData.data.Mode).assertEqual(0); + } catch(err) { + console.info("testsliderMoving0011 get event err data is: " + JSON.stringify(err)); + } } - console.info("testsliderMoving0011 click result is: " + JSON.stringify(sendEventByKey('Slider', 10, ""))); events_emitter.on(event, callback); + console.info("testsliderMoving0011 click result is: " + JSON.stringify(sendEventByKey('Slider', 10, ""))); + await Utils.sleep(3000); } catch (err) { console.info("testsliderMoving0011 on events_emitter err : " + JSON.stringify(err)); } console.info('testsliderMoving0011 END'); + done(); }); }) } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets index 3da471d3e8c5c608698e4c08f1223453e273629a..8268cef32af2bffdda4989d6c2bbce05a6a1be42 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function stateManagementDARKJsunit() { @@ -22,7 +22,7 @@ export default function stateManagementDARKJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/stateManagement', + uri: 'MainAbility/pages/stateManagement', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets index 806c0a2a25a5efddc88fde3eef843553585151ca..fc03f4cc4a6ff3ab0e48cc5576b10057604d9d1c 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function stepperItemDisabledJsunit() { @@ -22,7 +22,7 @@ export default function stepperItemDisabledJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/stepperItem', + uri: 'MainAbility/pages/stepperItem', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets index 8e1e908a5f4b3944f46d29c1e711824bd3a07910..e7d4b4c34c74965333fd93fa87f923ae80b0abf1 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function swiperMaskJsunit() { @@ -22,7 +22,7 @@ export default function swiperMaskJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/swiper', + uri: 'MainAbility/pages/swiper', } try { router.clear(); @@ -57,8 +57,9 @@ export default function swiperMaskJsunit() { console.info("[testswiperMask001] component textAlign strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Swiper'); - expect(obj.$attrs.indicatorStyle.mask).assertEqual(undefined); - console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicatorStyle.mask); + console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicator); + let jsonObject = JSON.parse(obj.$attrs.indicator); + expect(jsonObject.mask).assertEqual('true'); done(); }); }) diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets index 78f6960769179cd2dfc27eef02627e0b749b1bb2..3f08f769b347482b1a04f01c50812769d13c2cb7 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function text_inputPhoneNumberJsunit() { @@ -22,7 +22,7 @@ export default function text_inputPhoneNumberJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/text_input', + uri: 'MainAbility/pages/text_input', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets index 444381d884a26b17041eb07164ff2845a2198602..3735d0851c1e50aeee0ad1d4d0610d67b2d6cbc7 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function uiAppearanceALWAYS_DARKJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/uiAppearance', + uri: 'MainAbility/pages/uiAppearance', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets index a84a75d5c72d38d4d26c8ee42de205dcb7ce1edb..3f833c903d9bdcaa6d069211dedad3710450fddc 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function unitsModuleNameJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/units', + uri: 'MainAbility/pages/units', } try { router.clear(); @@ -56,13 +56,19 @@ export default function unitsModuleNameJsunit() { await Utils.sleep(2000); try { console.info("testunitsModuleName0001 click result is: " + JSON.stringify(sendEventByKey('moduleNameText', 10, ""))); + await Utils.sleep(2000); var innerEvent = { eventId: 60310, priority: events_emitter.EventPriority.LOW } var callback = (eventData) => { console.info("testunitsModuleName0001 get event state result is: " + JSON.stringify(eventData)); - expect(eventData.data.ModuleName).assertFalse(); + try { + expect(eventData.data.ModuleName).assertFalse(); + } catch (err) { + console.info("testunitsModuleName0001 get event state result is: " + JSON.stringify(err)); + } + } events_emitter.on(innerEvent, callback); } catch (err) { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets index 7c0517d018842420ec1b59b2ef0b0935e153519e..83191fb258320920038df95807c538c1d0d38cab 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets @@ -14,7 +14,7 @@ */ import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function webEditTextJsunit() { @@ -22,7 +22,7 @@ export default function webEditTextJsunit() { beforeEach(async function (done) { console.info("flex beforeEach start"); let options = { - uri: 'pages/web', + uri: 'MainAbility/pages/web', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/webviewPageLackattr.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/webviewPageLackattr.test.ets index d0f8f2b59e85c688d66808c915b88dcb7ea461c0..a9368b24eff8ec8574179915240da4f4b7ef101b 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/webviewPageLackattr.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/webviewPageLackattr.test.ets @@ -15,7 +15,7 @@ import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import Utils from './Utils.ets' export default function webViewPageattrLackJsunit() { @@ -23,7 +23,7 @@ export default function webViewPageattrLackJsunit() { beforeAll(async function (done) { console.info("webviewpageLackattr beforeEach start"); let options = { - uri: 'pages/webviewpageLackattr', + uri: 'MainAbility/pages/webviewpageLackattr', } try { router.clear(); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/module.json b/arkui/ace_ets_component_attrlack/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..f1ace9dc9f7e403edd7b8ac735ded60966cb2fde --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/module.json @@ -0,0 +1,35 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.open.harmony.aceEtsAttrLack.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 diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json index fa13b27d700b87e261e43fda028695c25d7a25ec..964fa51fdabd8aebf8c64cd249a0c5878cc17c52 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json +++ b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json @@ -31,6 +31,34 @@ { "name":"message_arrive", "value":"We will arrive at %s." - } + } , + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } ] } \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..e5b36e438b41972de40701a26e4afec830a4c091 --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,52 @@ +{ + "src": [ + "MainAbility/pages/index", + "MainAbility/pages/page1", + "MainAbility/pages/page2", + "MainAbility/pages/second/second", + "MainAbility/pages/index/index", + "MainAbility/pages/alertDialog", + "MainAbility/pages/animate_play_mode", + "MainAbility/pages/animator", + "MainAbility/pages/app", + "MainAbility/pages/attr_animate", + "MainAbility/pages/canvas", + "MainAbility/pages/checkBox", + "MainAbility/pages/checkBoxGroup", + "MainAbility/pages/common", + "MainAbility/pages/curves", + "MainAbility/pages/datePicker", + "MainAbility/pages/edgeEffect", + "MainAbility/pages/enums", + "MainAbility/pages/featureAbility", + "MainAbility/pages/fill_mode", + "MainAbility/pages/gesture", + "MainAbility/pages/gridCol", + "MainAbility/pages/gridRow", + "MainAbility/pages/listtest", + "MainAbility/pages/list_item_group", + "MainAbility/pages/loadingProgress", + "MainAbility/pages/pluginComponent", + "MainAbility/pages/progress", + "MainAbility/pages/radio", + "MainAbility/pages/refresh", + "MainAbility/pages/remoteWindow", + "MainAbility/pages/router", + "MainAbility/pages/scroll_edge", + "MainAbility/pages/sidebar", + "MainAbility/pages/slider", + "MainAbility/pages/stateManagement", + "MainAbility/pages/stepperItem", + "MainAbility/pages/swiper", + "MainAbility/pages/text_input", + "MainAbility/pages/units", + "MainAbility/pages/web", + "MainAbility/pages/copyOption", + "MainAbility/pages/responseType", + "MainAbility/pages/hoverEffect", + "MainAbility/pages/hitTestMode", + "MainAbility/pages/color", + "MainAbility/pages/navigation_lack", + "MainAbility/pages/gestureSetting" + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_four/AppScope/app.json b/arkui/ace_ets_component_four/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..ce4cb3bedefaa97f7696506da719a2f4cbcbded3 --- /dev/null +++ b/arkui/ace_ets_component_four/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.open.harmony.acetestfour", + "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 diff --git a/arkui/ace_ets_component_four/AppScope/resources/base/element/string.json b/arkui/ace_ets_component_four/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/arkui/ace_ets_component_four/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_four/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_component_four/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/arkui/ace_ets_component_four/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_component_four/BUILD.gn b/arkui/ace_ets_component_four/BUILD.gn index 31e1c2f75afab3690f66c5d320042dc1f7f13f0c..fec58b6cb25c74f97cd5ecac39626573b45fbdd1 100644 --- a/arkui/ace_ets_component_four/BUILD.gn +++ b/arkui/ace_ets_component_four/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,25 +14,28 @@ import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsAceEtsComponentFourTest") { - hap_profile = "./entry/src/main/config.json" + hap_profile = "entry/src/main/module.json" deps = [ - ":ace_ets_component_assets", + ":ace_ets_component_resources", ":ace_ets_component_test_assets", ] ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsAceEtsComponentFourTest" subsystem_name = "arkui" part_name = "ace_engine" } -ohos_js_assets("ace_ets_component_assets") { - source_dir = "./entry/src/main/ets/MainAbility" + +ohos_app_scope("ace_ets_component_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] } ohos_js_assets("ace_ets_component_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" + source_dir = "entry/src/main/ets" } ohos_resources("ace_ets_component_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "entry/src/main/resources" ] + deps = [ ":ace_ets_component_app_profile" ] + hap_profile = "entry/src/main/module.json" } diff --git a/arkui/ace_ets_component_four/Test.json b/arkui/ace_ets_component_four/Test.json index e9bad698b0708b455d111d36703606b89af7f369..cc058417d72e6615c794b2cb46d6eb371247f31a 100644 --- a/arkui/ace_ets_component_four/Test.json +++ b/arkui/ace_ets_component_four/Test.json @@ -1,11 +1,12 @@ { - "description": "Configuration for aceceshi Tests", + "description": "Configuration for hjunit demo Tests", "driver": { "type": "OHJSUnitTest", "test-timeout": "600000", - "bundle-name": "com.open.harmony.acetestfour", - "package-name": "com.open.harmony.acetestfour", - "shell-timeout": "600000" + "bundle-name": "com.open.harmony.acetestfour", + "module-name": "phone", + "shell-timeout": "600000", + "testcase-timeout": "180000" }, "kits": [ { diff --git a/arkui/ace_ets_component_four/entry/src/main/config.json b/arkui/ace_ets_component_four/entry/src/main/config.json deleted file mode 100644 index c3febc2f1bb81fe367f3dd79bc0970e47dac20aa..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_four/entry/src/main/config.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.acetestfour", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.acetestfour", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.acetestfour.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/calendar", - "pages/customDialogController", - "pages/dragEvent", - "pages/dragEvent2", - "pages/enumsItemAlign", - "pages/enumsLineCapStyle", - "pages/focus", - "pages/geometryTransition", - "pages/gestureMode", - "pages/image", - "pages/ohosPrompt", - "pages/panDirection", - "pages/path", - "pages/patternLock", - "pages/playMode", - "pages/polygon", - "pages/polyline", - "pages/refresh", - "pages/richText", - "pages/sideBar", - "pages/systemRouterA", - "pages/systemRouterB", - "pages/textArea", - "pages/textClock", - "pages/textInput", - "pages/textPickerDialog", - "pages/textTimer", - "pages/video" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/Application/AbilityStage.ts b/arkui/ace_ets_component_four/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e0206ea9fb5ce94ef140d69510b6280969dd8e --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +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; + } +} diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/MainAbility.ts b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d66065e88c907379883364a43ec02989cfd626b --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,37 @@ +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 diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/animatorOption.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/animatorOption.ets index faa4a4894ed4b9f74e9368f85eb86f5873746a63..8d63cecf63350f39501ea1fa51f5c0138cda05fc 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/animatorOption.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/animatorOption.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/bindContextMenu.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/bindContextMenu.ets index fa3e296fda42029d22f20c44aeeb1b0d6b0d323b..3fda16ccb55a2d6481175b7fddfc3669b6d3a37a 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/bindContextMenu.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/bindContextMenu.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets index 99e24e24dbc29d214c6e9634838894e3ff69962d..f086a11f55c4db3b99983019b0213ace9d4f12a0 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/customDialogController.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/customDialogController.ets index 951d4b98239aa9d679d233f00bc41b6122f27bc7..5e5c06ddc8bb3c764f511fc328cfa1b17fcb6ede 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/customDialogController.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/customDialogController.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent.ets index 47bda1a44adff5df5f902fffab3c8d118eb61165..35e6a40bdaa9ce0cac19f9ca9c6aa9457f7de25b 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent2.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent2.ets index 9fc9fbe402f880f9f8d985bb96881fc611044382..bdbbe4a7f3d7f3cf9e38bebd3cb3939db5d3fa1b 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent2.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/dragEvent2.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsItemAlign.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsItemAlign.ets index e3a42d82150ceac138bd3fbc94956f2efc2cfeb9..ab4e364a31a9da5241df4c501863409d085d9f2c 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsItemAlign.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsItemAlign.ets @@ -1,6 +1,6 @@ -// @ts-nocheck + /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsLineCapStyle.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsLineCapStyle.ets index bb08deec7570edd002d774c5ec0db7212c2e3f6e..2ef3813a901d247ceaf8ba6208f828023fba7716 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsLineCapStyle.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/enumsLineCapStyle.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/focus.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/focus.ets index 5a66bf8edb3322815f0af0cdd13187d4ba4854ba..d06a8116627ab5ba21a19686fa354bf43e2df2f4 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/focus.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/focus.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/fontWeight.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/fontWeight.ets index 8f4214876464a29bccd8ca91c306474e707e4a67..ae4f3c7e0ff8500c9aaa8b7d367bf807b7b60e22 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/fontWeight.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/fontWeight.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/geometryTransition.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/geometryTransition.ets index c86715c123be817990f2b744fa07a847e8abe9e2..9b5263841040cd7365386079e3ea975cfd7eee64 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/geometryTransition.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/geometryTransition.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/gestureMode.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/gestureMode.ets index 8ba0cf0b5c10553cdb988379679b1d156d52eb18..89ec72a6ebab8aea9f1b8535250fb231d75e8489 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/gestureMode.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/gestureMode.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/grid.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/grid.ets index d2d7843b449387e7d800c2af9ad2e3079f5eedf7..b71cf87b62ee9b1ae5ff28c13140269751069f08 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/grid.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/grid.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/image.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/image.ets index d2d37dc8ada48e0b73d909a8d9bd25577239ceea..c0d7de31a71c7358b7da40406a58ec25d4941bd1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/image.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/image.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/imageFit.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/imageFit.ets index 59658715b32558bacfb6af52b743e301e4153d48..42b4f923942bdd17241464abe849e57672e25eb0 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/imageFit.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/imageFit.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index.ets index 5be55e99f496a3ceb6a27d86a7785c7ae30909f2..5b0b229e33e35b7282d87c42356945c421a6385d 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index/index.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e231258d8a2c81943958dd04a85d57a68d3dd58 --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,56 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/lazyForEach.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/lazyForEach.ets index 0ee2fceb4a22165c1dba1779b4ff1e7ae9fb8ba6..75fb7247aabf7ef5921335efd0dec630b2aaffcc 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/lazyForEach.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/lazyForEach.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/mouseEvent.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/mouseEvent.ets index 1823f24f15d394e8037ef7cbfa67ffc6b90900ea..9331e76e2a784bae01795c814eaf55ac85853f35 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/mouseEvent.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/mouseEvent.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/ohosPrompt.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/ohosPrompt.ets index e02130c1bc94e4a9447944a4b8be7b927f327b32..5378bd5b8d707258eb69ab95fd622e3be3e3b4a3 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/ohosPrompt.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/ohosPrompt.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panDirection.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panDirection.ets index 9e10ba08bff43b5eb9e2ec8c8a4e0a3bc3adea01..d3c011c05a2ddb229240e1c003d3e4e23ba35872 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panDirection.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panDirection.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panel.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panel.ets index 4b378a4b912d100aa7a815bd68a4d986b8e48be3..2c3c8feaf96b369b4c9dbba8451923d0ad05b3ba 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panel.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/panel.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/path.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/path.ets index b1800a8a53ba0bda3fd398c14f9041bbfee41fc5..ed63dc3715a7c8e71d80f399a14be40c02d32de5 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/path.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/path.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/patternLock.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/patternLock.ets index 23b41035176b19ae60ea8907e1078fec536fc2ee..04c6a3ec6e39804a5eef4d4f932ed22d6743362f 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/patternLock.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/patternLock.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/playMode.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/playMode.ets index 6069e73099ac3370290e3bbf658cd56e2bf659ce..d28f2e935290bea4441d5faef7870a73e6386793 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/playMode.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/playMode.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polygon.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polygon.ets index e5ed80fea1970afc10e620e77bcb8d3822b20291..6676318414667cfad945aa1a4678d726e839a412 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polygon.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polygon.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polyline.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polyline.ets index eaf84f061cce7ef6bb94a581420f39e172efe627..04695c0a9e1fa5ffe1979b7c6740f8001f77839f 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polyline.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/polyline.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/refresh.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/refresh.ets index cfc454793f3cc1617902fee86263cdb721f3b0d2..973b3b4a6abf90e31108e8e534c886d7b1e0bca1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/refresh.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/refresh.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/richText.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/richText.ets index 183ec0af3a19e2f356d191fb156d7b808617036c..463e8131cf69007e23c906b60b8aeabd15723727 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/richText.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/richText.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/second/second.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..7396425947cd4d9c1016f77855e792bfb6869629 --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/sideBar.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/sideBar.ets index a81ee27b019b1d7f6821856c4e6bc92ec940b095..4d923846b64c0804d3f6575e70ab41f48eb6d4be 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/sideBar.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/sideBar.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterA.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterA.ets index 972e09ed3c08b5cc6fc6fd5b56fbf8bffdd338c6..f2377deb94b48650884a9138e1f68c16b8997283 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterA.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterA.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,7 +31,7 @@ struct SystemRouterA { .margin({top: 20}) .onClick(() => { router.push({ - uri: 'pages/systemRouterB', + uri: 'MainAbility/pages/systemRouterB', params: { data: 'B Page' } @@ -44,7 +44,7 @@ struct SystemRouterA { .margin({top: 20}) .onClick(() => { router.replace({ - uri: 'pages/systemRouterB', + uri: 'MainAbility/pages/systemRouterB', params: { data: 'B Page' } diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterB.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterB.ets index 78ac9563eb588da398d243d3e086f6c983198435..9fc26e475f0648b55705031bb55c763946adb0bb 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterB.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/systemRouterB.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textArea.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textArea.ets index 00c7a0f99afb50a845dfd80437a33cb6f0661f26..f4aa244e50e22b8df92b29a033be31c66b4f0105 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textArea.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textArea.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textClock.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textClock.ets index 6a56b2788a65d1effe07fd1f15c4bddc33bfe903..ae4646d8fb6a9e211b71f6134446710b83f990e2 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textClock.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textClock.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textInput.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textInput.ets index 3bdac0fe44a100ef397488a3e0817461e76be078..2ae42a4e1e320535c81ca9d94f129b4d03aa1ce1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textInput.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textInput.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textPickerDialog.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textPickerDialog.ets index 8527e0d118f3c1ae2bdecb5a3ed708c4507bdc0e..7b39288e4431221a7e619f9799734436fc3658aa 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textPickerDialog.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textPickerDialog.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textTimer.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textTimer.ets index f57536e86896657ff6c6ab247f56a711eeae796f..340debd76dec80c6f8eb392aa425ed1f37e8e4ec 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textTimer.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/textTimer.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/video.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/video.ets index e46fb3c6804a6a169033dc3c8bd74b212c8936e9..2d848a2c541ea0b1a503c71cbbe4d6bdb1401734 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/video.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/video.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/utils/Constants.ets b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/utils/Constants.ets index 13a6c0d16e7277756efb5136ce8b02ac6b601d50..0928a8f340d0c726291af7f7b0109088cabbff41 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/utils/Constants.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/MainAbility/utils/Constants.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/TestAbility.ts b/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..871dc89b25426b48a4575c64948ef5d916477140 --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/pages/index.ets index f87ca6e18f4a4dd9c1804b8edabe664029341e78..441f24058499e3ea4c4c3d96a776f02192e02549 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -21,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index dfbf1f268a45e4a2f30b8c836f42d76f3a9f5ad3..c2e489b76228ab4ad808b141caa52c63bb785d85 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component_four/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', + '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', - '-s package' + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] + targetParams = `${targetParams} ${key} ${parameters[key]}` } } return targetParams.trim() } async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); + console.log("onAbilityCreateCallback"); } async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) } export default class OpenHarmonyTestRunner implements TestRunner { @@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info("OpenHarmonyTestRunner OnPrepare ") } - onRun() { + async onRun() { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a com.open.harmony.acetestfour.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { @@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.exitCode); }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) console.info('OpenHarmonyTestRunner onRun end') } }; \ No newline at end of file diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/AppStorageJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/AppStorageJsunit.test.ets index f73206b417915fa0097a43fa469b92070692b139..c416de2daea0b001cb43e6b477cdb125cdaa9e91 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/AppStorageJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/AppStorageJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function AppStorageJsunit() { beforeEach(async function (done) { console.info("appStorage beforeEach start"); let options = { - uri: 'pages/appStorage', + uri: 'MainAbility/pages/appStorage', } let result; try { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/BasicJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/BasicJsunit.test.ets index 33a7763bfede6794dca4f81495e9c387fd6061c6..3f13b1d0c4e6d0e745678ea971b04c60393b2cff 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/BasicJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/BasicJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; export default function basicJsunit() { describe('basicTest', function () { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/CalendarJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/CalendarJsunit.test.ets index 42d78eb1356c5c115681d87c2fb2f3f774b26f84..5a2161da0cfdd28b043d881ddb78573fc7f7d65f 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/CalendarJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/CalendarJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function calendarJsunit() { beforeEach(async function (done) { console.info("calendar beforeEach start"); let options = { - uri: 'pages/calendar', + uri: 'MainAbility/pages/calendar', } let result; try { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/ContentStorage.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/ContentStorage.test.ets index 9e2a5552d4494a8028c3539e3c4ef6f0cafdd699..7002f29a553bf3689f5af41e2021bc4d9a4a7741 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/ContentStorage.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/ContentStorage.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; export default function ContentStorageJsunit() { describe('ContentStorage', function () { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/CustomDialogControllerJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/CustomDialogControllerJsunit.test.ets index 9604784965cba02250d9e00a7578688337429bca..3311d5f16c07af273b9c903e5b1bd0ba56d14d6b 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/CustomDialogControllerJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/CustomDialogControllerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function customDialogControllerJsunit() { describe('customDialogControllerTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/customDialogController', + uri: 'MainAbility/pages/customDialogController', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/DragEventJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/DragEventJsunit.test.ets index ffe6f7d207050b89f01fca30b4b3091d505326be..72b00dd54382fe5d78b058ab2ac7fb8c95d10e33 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/DragEventJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/DragEventJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function dragEventJsunit(){ describe('dragEventTest', function (){ beforeEach(async function (done) { let options = { - uri: 'pages/dragEvent', + uri: 'MainAbility/pages/dragEvent', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusItemAlignJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusItemAlignJsunit.test.ets index db8a605db9488c701b2a8c850fcd6282c1ec55ff..f46d4a4b88e0286a12ffc0b9824204ada8098691 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusItemAlignJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusItemAlignJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function enumsFlexItemJsunit() { beforeEach(async function (done) { console.info('beforeEach ===================enumsFlexItem test beforeEach called==================='); let options = { - uri: 'pages/enumsItemAlign', + uri: 'MainAbility/pages/enumsItemAlign', } try { router.clear(); @@ -52,7 +52,7 @@ export default function enumsFlexItemJsunit() { console.info("enumsItemAlignTest_0100 component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("enumsItemAlignTest_0100 component obj is: " + JSON.stringify(obj.$attrs.constructor)); - expect(obj.$attrs.constructor.alignItems).assertEqual('FlexAlign.SpaceEvenly'); + expect(obj.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto'); console.info('enumsItemAlignTest_0100 END'); done(); }); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusLineCapStyleJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusLineCapStyleJsunit.test.ets index 7360267f26e64b65fa5b09e65d9d9abebc801918..41e1dd6e97aa53a5fe9a09044c2f7f815a225d83 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusLineCapStyleJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/EnmusLineCapStyleJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function enumsImageJsunit() { beforeEach(async function (done) { console.info('beforeEach ===================enumsLineCapStyle test beforeEach called==================='); let options = { - uri: 'pages/enumsLineCapStyle', + uri: 'MainAbility/pages/enumsLineCapStyle', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/FocusJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/FocusJsunit.test.ets index 98ce69338c0eef56c088d082cc752869608eb366..180eb72166af40273f9cc7861d47ec84b626ab16 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/FocusJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/FocusJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function focusJsunit() { beforeEach(async function (done) { console.info("focus beforeEach start"); let options = { - uri: 'pages/focus', + uri: 'MainAbility/pages/focus', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/GeometryTransitionJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/GeometryTransitionJsunit.test.ets index 51a25f63dd456e034d6d521ee0f4f901b5c25655..868d68d1e3d52eb1cce7ee24d86ee9d97560ccd1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/GeometryTransitionJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/GeometryTransitionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function geometryTransitionJsunit() { describe('geometryTransitionTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/geometryTransition', + uri: 'MainAbility/pages/geometryTransition', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/GestureModeJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/GestureModeJsunit.test.ets index be9cdf520f52c18aeea97f64cafa93cfdca78f80..9cebfcd24e470d5e70900391f052f92222599532 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/GestureModeJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/GestureModeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -21,7 +21,7 @@ export default function fontWeightJsunit() { describe('fontWeightTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/gestureMode', + uri: 'MainAbility/pages/gestureMode', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets index 3b298bc4f018bcd67e16a731a91193842a07fe55..9b1ff58cbb523214b07d089040dc6b219f2cad6f 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function imageJsunit() { beforeEach(async function (done) { console.info("image beforeEach start"); let options = { - uri: 'pages/image', + uri: 'MainAbility/pages/image', } try { router.clear(); @@ -65,13 +65,7 @@ export default function imageJsunit() { console.info("imageTest_0200 component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src); - console.info("imageTest_0200 obj.obj.$type is: " + obj.$type); - var res = obj.$attrs.src.indexOf('RAWFILE/test.png'); - console.info("imageTest_0200 result is: " + res); - var sres = obj.$attrs.src.slice(res, res + 16); - console.info("imageTest_0200 slice result is: " + sres); - expect(obj.$type).assertEqual('Image'); - expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png'); + expect(obj.$attrs.src).assertEqual('resource://rawfile/test.png'); console.info('imageTest_0200 END'); done(); }); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/List.test.ets index 8338b2a38a41e144dd971c368c299669a0e90d0f..ea79c530a4c59a011c68d1b320a238ad1c7cca26 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/List.test.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/OhosPromptJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/OhosPromptJsunit.test.ets index 747c67ffbf43d668fb1014c05f72a6d7151c8dfe..f3a7597bdf035eef4c79a49cfb26f0481f32a603 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/OhosPromptJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/OhosPromptJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function ohosPromptJsunit() { beforeEach(async function (done) { console.info("OhosPrompt beforeEach start"); let options = { - uri: 'pages/ohosPrompt', + uri: 'MainAbility/pages/ohosPrompt', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PanDirectionJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PanDirectionJsunit.test.ets index 0f43b1d5d2576db012d6b933a0d9ae95f00e6f4c..58f69f5e2c9d699d0ab41c1fb949b96a1b3d5261 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PanDirectionJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PanDirectionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -21,7 +21,7 @@ export default function fontWeightJsunit() { describe('panDirectionTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/panDirection', + uri: 'MainAbility/pages/panDirection', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PanelJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PanelJsunit.test.ets index ba3aa75a6266a0bd899436e0a67716fccb5c47aa..1b9875e6ff6aa3b9fbeb1f76ab043a3ff6a173ef 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PanelJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PanelJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function panelJsunit() { describe('panelTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/panel', + uri: 'MainAbility/pages/panel', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PathJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PathJsunit.test.ets index 679a124d966370f4a7a6a5acded36ed935ba22c5..8e1b77ce1353baa722375ed22d1fd4596638b6f7 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PathJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PathJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function enableJsunit() { beforeEach(async function (done) { console.info("path beforeEach start"); let options = { - uri: 'pages/path', + uri: 'MainAbility/pages/path', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PatternLockJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PatternLockJsunit.test.ets index 40a50964a8cd74c19894e07a2a1755549b42fd7d..324c115f51027806e99be734124ed0d1567b8437 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PatternLockJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PatternLockJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function patternLockJsunit() { beforeEach(async function (done) { console.info("patternLock beforeEach start"); let options = { - uri: 'pages/patternLock', + uri: 'MainAbility/pages/patternLock', } let result; try { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PlayModeJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PlayModeJsunit.test.ets index 5b04c7b07595d66e280711d345e310dad928d14e..6ddd4ac2be65f4b14586b17377507f3ac8d3c4a7 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PlayModeJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PlayModeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function playModeJsunit(){ beforeEach(async function (done) { console.info("playMode beforeEach start"); let options = { - uri: 'pages/playMode', + uri: 'MainAbility/pages/playMode', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PolygonJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PolygonJsunit.test.ets index 3c58bb022255fa8a6c56f6df75783d15f75f7ec1..f1ae527628d238b25c2e5d08de727053710a2dc8 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PolygonJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PolygonJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function polygonJsunit() { beforeEach(async function (done) { console.info("polygon beforeEach start"); let options = { - uri: 'pages/polygon', + uri: 'MainAbility/pages/polygon', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/PolylineJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/PolylineJsunit.test.ets index 3e3df6873e64408660dffdb48bea9941fe2ac10b..df16cd56e09b0866a20a5e3d6b1e3e209a8936e1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/PolylineJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/PolylineJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function polylineJsunit() { beforeEach(async function (done) { console.info("polyline beforeEach start"); let options = { - uri: 'pages/polyline', + uri: 'MainAbility/pages/polyline', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/RefreshJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/RefreshJsunit.test.ets index 588ad75d8b66a6506aeb5f13d10c516bdc7b272f..c384191e3626832841d3629247642885a84de04c 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/RefreshJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/RefreshJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function refreshJsunit() { beforeEach(async function (done) { console.info("refresh beforeEach start"); let options = { - uri: 'pages/refresh', + uri: 'MainAbility/pages/refresh', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/RichTextJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/RichTextJsunit.test.ets index 623bd1707e37edd6b0bf0e76bb64c2e2beeeda1e..ee1c83a1f9f805c02ad3a4f75c20c3f5ac507f21 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/RichTextJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/RichTextJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function richTextJsunit() { beforeEach(async function (done) { console.info("richText beforeEach start"); let options = { - uri: 'pages/richText', + uri: 'MainAbility/pages/richText', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribaleAbstractJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribaleAbstractJsunit.test.ets index 54a38824cc5d96377e3f97e702bfe054fa1ab2a5..98db64a1f21c9fcb84bd67789839b9734c34144d 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribaleAbstractJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribaleAbstractJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; export default function SubscribaleAbstractJsunit() { describe('SubscribaleAbstract', function () { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribedAbstractPropertyJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribedAbstractPropertyJsunit.test.ets index 4f267d239782a9302ee004d5ed1d58e0d629872c..50d00808a6a850009ebd246f02120d46976a2731 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribedAbstractPropertyJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/SubscribedAbstractPropertyJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" export default function subscribedAbstractPropertyJsunit() { describe('appInfoTest_four_8', function () { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemAppJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemAppJsunit.test.ets index 74e41ec3b433e2b5067e5ddadd9f83d728d5d686..58868ae22fbb69404c5ac688e894c26eeb6ae5c9 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemAppJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemAppJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import app from '@system.app'; export default function systemAppJsunit() { @@ -24,8 +24,12 @@ export default function systemAppJsunit() { console.info('systemAppTest_0100 START'); var a = app.getInfo(); console.log('systemAppTest_0100 END' + JSON.stringify(a)); - expect(a.appID == "com.open.harmony.acetestfour").assertTrue(); - console.info('systemAppTest_0100 END'); + if(a != null) { + expect(a.appID == "com.open.harmony.acetestfour").assertTrue(); + console.info('systemAppTest_0100 END'); + } else { + expect(a == null).assertTrue(true); + } done(); }); @@ -33,7 +37,11 @@ export default function systemAppJsunit() { console.info('systemAppTest_0200 START'); var a = app.getInfo(); console.log('systemAppTest_0200 END' + JSON.stringify(a)); - expect(a.appName == "$string:entry_MainAbility").assertTrue(); + if (a != null) { + expect(a.appName == "$string:entry_MainAbility").assertTrue(); + } else { + expect(a == null).assertTrue(true); + } console.info('systemAppTest_0200 END'); done(); }); @@ -42,7 +50,11 @@ export default function systemAppJsunit() { console.info('systemAppTest_0300 START'); var a = app.getInfo(); console.log('systemAppTest_0300 END' + JSON.stringify(a)); - expect(a.versionName == "1.0.0").assertTrue(); + if(a != null) { + expect(a.versionName == "1.0.0").assertTrue(); + } else { + expect(a == null).assertTrue(true); + } console.info('systemAppTest_0300 END'); done(); }); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemRouterJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemRouterJsunit.test.ets index 417ec563b59d042284de0f8c708c9094390805ff..3f78851228df320c78e9ebbcfc8ab5825d1ebb22 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemRouterJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/SystemRouterJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -23,7 +23,7 @@ export default function systemRouterJsunit() { it('systemRouterTest001', 0, async function (done) { console.info('[systemRouterTest001] START'); let options = { - uri: 'pages/systemRouterA', + uri: 'MainAbility/pages/systemRouterA', } try { let result = await router.push(options); @@ -31,7 +31,7 @@ export default function systemRouterJsunit() { console.info("[systemRouterTest001] push page success " + JSON.stringify(result)); let pages = router.getState(); expect(pages.name).assertEqual('systemRouterA'); - expect(pages.path).assertEqual('pages/'); + expect(pages.path).assertEqual('MainAbility/pages/'); } catch (err) { console.error("[systemRouterTest001] push page error: " + err); } @@ -42,7 +42,7 @@ export default function systemRouterJsunit() { it('systemRouterTest002', 0, async function (done) { console.info('[systemRouterTest002] START'); let options = { - uri: 'pages/systemRouterA' + uri: 'MainAbility/pages/systemRouterA' } try { let result = await router.push(options); @@ -56,7 +56,6 @@ export default function systemRouterJsunit() { let callback = (paramsEvent) => { console.info("[systemRouterTest002] get state result is: " + JSON.stringify(paramsEvent)); expect(paramsEvent.data.params).assertEqual('B Page'); - done(); } let paramsEvent = { eventId: 211, @@ -72,6 +71,7 @@ export default function systemRouterJsunit() { await Utils.sleep(1000); router.back(); await Utils.sleep(1000); + done(); }); it('systemRouterTest003', 0, async function (done) { @@ -91,7 +91,7 @@ export default function systemRouterJsunit() { router.clear(); await Utils.sleep(1000); let options = { - uri: 'pages/systemRouterA' + uri: 'MainAbility/pages/systemRouterA' } try { let result = await router.push(options); @@ -101,7 +101,7 @@ export default function systemRouterJsunit() { } await Utils.sleep(1000); let optionsB = { - uri: 'pages/systemRouterB' + uri: 'MainAbility/pages/systemRouterB' } try { let result = await router.replace(optionsB); @@ -119,7 +119,7 @@ export default function systemRouterJsunit() { it('systemRouterTest005', 0, async function(done) { console.info('[systemRouterTest005] START'); let options = { - uri: 'pages/systemRouterA' + uri: 'MainAbility/pages/systemRouterB' } try { let result = await router.push(options); @@ -133,7 +133,7 @@ export default function systemRouterJsunit() { let callback = (paramsEvent) => { console.info("[systemRouterTest005] get state result is: " + JSON.stringify(paramsEvent)); expect(paramsEvent.data.params).assertEqual('B Page'); - done(); + } let paramsEvent = { eventId: 211, @@ -146,6 +146,8 @@ export default function systemRouterJsunit() { } console.info("[systemRouterTest005] click replace button result is: " + JSON.stringify(sendEventByKey('ReplaceButtonA', 10, ""))); + await Utils.sleep(1500); + done(); }); }); } diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextAreaJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextAreaJsunit.test.ets index bb4b52af25bf6a4f0fbe0cbc04d60dd894eb30fe..9549cf058cf7f81a8d03d4b57c975cef87917268 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextAreaJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextAreaJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function textAreaJsunit() { beforeEach(async function (done) { console.info("textArea beforeEach start"); let options = { - uri: 'pages/textArea', + uri: 'MainAbility/pages/textArea', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextClockJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextClockJsunit.test.ets index 81df092c0247325a165ed3a133caaee1f4d35dfe..55c03b01ed48da66ff1e28eac94f461f0091d6b1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextClockJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextClockJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function textClockJsunit() { beforeEach(async function (done) { console.info("text beforeEach start"); let options = { - uri: 'pages/textClock', + uri: 'MainAbility/pages/textClock', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextInputJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextInputJsunit.test.ets index 912d44a43d43b0b670892500b9acfc1ea02f9840..f210f9e0d5e2ee67ea28a676349861573bafb5c1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextInputJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextInputJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function textInputJsunit() { beforeEach(async function (done) { console.info("textInput beforeEach start"); let options = { - uri: 'pages/textInput', + uri: 'MainAbility/pages/textInput', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextPickerJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextPickerJsunit.test.ets index ce99011cd0e3d455b9b7c08fa8f695721be46b34..bf925c7c3310c75669d9d7308a3e3cedb064defa 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextPickerJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextPickerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function textPickerJsunit() { beforeEach(async function (done) { console.info("button beforeEach start"); let options = { - uri: 'pages/textPickerDialog', + uri: 'MainAbility/pages/textPickerDialog', } let result; try { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextTimerJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextTimerJsunit.test.ets index 23d278c16968be9c6abf7e2ecad63a14007dc266..1fa84d410e0a5cde6cfb66a379600b5c03d47c35 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/TextTimerJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/TextTimerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function textTimerJsunit() { beforeEach(async function (done) { console.info("textTimer beforeEach start"); let options = { - uri: 'pages/textTimer', + uri: 'MainAbility/pages/textTimer', } let result; try { diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/Utils.ets index 0f4b16d766f1feeb75edd8cc84cd1448d61e569a..bb1f4a49ebf2db8543071ec5999d44fff08a94d1 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/VideoJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/VideoJsunit.test.ets index be49382bcfc45a3a2472794b1a55c0710eded3a2..41013c0fa2d10e72633ed74bafd94459d390e8fd 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/VideoJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/VideoJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function videoJsunit() { beforeEach(async function (done) { console.info("video beforeEach start"); let options = { - uri: 'pages/video', + uri: 'MainAbility/pages/video', } try { router.clear(); diff --git a/arkui/ace_ets_component_four/entry/src/main/module.json b/arkui/ace_ets_component_four/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..debf13c307a7696dde27880e52243cb2b9916cca --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/module.json @@ -0,0 +1,35 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.open.harmony.acetestfour.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 diff --git a/arkui/ace_ets_component_four/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_four/entry/src/main/resources/base/element/string.json index f6488bb9ccc6588f4a68440a5a320c1d2d952a99..2b1f603a7ad038d6bf2c93aa0c352030c2cfb054 100644 --- a/arkui/ace_ets_component_four/entry/src/main/resources/base/element/string.json +++ b/arkui/ace_ets_component_four/entry/src/main/resources/base/element/string.json @@ -28,5 +28,34 @@ "name":"message_arrive", "value":"We will arrive at %s." } + , + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } ] } \ No newline at end of file diff --git a/arkui/ace_ets_component_four/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_component_four/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..297c85eeaa47045e63eaea7c27273049f5233840 --- /dev/null +++ b/arkui/ace_ets_component_four/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,35 @@ +{ + "src": [ + "MainAbility/pages/index", + "MainAbility/pages/calendar", + "MainAbility/pages/index/index", + "MainAbility/pages/second/second", + "MainAbility/pages/customDialogController", + "MainAbility/pages/dragEvent", + "MainAbility/pages/dragEvent2", + "MainAbility/pages/enumsItemAlign", + "MainAbility/pages/enumsLineCapStyle", + "MainAbility/pages/focus", + "MainAbility/pages/geometryTransition", + "MainAbility/pages/gestureMode", + "MainAbility/pages/image", + "MainAbility/pages/ohosPrompt", + "MainAbility/pages/panDirection", + "MainAbility/pages/path", + "MainAbility/pages/patternLock", + "MainAbility/pages/playMode", + "MainAbility/pages/polygon", + "MainAbility/pages/polyline", + "MainAbility/pages/refresh", + "MainAbility/pages/richText", + "MainAbility/pages/sideBar", + "MainAbility/pages/systemRouterA", + "MainAbility/pages/systemRouterB", + "MainAbility/pages/textArea", + "MainAbility/pages/textClock", + "MainAbility/pages/textInput", + "MainAbility/pages/textPickerDialog", + "MainAbility/pages/textTimer", + "MainAbility/pages/video" + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_two/AppScope/app.json b/arkui/ace_ets_component_two/AppScope/app.json new file mode 100644 index 0000000000000000000000000000000000000000..7ce583996de86060759898077a39cd4abe7fa618 --- /dev/null +++ b/arkui/ace_ets_component_two/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.open.harmony.acetesttwo", + "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 diff --git a/arkui/ace_ets_component_two/AppScope/resources/base/element/string.json b/arkui/ace_ets_component_two/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1 --- /dev/null +++ b/arkui/ace_ets_component_two/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"ohosProject" + } + ] +} \ No newline at end of file diff --git a/arkui/ace_ets_component_two/AppScope/resources/base/media/app_icon.png b/arkui/ace_ets_component_two/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023 Binary files /dev/null and b/arkui/ace_ets_component_two/AppScope/resources/base/media/app_icon.png differ diff --git a/arkui/ace_ets_component_two/BUILD.gn b/arkui/ace_ets_component_two/BUILD.gn index 675b5964e8fd2e22557e9b1c55dce37fa92be866..e457d6905dbce9dfcca59a27c305663bbb488c4c 100644 --- a/arkui/ace_ets_component_two/BUILD.gn +++ b/arkui/ace_ets_component_two/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,25 +14,30 @@ import("//test/xts/tools/build/suite.gni") ohos_js_hap_suite("ActsAceEtsComponentTwoTest") { - hap_profile = "./entry/src/main/config.json" + hap_profile = "entry/src/main/module.json" + js_build_mode = "debug" deps = [ ":ace_ets_component_assets", ":ace_ets_component_resources", - ":ace_ets_component_test_assets", + ] ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "ActsAceEtsComponentTwoTest" subsystem_name = "arkui" part_name = "ace_engine" } ohos_js_assets("ace_ets_component_assets") { - source_dir = "./entry/src/main/ets/MainAbility" + source_dir = "entry/src/main/ets" } -ohos_js_assets("ace_ets_component_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" + +ohos_app_scope("ace_ets_component_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] } + ohos_resources("ace_ets_component_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" + sources = [ "entry/src/main/resources" ] + deps = [ ":ace_ets_component_app_profile" ] + hap_profile = "entry/src/main/module.json" } diff --git a/arkui/ace_ets_component_two/Test.json b/arkui/ace_ets_component_two/Test.json index f541d52324c76911883ae944c753b24c3e243fc3..e9bdd51953afcf5d0f8513da3a5e68eed96805e5 100644 --- a/arkui/ace_ets_component_two/Test.json +++ b/arkui/ace_ets_component_two/Test.json @@ -1,10 +1,10 @@ { - "description": "Configuration for aceceshi Tests", + "description": "Configuration for hjunit demo Tests", "driver": { "type": "OHJSUnitTest", "test-timeout": "700000", - "bundle-name": "com.open.harmony.acetesttwo", - "package-name": "com.open.harmony.acetesttwo", + "bundle-name": "com.open.harmony.acetesttwo", + "module-name": "phone", "shell-timeout": "700000", "testcase-timeout":"10000" }, diff --git a/arkui/ace_ets_component_two/entry/src/main/config.json b/arkui/ace_ets_component_two/entry/src/main/config.json deleted file mode 100644 index 8f45dd7923ea04f7dbc50fb6ed7d89fe596ded92..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_two/entry/src/main/config.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "app": { - "bundleName": "com.open.harmony.acetesttwo", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.acetesttwo", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.acetesttwo.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/animationStatus", - "pages/bindMenu", - "pages/bindPopup", - "pages/configuration", - "pages/curves", - "pages/direction", - "pages/divider", - "pages/datePicker", - "pages/direction2", - "pages/flexDirection", - "pages/flexWrap", - "pages/gradientDirection", - "pages/imageAnimator", - "pages/loadingProgress", - "pages/listItem", - "pages/NavigatorCode", - "pages/navigation", - "pages/pageTransition", - "pages/PieceCode", - "pages/placement", - "pages/radio", - "pages/row", - "pages/systemPrompt", - "pages/sourceType", - "pages/search", - "pages/scrollBar", - "pages/ohosRouterA", - "pages/ohosRouterB", - "pages/WaterflowDemo" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/Application/AbilityStage.ts b/arkui/ace_ets_component_two/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0e0206ea9fb5ce94ef140d69510b6280969dd8e --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,9 @@ +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; + } +} diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/MainAbility.ts b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d66065e88c907379883364a43ec02989cfd626b --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,37 @@ +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 diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/NavigatorCode.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/NavigatorCode.ets index 16c6312041aec06982e2108010abd8b4c82a1199..798e86e8c018a91126c265acbec47ef77a791333 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/NavigatorCode.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/NavigatorCode.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/PieceCode.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/PieceCode.ets index 2c12b20848e400a357e143e5c8ea6367a18afb2e..2f534e83ca374ab5cc21e82b4483b47dafdd4dd9 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/PieceCode.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/PieceCode.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterFlowDataSource.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterFlowDataSource.ets index 2ca9983ed88afefbe9e951b72fe6a76d39d56732..d78fe2d2b0017a4dce1b33c258734cfaefee2ecb 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterFlowDataSource.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterFlowDataSource.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterflowDemo.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterflowDemo.ets index 896fee2a92671b7c464e3b236ec1c47c31cde312..50ba8f51a533e3fac77650fa9c483fabb4952aa2 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterflowDemo.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/WaterflowDemo.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/animationStatus.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/animationStatus.ets index 803b0155ffe0edad45c01daa0c50cefa0d38abf9..aad34490391aefb76eb2529104a1eeb41142e597 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/animationStatus.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/animationStatus.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindMenu.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindMenu.ets index 3090b06f2276983b5226ac7dbad3bc41d5e3c2ec..e4462116e2efde18cf5415f00712197f9535df17 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindMenu.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindMenu.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindPopup.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindPopup.ets index 99facca85887b810159b6514068439b772243160..640973c9fcf6fcf37baea4f95ab3fa4e6c734c0e 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindPopup.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/bindPopup.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/configuration.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/configuration.ets index 6397855feb43fc773754a76f6f6cbe08e07fed57..6e8a0b735c9cc7166aa836c9f2cb27ec4d94ab0d 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/configuration.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/configuration.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/curves.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/curves.ets index be4cab5c354d13acdb7e20547630dc76304de55f..7f88425a93ae28f90e52c3196795e31bd7ffec50 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/curves.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/curves.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/datePicker.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/datePicker.ets index 3bebb73202e090ebf9fb6fda82ef696b3944b445..30801821758e3bf2cdfe9151a3f66320d05130f5 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/datePicker.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/datePicker.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction.ets index 9970ad238a660feb847ede84cdc9b2c5e597e249..71483e9a37e427bdad0b19168d1a444006b196d2 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction2.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction2.ets index 4534b20795af6390b1da637262d78e67e87b5e8d..723266edd5137cba8b4b783f5d61aa8e502d6363 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction2.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/direction2.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -38,7 +38,7 @@ struct PositionExample { Text('4').height(50).width('25%').fontSize(16).backgroundColor(0xD2B48C) } .width('90%') - .direction(this.direction).key('direction') + .direction(this.direction).key('direction_2') } } .width('100%').margin({ top: 5 }).direction(Direction.Rtl) @@ -47,13 +47,13 @@ struct PositionExample { onPageShow() { console.info('direction2 page show called'); var stateChangeEvent = { - eventId: 82, + eventId: 1082, priority: events_emitter.EventPriority.LOW } events_emitter.on(stateChangeEvent, this.stateChangCallBack) var stateChangeEventOne = { - eventId: 83, + eventId: 1083, priority: events_emitter.EventPriority.LOW } events_emitter.on(stateChangeEventOne, this.stateChangCallBack) diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/divider.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/divider.ets index ca6f83d8cbac64c043efc091d2726b95c8fb0747..497b5138be28356659cf9518adaa8a1a498d2f46 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/divider.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/divider.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexDirection.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexDirection.ets index 3f1f52a12d456c8d99bfc63789bbc02fba9007c3..68aad7ec623abb32913a016c2c2acfe591686f2c 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexDirection.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexDirection.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexWrap.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexWrap.ets index e99f9157ad8b48622ba10ebd44b9a56aacd44760..adb75e5dc700993a37b87051dfa69544cb0ad1d0 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexWrap.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/flexWrap.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/gradientDirection.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/gradientDirection.ets index ba8d8d29b8ffc0a6071718b5177307affc248ac0..501d3d47fd8212e2e9f38bdf1fe7b92ef32c6082 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/gradientDirection.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/gradientDirection.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/imageAnimator.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/imageAnimator.ets index db1a425213f69b2ef74eb3dcdf53727db522916f..aa4e8b4fef8dc18d69c73fa3087ec716ffc1c37e 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/imageAnimator.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/imageAnimator.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index.ets index 5be55e99f496a3ceb6a27d86a7785c7ae30909f2..5b0b229e33e35b7282d87c42356945c421a6385d 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index/index.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e231258d8a2c81943958dd04a85d57a68d3dd58 --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -0,0 +1,56 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/listItem.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/listItem.ets index 250c4a17ba31677f63bec4fc8518217370235c01..0a236cb3595188780f273e42f025cd313fad69f2 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/listItem.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/listItem.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/loadingProgress.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/loadingProgress.ets index 9c7cc1a5be5ecb29a81d8b71a88b6d6465682481..a83dc6483dfad7425e2918b575cc7e08cd89d591 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/loadingProgress.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/loadingProgress.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/navigation.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/navigation.ets index 7a393179400a7402a419d39b371013d76e564ffe..fa5c61ddf1ceeb4f15747479e305cf9ef6f461e5 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/navigation.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/navigation.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterA.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterA.ets index d0ad16331461c0dc66f17903ef3b88b43de2852a..3f19f9b61b1316b3f852836961ffafa7bc374f3c 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterA.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterA.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterB.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterB.ets index 7c761cade13635b3c186eac60ae0da38e2742ace..f5cb002747773b66295198218def5d38dc4f4034 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterB.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/ohosRouterB.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition.ets index f9e6678dbd468b5a6733941d5a112e2d068488b0..9f4ed3fec7221a36cc592bdb1a0ac8842e390d27 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition2.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition2.ets index fab041ca7466ef3b6c635e551a555202475baffe..9822925f0c18a7a5ee19b869e018ab083370e25a 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition2.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/pageTransition2.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/placement.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/placement.ets index 962075f2d1d5fa1de4fab73ae8f1b96a2e8dbc6c..97b3cd219d4c1b53399c2f512dc7b89ffab918d6 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/placement.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/placement.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/radio.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/radio.ets index 56a8b29318e6a783d17707e1d499fbe2b90da314..7d8cbea8817b9545544abc64be61ea0b6f9415ed 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/radio.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/radio.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/row.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/row.ets index a3c97e10856b69a2ffce2528693626c3f6db7f15..f1d6caa3ed0cde4da25ddde3c094edf012c02ba1 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/row.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/row.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/scrollBar.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/scrollBar.ets index c6a5619e5f58e9189760e0030e2f3afcb4f56754..5657317d11d23a937b797dce05ad8247623828a3 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/scrollBar.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/scrollBar.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/search.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/search.ets index 28a06117d1ec3b79033b13cbf04ce99de3969420..22f02122e823ec93a2123423ee3300c02037c300 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/search.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/search.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/second/second.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/second/second.ets new file mode 100644 index 0000000000000000000000000000000000000000..7396425947cd4d9c1016f77855e792bfb6869629 --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/second/second.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/sourceType.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/sourceType.ets index 51cb733b1c1be2cbcdba01bcd3ab0ea2085db7c2..198e491163a39a51420908e7951d7c767ffe3648 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/sourceType.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/sourceType.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/systemPrompt.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/systemPrompt.ets index c59ce91220a65bd9c473e7244dd58ee2661b585f..dc71679e099c776f3b0ce99fb04a91a69cde351c 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/systemPrompt.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/pages/systemPrompt.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Common.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Common.ets new file mode 100644 index 0000000000000000000000000000000000000000..a67880c93d98eb600808e0b1bb4d2052e3f9f35f --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Common.ets @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class CommonFunc { + static rect_left; + static rect_top; + static rect_right; + static rect_bottom; + static rect_value; + + static sleep(time){ + return new Promise((resolve,reject)=>{ + setTimeout(()=>{ + resolve("ok") + },time) + }).then(()=>{ + console.info(`sleep ${time} over...`) + }) + } + + static getComponentRect(key) { + let strJson = getInspectorByKey(key); + let obj = JSON.parse(strJson); + console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + let rectInfo = JSON.parse('[' + obj.$rect + ']') + console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] + this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] + this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] + this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1] + return this.rect_value = { + "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom + } + } +} + + + + diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Constants.ets b/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Constants.ets deleted file mode 100644 index 13a6c0d16e7277756efb5136ce8b02ac6b601d50..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_two/entry/src/main/ets/MainAbility/utils/Constants.ets +++ /dev/null @@ -1,112 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const TYPE = '$type' -const ID = '$ID' -const Z_INDEX = '$z-index' -const RECT = '$rect' -const DEBUGLINE = '$debugLine' -const ATTRS = '$attrs' -const ATTRS_SEPIA = 'sepia' -const ATTRS_ASPECTRATIO = 'aspectRatio' -const ATTRS_CONTRAST = 'contrast' -const ATTRS_SATURATE = 'saturate' -const ATTRS_HUEROTATE = 'hueRotate' -const ATTRS_INVERT = 'invert' -const ATTRS_BRIGHTNESS = 'brightness' -const ATTRS_BACKDROPBLUR = 'backdropBlur' -const ATTRS_GRAYSCALE = 'grayscale' -const ATTRS_BLUR = 'blur' -const ATTRS_GRIDOFFSET = 'gridOffset' -const ATTRS_FLEXSHRINK = 'flexShrink' -const ATTRS_FLEXGROW = 'flexGrow' -const ATTRS_OPACITY = 'opacity' -const ATTRS_DIRECTION = 'direction' -const ATTRS_ALIGN = 'align' -const ATTRS_HEIGHT = 'height' -const ATTRS_BACKGROUNDCOLOR = 'backgroundColor' -const ATTRS_ALIGNSELF = 'alignSelf' -const ATTRS_BORDERWIDTH = 'borderWidth' -const ATTRS_WIDTH = 'width' -const ATTRS_BORDERCOLOR = 'borderColor' -const ATTRS_MARGIN_BOTTOM = 'margin-bottom' -const ATTRS_BORDERSTYLE = 'borderStyle' -const ATTRS_MARGIN_RIGHT = 'margin-right' -const ATTRS_CONSTRAINTSIZE = 'constraintSize' -const ATTRS_NARGIN_LEFT = 'margin-left' -const ATTRS_BACKGROUNDIMAGE = 'backgroundImage' -const ATTRS_MARGIN_TOP = 'margin-top' -const ATTRS_BORDERRADIUS = 'borderRadius' -const ATTRS_FLEXBASIC = 'flexBasis' -const ATTRS_VISIBILITY = 'visibility' -const ATTRS_PASSWORD = 'password' -const ATTRS_CHECKED = 'checked' -const ATTRS_SELECTED = 'selected' -const ATTRS_LONG_CLICKABLE = 'long-clickable' -const ATTRS_FOCUSED = 'focused' -const ATTRS_SCROLLABLE = 'scrollable' -const ATTRS_CLICKABLE = 'clickable' -const ATTRS_FOCUSABLE = 'focusable' -const ATTRS_CHECKABLE = 'checkable' -const ATTRS_CLIP = 'clip' -const ATTRS_ENABLE = 'enabled' -const ATTRS_DISPLAYPRIORITY = 'displayPriority' -const ATTRS_LAYOUTWEIGHT = 'layoutWeight' -const ATTRS_LAYOUTPRIORITY = 'layoutPriority' -const ATTRS_GRIDSPAN = 'gridSpan' -const ATTRS_ZINDEX = 'zIndex' -const ATTRS_USEALIGN = 'useAlign' -const ATTRS_USEALIGN_EDGE = 'edge' -const ATTRS_USEALIGN_OFFSET = 'offset' -const ATTRS_MASK = 'mask' -const ATTRS_MARKANCHOR = 'markAnchor' -const ATTRS_MARKANCHOR_X = 'x' -const ATTRS_MARKANCHOR_Y = 'y' -const ATTRS_PADDING = 'padding' -const ATTRS_POSITION = 'position' -const ATTRS_POSITION_X = 'x' -const ATTRS_POSITION_Y = 'y' -const ATTRS_BACKGROUNDIMAGEPOSITION = 'backgroundImagePosition' -const ATTRS_BACKGROUNDIMAGEPOSITION_X = 'x' -const ATTRS_BACKGROUNDIMAGEPOSITION_Y = 'y' -const ATTRS_BACKGROUNDIMAGESIZE = 'backgroundImageSize' -const ATTRS_OFFSET = 'offset' -const ATTRS_OFFSET_X = 'x' -const ATTRS_OFFSET_Y = 'y' -const ATTRS_SHADOW = 'shadow' -const ATTRS_SHADOW_RADIUS = 'radius' -const ATTRS_SHADOW_COLOR = 'color' -const ATTRS_SHADOW_OFFSETX = 'offsetX' -const ATTRS_SHADOW_OFFSETY = 'offsetY' -const ATTRS_WINDOWBLUR = 'windowBlur' -const ATTRS_WINDOWBLUR_PERCENT = 'percent' -const ATTRS_WINDOWBLUR_STYLE = 'style' -const ATTRS_FONTFAMILY = 'fontFamily' -const ATTRS_FONTWEIGHT = 'fontWeight' -const ATTRS_FONTSTYLE = 'fontStyle' -const ATTRS_FONTSIZE = 'fontSize' -const ATTRS_TEXTCASE = 'textCase' -const ATTRS_MAXLINES = 'maxLines' -const ATTRS_DECORATION = 'decoration' -const ATTRS_BASELINEOFFSET = 'baselineOffset' -const ATTRS_TEXTOVERFLOW = 'textOverflow' -const ATTRS_LINEHEIGHT = 'lineHeight' -const ATTRS_FONTCOLOR = 'fontColor' -const ATTRS_TEXTALIGN = 'textAlign' -const ATTRS_CONTENT = 'content' - - - - diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/TestAbility.ts b/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/TestAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..871dc89b25426b48a4575c64948ef5d916477140 --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/TestAbility.ts @@ -0,0 +1,50 @@ +/* + * 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 diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index b917b80ff7cabb5078dd7a9d9bf546c510bd86d7..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/pages/index.ets index f87ca6e18f4a4dd9c1804b8edabe664029341e78..441f24058499e3ea4c4c3d96a776f02192e02549 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -21,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_two/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index dfbf1f268a45e4a2f30b8c836f42d76f3a9f5ad3..36e8b386edcf3b7368ec95690c8b762dc4393c81 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component_two/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,6 +1,5 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,25 +20,25 @@ var abilityDelegatorArguments = undefined function translateParamsToString(parameters) { const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', + '-s class', '-s notClass', '-s suite', '-s it', '-s level', '-s testType', '-s size', '-s timeout', - '-s package' + '-s dryRun' ]) let targetParams = ''; for (const key in parameters) { if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] + targetParams = `${targetParams} ${key} ${parameters[key]}` } } return targetParams.trim() } async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); + console.log("onAbilityCreateCallback"); } async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) } export default class OpenHarmonyTestRunner implements TestRunner { @@ -47,22 +46,26 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') + console.info("OpenHarmonyTestRunner OnPrepare ") } - onRun() { + async onRun() { console.log('OpenHarmonyTestRunner onRun run') abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - + var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' let lMonitor = { abilityName: testAbilityName, onAbilityCreate: onAbilityCreateCallback, }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility' abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + var cmd = 'aa start -d 0 -a com.open.harmony.acetesttwo.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } console.info('cmd : '+cmd) abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { @@ -70,9 +73,6 @@ export default class OpenHarmonyTestRunner implements TestRunner { console.info('executeShellCommand : data : ' + d.stdResult); console.info('executeShellCommand : data : ' + d.exitCode); }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) console.info('OpenHarmonyTestRunner onRun end') } }; \ No newline at end of file diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/AnimationStatusJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/AnimationStatusJsunit.test.ets index 987e2757371000e2d82bab690a8729aea2855f0e..6fc34a6c8fd990fa7c626dd3c915e9fe536374cf 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/AnimationStatusJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/AnimationStatusJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function animationStatusJsunit() { describe('animationStatus', function () { beforeEach(async function (done) { let options = { - uri: 'pages/animationStatus', + uri: 'MainAbility/pages/animationStatus', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/BindMenuJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/BindMenuJsunit.test.ets index b1059b2d37db0d325bf296c0d988221570caf5ca..82ddead1bc7941bcbf540f4973651d4c58159320 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/BindMenuJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/BindMenuJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function aboutToDisappearJsunit() { beforeEach(async function (done) { console.info("bindMenu beforeEach start"); let options = { - uri: 'pages/bindMenu', + uri: 'MainAbility/pages/bindMenu', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/BindPopupJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/BindPopupJsunit.test.ets index 7cf0c99325c435c7b27a644f83c812046ad2c30b..d58e6e995e55337ab61441cd14683c28532ce19d 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/BindPopupJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/BindPopupJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function customPopupOptionJsunit(){ describe('bindPopupTest', function (){ beforeEach(async function (done) { let options = { - uri: 'pages/bindPopup', + uri: 'MainAbility/pages/bindPopup', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/ConfigurationJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/ConfigurationJsunit.test.ets index 03ed25ab5c15b4f5c9a4d8c2985d38df62cea5be..9fe1ea142fb1775589d9cfa22446b3f597eb2ed0 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/ConfigurationJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/ConfigurationJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function transFormJsunit() { beforeEach(async function (done) { console.info("prompt beforeEach start"); let options = { - uri: 'pages/configuration', + uri: 'MainAbility/pages/configuration', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/CurvesJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/CurvesJsunit.test.ets index fcf57e3dfdd2470c5f71b84c92f5a8081f07fb2e..784e15f86ea640b5365dd13e56749cd255d1ce5f 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/CurvesJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/CurvesJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function curvesJsunit() { beforeEach(async function (done) { console.info("curves beforeEach start"); let options = { - uri: 'pages/curves', + uri: 'MainAbility/pages/curves', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/DatePickerJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/DatePickerJsunit.test.ets index 9749b145fe1757306d5a21d71bb8ae0182f2ab0b..f81292c9c5995ea00b6c1f8ab0e37a1943a4a5c9 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/DatePickerJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/DatePickerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function datePickerJsunit() { describe('appInfoTest_two_3', function () { beforeEach(async function (done) { let options = { - uri: 'pages/datePicker', + uri: 'MainAbility/pages/datePicker', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/Direction2Jsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/Direction2Jsunit.test.ets index 6ff0326637d79a7268e8093e8ae7921db9627896..2d8a12ae809ea98338d07851faad4b8a32891953 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/Direction2Jsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/Direction2Jsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function direction2Jsunit(){ describe('direction2Test', function (){ beforeEach(async function (done) { let options = { - uri: 'pages/direction2', + uri: 'MainAbility/pages/direction2', } try { router.clear(); @@ -45,16 +45,6 @@ export default function direction2Jsunit(){ console.info("direction after each called"); }); - it('direction2Test_0100', 0, async function (done) { - console.info('direction2Test_0100 START'); - let strJson = getInspectorByKey('direction'); - console.info("direction2Test_0100 component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("direction2Test_0100 component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.direction).assertEqual("Direction.Ltr"); - done(); - }); - it('direction2Test_0200', 0, async function (done) { console.info('direction2Test_0200 START'); try { @@ -64,7 +54,7 @@ export default function direction2Jsunit(){ } } let indexEvent = { - eventId: 82, + eventId: 1082, priority: events_emitter.EventPriority.LOW } console.info("direction2Test_0200 start to publish emit"); @@ -73,7 +63,7 @@ export default function direction2Jsunit(){ console.log("direction2Test_0200 change component data error: " + err.message); } await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('direction'); + let strJsonNew = getInspectorByKey('direction_2'); let objNew = JSON.parse(strJsonNew); console.info("direction2Test_0200 component objNew is: " + JSON.stringify(objNew)); expect(objNew.$attrs.direction).assertEqual('Direction.Rtl'); @@ -81,6 +71,16 @@ export default function direction2Jsunit(){ done(); }); + it('direction2Test_0100', 0, async function (done) { + console.info('direction2Test_0100 START'); + let strJson = getInspectorByKey('direction_2'); + console.info("direction2Test_0100 component strJson:" + strJson); + let obj = JSON.parse(strJson); + console.info("direction2Test_0100 component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.direction).assertEqual("Direction.Rtl"); + done(); + }); + it('direction2Test_0300', 0, async function (done) { console.info('direction2Test_0300 START'); try { @@ -90,7 +90,7 @@ export default function direction2Jsunit(){ } } let indexEvent = { - eventId: 83, + eventId: 1083, priority: events_emitter.EventPriority.LOW } console.info("direction2Test_0300 start to publish emit"); @@ -99,7 +99,7 @@ export default function direction2Jsunit(){ console.log("direction2Test_0300 change component data error: " + err.message); } await Utils.sleep(1000); - let strJsonNew = getInspectorByKey('direction'); + let strJsonNew = getInspectorByKey('direction_2'); let objNew = JSON.parse(strJsonNew); console.info("direction2Test_0300 component objNew is: " + JSON.stringify(objNew)); expect(objNew.$attrs.direction).assertEqual('Direction.Auto'); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/DirectionJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/DirectionJsunit.test.ets index ef49ff3b7af0fc313ce4b5ac65db36383ff2a8dd..661ccfd3b3b6d18df8b1ef3768b77c07c6f6469b 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/DirectionJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/DirectionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function directionJsunit(){ describe('directionTest', function (){ beforeEach(async function (done) { let options = { - uri: 'pages/direction', + uri: 'MainAbility/pages/direction', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/DividerJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/DividerJsunit.test.ets index 3f25a013bab7ff82a839c193f4b352c6cbb7cfcc..9986e076ea39c5504fed4ebef0c06a8622f5b38e 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/DividerJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/DividerJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function dividerJsunit() { describe('dividerTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/divider', + uri: 'MainAbility/pages/divider', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexDirectionJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexDirectionJsunit.test.ets index 7915737a5958a5156a701873df0940a7a0a758b6..22048571cda4f2022f9f96724f86439a9a4a5fee 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexDirectionJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexDirectionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function flexDirectionJsunit(){ beforeEach(async function (done) { console.info("text beforeEach start"); let options = { - uri: 'pages/flexDirection', + uri: 'MainAbility/pages/flexDirection', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexWrapJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexWrapJsunit.test.ets index 4204e7bbdc72a3203927aa20ac5ee3f66123afb3..b20104bf14c42a6c7ef2926a8f12e6eb4a24e8b6 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexWrapJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/FlexWrapJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function flexWrapJsunit() { beforeEach(async function (done) { console.info("text beforeEach start"); let options = { - uri: 'pages/flexWrap', + uri: 'MainAbility/pages/flexWrap', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/GradientDirectionJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/GradientDirectionJsunit.test.ets index 67ef35440559ac0b315f583941f075a225ca55a6..e99f0c691ba22683dca2669002738dfa603b5a48 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/GradientDirectionJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/GradientDirectionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function gridJsunit() { beforeEach(async function (done) { console.info('beforeEach ===================GradientDirection test beforeEach called==================='); let options = { - uri: 'pages/gradientDirection', + uri: 'MainAbility/pages/gradientDirection', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/ImageAnimatorJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/ImageAnimatorJsunit.test.ets index 9dd851395e6817b3706b6105b63278ff4484b90e..cdcabe1e3c22a5cf0ad1a1ca4dd0d5c6e24df622 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/ImageAnimatorJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/ImageAnimatorJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function imageAnimatorJsunit(){ beforeEach(async function (done) { console.info("imageAnimator beforeEach start"); let options = { - uri: 'pages/imageAnimator', + uri: 'MainAbility/pages/imageAnimator', } let result; try{ diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/List.test.ets index 73088369dea53230216456eef433f2b5723e466d..16bb5ab61c411a9a355d0581b023ac4ce48b08a8 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/List.test.ets @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/ListItemJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/ListItemJsunit.test.ets index a727a7cb01bb833027a1287b5597fd5bdbb1c577..8ab0db479e7a345017b6abffa218985252bf070f 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/ListItemJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/ListItemJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function listItemJsunit() { beforeEach(async function (done) { console.info("listItem beforeEach start"); let options = { - uri: 'pages/listItem', + uri: 'MainAbility/pages/listItem', } try { router.clear(); @@ -89,7 +89,7 @@ export default function listItemJsunit() { let strJson = getInspectorByKey('List'); let obj = JSON.parse(strJson); console.info("[testListItem03] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.editMode).assertEqual('true'); + expect(obj.$attrs.editMode).assertTrue(); console.info('testListItem03 END'); done(); }); @@ -115,7 +115,7 @@ export default function listItemJsunit() { let strJson = getInspectorByKey('List'); let obj = JSON.parse(strJson); console.info("[testListItem04] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.editMode).assertEqual('false'); + expect(obj.$attrs.editMode).assertFalse(); console.info('testListItem04 END'); done(); }); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/LoadingProgressJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/LoadingProgressJsunit.test.ets index a83340b6d4abd81284ac8654dfb311fe8412d78e..c8e6ed1e1668cfbf384c2dc9e0a499f7689909d8 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/LoadingProgressJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/LoadingProgressJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -21,7 +21,7 @@ export default function loadingProgressJsunit() { describe('loadingProgressTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/loadingProgress', + uri: 'MainAbility/pages/loadingProgress', } try { router.clear(); @@ -61,7 +61,8 @@ export default function loadingProgressJsunit() { let strJson = getInspectorByKey('LP'); let obj = JSON.parse(strJson); console.info("testLoadingProgress_200 component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.borderRadius).assertEqual("0.0vp"); + let borders = obj.$attrs.borderRadius; + expect(borders instanceof Object).assertTrue(); console.info('testLoadingProgress_200 END'); done(); }); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigationJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigationJsunit.test.ets index 3b803b536bcd4f0769c3191522b494c151f878a8..87a071bc83a3872c9863bfb571c096d45d429e9f 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigationJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigationJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function navigationJsunit() { beforeEach(async function (done) { console.info("navigation beforeEach start"); let options = { - uri: 'pages/navigation', + uri: 'MainAbility/pages/navigation', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigatorCodeJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigatorCodeJsunit.test.ets index 6a2f83123e7961dac083e6f96f35f9d2765eb899..df01288f804df3156f2f3afd2b4b2508a181fca4 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigatorCodeJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/NavigatorCodeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -24,7 +24,7 @@ export default function navigatorCodeJsunit() { beforeEach(async function (done) { console.info("NavigatorClick beforeEach start"); let options = { - uri: 'pages/NavigatorCode', + uri: 'MainAbility/pages/NavigatorCode', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/OhosRouterJsnuit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/OhosRouterJsnuit.test.ets index 05f8239358e18726b22f5e571c3ee5c5d240270d..443735ad26187258dfe8409ce64d1d545febbc47 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/OhosRouterJsnuit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/OhosRouterJsnuit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function OhosRouterJsunit() { describe('ohosRouterTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/ohosRouterA', + uri: 'MainAbility/pages/ohosRouterA', } try { router.clear(); @@ -55,9 +55,9 @@ export default function OhosRouterJsunit() { await Utils.sleep(1000); console.info("[ohosRouterTest001] push page success " + JSON.stringify(result)); let pages = router.getState(); - expect(pages.index).assertEqual(3); + expect(pages.index).assertEqual(2); expect(pages.name).assertEqual('ohosRouterA'); - expect(pages.path).assertEqual('pages/'); + expect(pages.path).assertEqual('MainAbility/pages/'); } catch (err) { console.error("[ohosRouterTest001] push page error: " + err); } @@ -123,7 +123,7 @@ export default function OhosRouterJsunit() { } catch (err) { console.error("[ohosRouterTest004] push page error " + JSON.stringify(result)); } - await Utils.sleep(1000); + await Utils.sleep(2000); let optionsB = { uri: 'pages/ohosRouterB' } @@ -136,7 +136,7 @@ export default function OhosRouterJsunit() { await Utils.sleep(1500); let size = router.getLength(); console.info("[ohosRouterTest004] size" + size); - expect(size).assertEqual("2"); + expect(size).assertEqual("1"); done(); }); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/PageTransitionJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/PageTransitionJsunit.test.ets index 603bdfa4129e6d59fe02fe0afb56cb827a35ec5c..c42a923dfd3b34afcfd5d03328196d7c018f7761 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/PageTransitionJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/PageTransitionJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter' import Utils from './Utils'; @@ -23,7 +23,7 @@ export default function pageTransitionJsunit() { beforeEach(async function (done) { console.info("pageTransition beforeEach start"); let options = { - uri: 'pages/pageTransition', + uri: 'MainAbility/pages/pageTransition', } try { router.clear(); @@ -97,11 +97,16 @@ export default function pageTransitionJsunit() { } catch (err) { console.log("pageTransitionTest_0400 change component data error: " + err.message); } + await Utils.sleep(4000); let callback = (indexEventOne) => { - console.info("pageTransitionTest_0400 get state result is: " + JSON.stringify(indexEventOne)); - expect(indexEventOne.data.scale).assertEqual(6); - expect(indexEventOne.data.opacity).assertEqual(5); - expect(indexEventOne.data.type).assertEqual(RouteType.Pop); + try { + console.info("pageTransitionTest_0400 get state result is: " + JSON.stringify(indexEventOne)); + expect(indexEventOne.data.scale).assertEqual(6); + expect(indexEventOne.data.opacity).assertEqual(5); + expect(indexEventOne.data.type).assertEqual(RouteType.Push); + } catch(err) { + console.info("pageTransitionTest_0400 get state result is err: " + JSON.stringify(err)); + } } let indexEventOne = { eventId: 144, diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/PieceJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/PieceJsunit.test.ets index 92653ec14d78c300d4cb0c9b9d1c09d5d01a6fd1..dad3fcc9a5c4d9dd9041f86407267f0e4b0e34b2 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/PieceJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/PieceJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"; import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function pieceJsunit() { describe('appInfoTest_two_6', function () { beforeEach(async function (done) { let options = { - uri: 'pages/PieceCode', + uri: 'MainAbility/pages/PieceCode', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/PlacementJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/PlacementJsunit.test.ets index ce59cc7cd70bdc2138920a7870923e02ced54d64..a6dc0a88078f16c36db78b340314d5f1a85db2da 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/PlacementJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/PlacementJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; import events_emitter from '@ohos.events.emitter'; @@ -22,7 +22,7 @@ export default function placementJsunit(){ describe('placementTest', function (){ beforeEach(async function (done) { let options = { - uri: 'pages/placement', + uri: 'MainAbility/pages/placement', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/RadioJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/RadioJsunit.test.ets index 8a4dd28c7f101fc045ac2de03765e0aa8a1b6763..400cb7b44fcf8d9defbb273d8021f1f8045f6354 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/RadioJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/RadioJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function radioJsunit() { describe('radioTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/radio', + uri: 'MainAbility/pages/radio', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/RowJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/RowJsunit.test.ets index 0834446634d3f81cd2a8658bfe168394a8fe1291..022b61e40ea680c158a451d92fc978ba8e71a77c 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/RowJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/RowJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function rowJsunit() { describe('rowTest', function () { beforeEach(async function (done) { let options = { - uri: 'pages/row', + uri: 'MainAbility/pages/row', } try { router.clear(); @@ -62,7 +62,7 @@ export default function rowJsunit() { let strJson = getInspectorByKey('Row'); let obj = JSON.parse(strJson); console.info("testRow_200 component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.direction).assertEqual("Direction.Ltr"); + expect(obj.$attrs.direction).assertEqual("Direction.Auto"); console.info('testRow_200 END'); done(); }); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/ScrollBarJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/ScrollBarJsunit.test.ets index 9ecd6a122d75a5f7a53b3128845633a836e5f12d..699095ce5d00eefd8f35163cb8344f4b66707daa 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/ScrollBarJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/ScrollBarJsunit.test.ets @@ -1,6 +1,6 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function scrollBarJsunit() { describe('appInfoTest_two_8', function () { beforeEach(async function (done) { let options = { - uri: 'pages/scrollBar', + uri: 'MainAbility/pages/scrollBar', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/SearchJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/SearchJsunit.test.ets index 33e612f738e639b691b9527263125c53c7402c08..cf25335ab5fcae8236b9d96f0b8265bfbf34134f 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/SearchJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/SearchJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function searchJsunit() { describe('appInfoTest_two_10', function () { beforeEach(async function (done) { let options = { - uri: 'pages/search', + uri: 'MainAbility/pages/search', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/SourceTypeJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/SourceTypeJsunit.test.ets index 555b03ac2636098ddcc30d8fb953f1a40b4e2b5f..8a2ce31222e81154d73bffe60a2f7499e715b710 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/SourceTypeJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/SourceTypeJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; @@ -23,7 +23,7 @@ export default function sourceTypeJsunit() { beforeEach(async function (done) { console.info("sourceType beforeEach start"); let options = { - uri: 'pages/sourceType', + uri: 'MainAbility/pages/sourceType', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/SystempromptJsunit.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/SystempromptJsunit.test.ets index 0630af204e84d476e5acc59ab25b26ef7adb8f84..55b6f3ea4a933cb7af465a447c7bbf33add75096 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/SystempromptJsunit.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/SystempromptJsunit.test.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium" import router from '@system.router'; import Utils from './Utils'; @@ -22,7 +22,7 @@ export default function transFormJsunit() { beforeEach(async function (done) { console.info("prompt beforeEach start"); let options = { - uri: 'pages/systemPrompt', + uri: 'MainAbility/pages/systemPrompt', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/Utils.ets index 0f4b16d766f1feeb75edd8cc84cd1448d61e569a..bb1f4a49ebf2db8543071ec5999d44fff08a94d1 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/Utils.ets @@ -1,6 +1,6 @@ // @ts-nocheck /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/arkui/ace_ets_component_two/entry/src/main/ets/test/waterFlowDemo.test.ets b/arkui/ace_ets_component_two/entry/src/main/ets/test/waterFlowDemo.test.ets index 552b3d33b4f2883cb0b5616b8b11f20b2858685e..4e0e669453fbadac0bfb22e1a245bee96e522d34 100644 --- a/arkui/ace_ets_component_two/entry/src/main/ets/test/waterFlowDemo.test.ets +++ b/arkui/ace_ets_component_two/entry/src/main/ets/test/waterFlowDemo.test.ets @@ -24,7 +24,7 @@ export default function waterFlowDemoJsunit() { beforeAll(async function (done) { console.info("waterFlow beforeEach start"); let options = { - uri: 'pages/WaterflowDemo', + uri: 'MainAbility/pages/WaterflowDemo', } try { router.clear(); diff --git a/arkui/ace_ets_component_two/entry/src/main/module.json b/arkui/ace_ets_component_two/entry/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..176bfa9b441e1df8738a40528c52d6f9967c5917 --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/module.json @@ -0,0 +1,35 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "tablet", + "default", + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.open.harmony.acetesttwo.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 diff --git a/arkui/ace_ets_component_two/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_two/entry/src/main/resources/base/element/string.json index f6488bb9ccc6588f4a68440a5a320c1d2d952a99..d20d4ea16904260695bf06b07c6ace685db6bec2 100644 --- a/arkui/ace_ets_component_two/entry/src/main/resources/base/element/string.json +++ b/arkui/ace_ets_component_two/entry/src/main/resources/base/element/string.json @@ -27,6 +27,34 @@ { "name":"message_arrive", "value":"We will arrive at %s." - } + }, + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } ] } \ No newline at end of file diff --git a/arkui/ace_ets_component_two/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_component_two/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..e5ce35213e9d4d37aa4e00fc0635bc2b80f87e3d --- /dev/null +++ b/arkui/ace_ets_component_two/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,36 @@ +{ + "src": [ + "MainAbility/pages/index", + "MainAbility/pages/index/index", + "MainAbility/pages/second/second", + "MainAbility/pages/animationStatus", + "MainAbility/pages/bindMenu", + "MainAbility/pages/bindPopup", + "MainAbility/pages/configuration", + "MainAbility/pages/curves", + "MainAbility/pages/direction", + "MainAbility/pages/divider", + "MainAbility/pages/datePicker", + "MainAbility/pages/direction2", + "MainAbility/pages/flexDirection", + "MainAbility/pages/flexWrap", + "MainAbility/pages/gradientDirection", + "MainAbility/pages/imageAnimator", + "MainAbility/pages/loadingProgress", + "MainAbility/pages/listItem", + "MainAbility/pages/NavigatorCode", + "MainAbility/pages/navigation", + "MainAbility/pages/pageTransition", + "MainAbility/pages/PieceCode", + "MainAbility/pages/placement", + "MainAbility/pages/radio", + "MainAbility/pages/row", + "MainAbility/pages/systemPrompt", + "MainAbility/pages/sourceType", + "MainAbility/pages/search", + "MainAbility/pages/scrollBar", + "MainAbility/pages/ohosRouterA", + "MainAbility/pages/ohosRouterB", + "MainAbility/pages/WaterflowDemo" + ] +} \ No newline at end of file