diff --git a/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json b/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json new file mode 100755 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/main/resources/dark/element/dark.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add.png new file mode 100755 index 0000000000000000000000000000000000000000..ef92938ef4fcdd867d50ab59e6300c3edd818e3e Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add_active.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add_active.png new file mode 100755 index 0000000000000000000000000000000000000000..d0f6701767d4b4fe7cd9e80a960c063022e9c037 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/Add_active.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/ccreturn.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/ccreturn.png new file mode 100755 index 0000000000000000000000000000000000000000..73cc1b7328e3b0587c27e6befb80a27a3fc2d661 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/ccreturn.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/chris.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/chris.png new file mode 100755 index 0000000000000000000000000000000000000000..af61ddb95d5ee0acabaccdc36b33c2726b1694ff Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/chris.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect.png new file mode 100755 index 0000000000000000000000000000000000000000..463a4b6fe561f0a9a1b74820936da5e463b77219 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect_active.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect_active.png new file mode 100755 index 0000000000000000000000000000000000000000..531f74b010d9bb41f885a297d23459dc54f8e4dd Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/collect_active.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/img.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/img.png new file mode 100755 index 0000000000000000000000000000000000000000..36ce28022290f605c42c3dbf5ab060665930ebde Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/img.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more.png new file mode 100755 index 0000000000000000000000000000000000000000..072b4d222f9818b1af77996857ef69f080ddd5fc Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more_active.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more_active.png new file mode 100755 index 0000000000000000000000000000000000000000..94a9c9479e6f3caf078f9b9acf8072d8dd806e48 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/more_active.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/return.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/return.png new file mode 100755 index 0000000000000000000000000000000000000000..2fbc032dfe6cd8683016e4c144eec93a15229b88 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/return.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 0860e1238b7d5125d3247205585c174e61e3e827..67c21096cf4df88a15b75b0e7810c050f82b6700 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -149,6 +149,18 @@ import UIComponentPopupBoxToastStyleInterface001 from './UIComponentPopupBoxToastStyleInterfaceTest/UIComponentPopupBoxToastStyleInterface001.test'; import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIComponentNavigationNavigationInterface + from '../test/UIComponentNavigationNavigationInterfaceTest/UIComponentNavigationNavigationInterface.test'; +import UIComponentNavNavigation from '../test/UIComponentNavNavigationTest/UIComponentNavNavigation.test'; +import UIComponentNavNavigationRtl from '../test/UIComponentNavNavigationRtlTest/UIComponentNavNavigationRtl.test'; +import UIComponentNavNavigationContentExpansion + from '../test/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.test'; +import UIComponentNavNavigationNewInstance + from '../test/UIComponentNavNavigationNewInstanceTest/UIComponentNavNavigationNewInstance.test'; +import UIComponentNavNavigationCustomZing + from '../test/UIComponentNavNavigationCustomZingTest/UIComponentNavNavigationCustomZing.test'; +import UIComponentNavNavigationAction + from '../test/UIComponentNavNavigationActionTest/UIComponentNavNavigationAction.test'; export default function testsuite() { ComponentTextRicheditorFontfeatures(); @@ -239,6 +251,13 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + UIComponentNavigationNavigationInterface(); + UIComponentNavNavigation(); + UIComponentNavNavigationRtl(); + UIComponentNavNavigationContentExpansion(); + UIComponentNavNavigationNewInstance(); + UIComponentNavNavigationCustomZing(); + UIComponentNavNavigationAction(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets index 12e9b46a299fc7bf8c4a3c3f58caf88fc3e9c9d5..6712404811ddcc7ff68408e619a4e7c208692489 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -1,27 +1,42 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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, + * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import Settings from '../model/Settings' -import windowSnap from '../model/snapShot' -import Logger from '../model/Logger' -import Utils from '../model/Utils' -import { Component, Driver, ON } from '@ohos.UiTest' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest'; export default function UIComponentNavModifier() { describe('UIComponentNavModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 @@ -480,5 +495,492 @@ export default function UIComponentNavModifier() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 finish.`); done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0010 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0010 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0020 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0020 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0030 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0030 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn2')); + await btn.click(); + await Utils.sleep(2000); + let list: Component = await driver.findComponent(ON.type('List')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 5); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0040 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0040 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn3')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0050 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0050 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0060 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0060 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0080 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0080 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn3')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0100 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0100 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0110 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0110 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn4')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0140 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0140 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0010_btn5')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0160 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0150 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('modifier0150_btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0170 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0170 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0180 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0180 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0180 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0190 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0190 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('modifier0150_btn3')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0190 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0200 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0200 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('modifier0150_btn7')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0200 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0210 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0210 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.id('modifier0150_btn4')); + await btn4.click(); + await Utils.sleep(1000); + let btn7: Component = await driver.findComponent(ON.id('modifier0150_btn7')); + await btn7.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0210 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0220 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0220 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0220'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0220 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0240 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0240 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0240 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0250 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0250 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('modifier0150_btn5')); + await btn5.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0250 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0260 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0260 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('modifier0150_btn6')); + await btn5.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0260 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0270 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0270 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0150'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn5: Component = await driver.findComponent(ON.id('modifier0150_btn8')); + await btn5.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('modifier0150_btn2')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0270 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0280 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0280 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0280'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0280_btn1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0280 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0290 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0290 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0290 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0280'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0280_btn2')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0290 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0300 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0300 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0300 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0300'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let next: Component = await driver.findComponent(ON.type("Button")); + let point = await next.getBoundsCenter(); + for (let index = 0; index < 3; index++) { + await driver.mouseClick({ + x: point.x, y: point.y + }, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(2000); + } + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0300 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0310 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0310 start.`); + Settings.createWindow('testability/pages/UIComponentNavModifier/UIComponentNavModifier0280'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('modifier0280_btn3')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0310 end.`); + done(); + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationActionTest/UIComponentNavNavigationAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationActionTest/UIComponentNavNavigationAction.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..666133ac586430bf0f8de986ae58315447231994 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationActionTest/UIComponentNavNavigationAction.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigationAction() { + + describe('UIComponentNavNavigationAction', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0010 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0010 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationAction/UIComponentNavNavigationAction0010'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('navAction0010_btn')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_ACTION_0010 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..972ad719a25f86755f3a8f399cdbd7a734625c17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.test.ets @@ -0,0 +1,1590 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigationContentExpansion() { + + describe('UIComponentNavNavigationContentExpansion', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0010 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0010 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn8: Component = await driver.findComponent(ON.id('navExp_btn8')); + await navExp_btn8.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn16: Component = await driver.findComponent(ON.id('navExp_btn16')); + await navExp_btn16.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0010 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0020 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0020 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn8: Component = await driver.findComponent(ON.id('navExp_btn8')); + await navExp_btn8.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn17: Component = await driver.findComponent(ON.id('navExp_btn17')); + await navExp_btn17.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0020 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0030 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0030 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn8: Component = await driver.findComponent(ON.id('navExp_btn8')); + await navExp_btn8.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0030 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0040 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0040 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn8: Component = await driver.findComponent(ON.id('navExp_btn8')); + await navExp_btn8.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn19: Component = await driver.findComponent(ON.id('navExp_btn19')); + await navExp_btn19.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0050 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0050 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn8: Component = await driver.findComponent(ON.id('navExp_btn8')); + await navExp_btn8.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn20: Component = await driver.findComponent(ON.id('navExp_btn20')); + await navExp_btn20.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0060 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0060 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn16: Component = await driver.findComponent(ON.id('navExp_btn16')); + await navExp_btn16.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0070 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0070 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn17: Component = await driver.findComponent(ON.id('navExp_btn17')); + await navExp_btn17.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0080 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0080 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0090 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0090 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn19: Component = await driver.findComponent(ON.id('navExp_btn19')); + await navExp_btn19.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0100 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0100 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn20: Component = await driver.findComponent(ON.id('navExp_btn20')); + await navExp_btn20.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0110 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0110 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn2: Component = await driver.findComponent(ON.id('navExp_btn2')); + await navExp_btn2.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn16: Component = await driver.findComponent(ON.id('navExp_btn16')); + await navExp_btn16.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0120 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0120 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn2: Component = await driver.findComponent(ON.id('navExp_btn2')); + await navExp_btn2.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn17: Component = await driver.findComponent(ON.id('navExp_btn17')); + await navExp_btn17.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0120 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0130 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0130 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn2: Component = await driver.findComponent(ON.id('navExp_btn2')); + await navExp_btn2.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0130 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0140 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0140 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn2: Component = await driver.findComponent(ON.id('navExp_btn2')); + await navExp_btn2.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn19: Component = await driver.findComponent(ON.id('navExp_btn19')); + await navExp_btn19.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0150 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0150 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 2); + await Utils.sleep(1000); + let navExp_btn2: Component = await driver.findComponent(ON.id('navExp_btn2')); + await navExp_btn2.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn20: Component = await driver.findComponent(ON.id('navExp_btn20')); + await navExp_btn20.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0160 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0160 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn1: Component = await driver.findComponent(ON.id('navExp_btn1')); + await navExp_btn1.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x - 100, y: point.y + }, true, 4); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0170 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0170 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn1: Component = await driver.findComponent(ON.id('navExp_btn1')); + await navExp_btn1.click(); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let page1_btn5: Component = await driver.findComponent(ON.id('page1_btn5')); + await page1_btn5.click(); + await Utils.sleep(1000); + let page1_btn8: Component = await driver.findComponent(ON.id('page1_btn8')); + await page1_btn8.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0180 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0180 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn1: Component = await driver.findComponent(ON.id('navExp_btn1')); + await navExp_btn1.click(); + await Utils.sleep(1000); + let page1_btn1: Component = await driver.findComponent(ON.id('page1_btn1')); + await page1_btn1.click(); + await Utils.sleep(1000); + let page1_btn5: Component = await driver.findComponent(ON.id('page1_btn5')); + await page1_btn5.click(); + await Utils.sleep(1000); + let page1_btn8: Component = await driver.findComponent(ON.id('page1_btn8')); + await page1_btn8.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x - 100, y: point.y + }, true, 3); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0180 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0190 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0190 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 5); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn16: Component = await driver.findComponent(ON.id('navExp_btn16')); + await navExp_btn16.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + let navExp_btn22: Component = await driver.findComponent(ON.id('navExp_btn22')); + await navExp_btn22.click(); + await Utils.sleep(1000); + let navExp_btn24: Component = await driver.findComponent(ON.id('navExp_btn24')); + await navExp_btn24.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0190 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 9); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + let navExp_btn30: Component = await driver.findComponent(ON.id('navExp_btn30')); + await navExp_btn30.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 9); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + let navExp_btn30: Component = await driver.findComponent(ON.id('navExp_btn30')); + await navExp_btn30.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 9); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_3 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_3 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_3 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 9); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + let navExp_btn30: Component = await driver.findComponent(ON.id('navExp_btn30')); + await navExp_btn30.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 9); + await Utils.sleep(1000); + let navExp_btn3: Component = await driver.findComponent(ON.id('navExp_btn3')); + await navExp_btn3.click(); + await Utils.sleep(1000); + let navExp_btn4: Component = await driver.findComponent(ON.id('navExp_btn4')); + await navExp_btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0200_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn1: Component = await driver.findComponent(ON.id('navExp_btn1')); + await navExp_btn1.click(); + await Utils.sleep(1000); + let page1_btn1: Component = await driver.findComponent(ON.id('page1_btn1')); + await page1_btn1.click(); + await Utils.sleep(1000); + let page1_btn13: Component = await driver.findComponent(ON.id('page1_btn13')); + await page1_btn13.click(); + await Utils.sleep(1000); + let page1_btn5: Component = await driver.findComponent(ON.id('page1_btn5')); + await page1_btn5.click(); + await Utils.sleep(1000); + let page1_btn8: Component = await driver.findComponent(ON.id('page1_btn8')); + await page1_btn8.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navExp_btn9: Component = await driver.findComponent(ON.id('navExp_btn9')); + await navExp_btn9.click(); + await Utils.sleep(1000); + let navExp_btn1: Component = await driver.findComponent(ON.id('navExp_btn1')); + await navExp_btn1.click(); + await Utils.sleep(1000); + let page1_btn1: Component = await driver.findComponent(ON.id('page1_btn1')); + await page1_btn1.click(); + await Utils.sleep(1000); + let page1_btn13: Component = await driver.findComponent(ON.id('page1_btn13')); + await page1_btn13.click(); + await Utils.sleep(1000); + let page1_btn5: Component = await driver.findComponent(ON.id('page1_btn5')); + await page1_btn5.click(); + await Utils.sleep(1000); + let page1_btn8: Component = await driver.findComponent(ON.id('page1_btn8')); + await page1_btn8.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll({ + x: point.x - 100, y: point.y + }, true, 9); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0210_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0220 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0220 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 9); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + let navExp_btn31: Component = await driver.findComponent(ON.id('navExp_btn31')); + await navExp_btn31.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0220 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 6); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, true, 3); + await Utils.sleep(1000); + let navExp_btn32: Component = await driver.findComponent(ON.id('navExp_btn32')); + await navExp_btn32.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0230_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0240 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0240 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn2')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(1000); + let navExp_btn10: Component = await driver.findComponent(ON.id('navExp_btn10')); + await navExp_btn10.click(); + await Utils.sleep(1000); + let navExp_btn14: Component = await driver.findComponent(ON.id('navExp_btn14')); + await navExp_btn14.click(); + await Utils.sleep(1000); + let navExp_btn18: Component = await driver.findComponent(ON.id('navExp_btn18')); + await navExp_btn18.click(); + await Utils.sleep(1000); + let navExp_btn21: Component = await driver.findComponent(ON.id('navExp_btn21')); + await navExp_btn21.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, true, 3); + await Utils.sleep(1000); + let navExp_btn33: Component = await driver.findComponent(ON.id('navExp_btn33')); + await navExp_btn33.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0240 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0250 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0250 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn2: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn2.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn1: Component = await driver.findComponent(ON.id('page3_btn1')); + await page3_btn1.click(); + await Utils.sleep(1000); + let page3_btn2: Component = await driver.findComponent(ON.id('page3_btn2')); + await page3_btn2.click(); + await Utils.sleep(1000); + let page3_btn3: Component = await driver.findComponent(ON.id('page3_btn3')); + await page3_btn3.click(); + await Utils.sleep(1000); + let page3_btn4: Component = await driver.findComponent(ON.id('page3_btn4')); + await page3_btn4.click(); + // await Utils.sleep(1000); + // let page3_btn5: Component = await driver.findComponent(ON.id('page3_btn5')); + // await page3_btn5.click(); + // await Utils.sleep(1000); + // let page3_btn6: Component = await driver.findComponent(ON.id('page3_btn6')); + // await page3_btn6.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0250 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0260 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0260 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn4')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let page3_btn16: Component = await driver.findComponent(ON.id('page3_btn16')); + await page3_btn16.click(); + await Utils.sleep(1000); + let page3_btn17: Component = await driver.findComponent(ON.id('page3_btn17')); + await page3_btn17.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0260 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0270 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0270 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn16: Component = await driver.findComponent(ON.id('page3_btn16')); + await page3_btn16.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let page3_btn17: Component = await driver.findComponent(ON.id('page3_btn17')); + await page3_btn17.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0270 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0280 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0280 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn17: Component = await driver.findComponent(ON.id('page3_btn17')); + await page3_btn17.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let page3_btn16: Component = await driver.findComponent(ON.id('page3_btn16')); + await page3_btn16.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0280 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0290 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0290 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0290 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let page3_btn1: Component = await driver.findComponent(ON.id('page3_btn1')); + await page3_btn1.click(); + await Utils.sleep(1000); + let page3_btn2: Component = await driver.findComponent(ON.id('page3_btn2')); + await page3_btn2.click(); + await Utils.sleep(1000); + let page3_btn3: Component = await driver.findComponent(ON.id('page3_btn3')); + await page3_btn3.click(); + await Utils.sleep(1000); + let page3_btn4: Component = await driver.findComponent(ON.id('page3_btn4')); + await page3_btn4.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 5); + await Utils.sleep(1000); + let page3_btn24: Component = await driver.findComponent(ON.id('page3_btn24')); + await page3_btn24.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0290 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(1000); + let page3_btn26: Component = await driver.findComponent(ON.id('page3_btn26')); + await page3_btn26.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 10); + await Utils.sleep(1000); + let page3_btn25: Component = await driver.findComponent(ON.id('page3_btn25')); + await page3_btn25.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0300_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 12); + await Utils.sleep(1000); + let page3_btn27: Component = await driver.findComponent(ON.id('page3_btn27')); + await page3_btn27.click(); + await Utils.sleep(1000); + let page3_btn28: Component = await driver.findComponent(ON.id('page3_btn28')); + await page3_btn28.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 12); + await Utils.sleep(1000); + let page3_btn29: Component = await driver.findComponent(ON.id('page3_btn29')); + await page3_btn29.click(); + await Utils.sleep(1000); + let page3_btn30: Component = await driver.findComponent(ON.id('page3_btn30')); + await page3_btn30.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0310_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 5); + await Utils.sleep(1000); + let page3_btn19: Component = await driver.findComponent(ON.id('page3_btn19')); + await page3_btn19.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let expMain_btn3: Component = await driver.findComponent(ON.id('expMain_btn3')); + await expMain_btn3.click(); + await Utils.sleep(1000); + let page3_btn18: Component = await driver.findComponent(ON.id('page3_btn18')); + await page3_btn18.click(); + await Utils.sleep(1000); + let page3_btn15: Component = await driver.findComponent(ON.id('page3_btn15')); + await page3_btn15.click(); + await Utils.sleep(1000); + let page3_btn7: Component = await driver.findComponent(ON.id('page3_btn7')); + await page3_btn7.click(); + await Utils.sleep(1000); + let page3_btn11: Component = await driver.findComponent(ON.id('page3_btn11')); + await page3_btn11.click(); + await Utils.sleep(1000); + let navigation: Component = await driver.findComponent(ON.type('Navigation')); + let point = await navigation.getBoundsCenter(); + await driver.mouseScroll(point, true, 5); + await Utils.sleep(1000); + let page3_btn21: Component = await driver.findComponent(ON.id('page3_btn21')); + await page3_btn21.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CONTENTEXPANSION_0320_2 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationCustomZingTest/UIComponentNavNavigationCustomZing.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationCustomZingTest/UIComponentNavNavigationCustomZing.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..d6b00cd491063f4e693976dff893c6c49523ba5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationCustomZingTest/UIComponentNavNavigationCustomZing.test.ets @@ -0,0 +1,296 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigationCustomZing() { + + describe('UIComponentNavNavigationCustomZing', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathByName pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('replacePath pageTwo')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('replacePathByName pageTwo')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0030_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathByName pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn2.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point,true,3); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('moveIndexToTop 0')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPathByName pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point,true,3); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('moveToTop pageOne')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0040_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPathByName pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('removeByName pageOne')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushPath pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('pushPathByName pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('removeByIndexes [0]')); + await btn3.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point,true,3); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0050_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0100 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0100 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point,true,3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushAndPopIndex')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0110 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0110 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point,true,3); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('pushAndReplace')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('getAllPathName')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('父Navigation push pageOne')); + await btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_1 end.`); + done(); + })/* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('父Navigation push pageOne')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('子Navigation getParent且清除父Navigation的路由栈')); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_CUSTOMIZING_0160_2 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationNewInstanceTest/UIComponentNavNavigationNewInstance.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationNewInstanceTest/UIComponentNavNavigationNewInstance.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..34f99750ccaf971a36580c312615e28c43172f1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationNewInstanceTest/UIComponentNavNavigationNewInstance.test.ets @@ -0,0 +1,262 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigationNewInstance() { + + describe('UIComponentNavNavigationNewInstance', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0040 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop*2,push pageTwo*2')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0050 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0050 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop + push 新实例 (无动画)')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0060 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0060 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('pop + push 新实例 two x2')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0060 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0070 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn4: Component = await driver.findComponent(ON.text('push 新实例 pageTwo*5')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0080 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('push 新实例 Two*2 + pop*2')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0100 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + let btn4: Component = await driver.findComponent(ON.text('pop*2,push pageTwo')); + await btn4.click(); + await Utils.sleep(1000); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0110 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0110 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + for (let index = 0; index < 3; index++) { + let btn4: Component = await driver.findComponent(ON.text('pop + push 新实例 (无动画)')); + await btn4.click(); + await Utils.sleep(1000); + } + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0110 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0130 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0130 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationNewInstance/PageMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.text('push pageTwo')); + await btn3.click(); + await Utils.sleep(1000); + let btn4: Component = await driver.findComponent(ON.text('push*100,popToName,push*10')); + await btn4.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_NEWINSTANCE_0130 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationRtlTest/UIComponentNavNavigationRtl.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationRtlTest/UIComponentNavNavigationRtl.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..0a82be8964ee3412d29e4e3f00bfdea28ba25dff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationRtlTest/UIComponentNavNavigationRtl.test.ets @@ -0,0 +1,539 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigationRtl() { + + describe('UIComponentNavNavigationRtl', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + let navRtl0010_btn2: Component = await driver.findComponent(ON.id('navRtl0010_btn2')); + await navRtl0010_btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.changeOrientation(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0010_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + let navRtl0010_btn2: Component = await driver.findComponent(ON.id('navRtl0010_btn2')); + await navRtl0010_btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0030_2 end.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + await Utils.homeAndBack(driver); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0060_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(2000); + let navRtl0010_btn2: Component = await driver.findComponent(ON.id('navRtl0010_btn2')); + await navRtl0010_btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0100_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(1000); + // let navRtl0010_btn3: Component = await driver.findComponent(ON.id('navRtl0010_btn3')); + // await navRtl0010_btn3.click(); + await Settings.changeOrientation(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + // await navRtl0010_btn3.click();//横竖屏切回 + await Settings.changeOrientation(); + await Utils.sleep(1000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_3 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_3 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_3 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(1000); + let navRtl0010_btn3: Component = await driver.findComponent(ON.id('navRtl0010_btn3')); + await navRtl0010_btn3.click(); + await Utils.sleep(1000); + await navRtl0010_btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_4 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_4 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_4', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_4 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(1000); + let navRtl0010_btn3: Component = await driver.findComponent(ON.id('navRtl0010_btn3')); + await navRtl0010_btn3.click(); + await Utils.sleep(1000); + await navRtl0010_btn3.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0120_4 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn2: Component = await driver.findComponent(ON.id('rtlMain_btn2')); + await rtlMain_btn2.click(); + await Utils.sleep(1000); + let navRtl0020_btn1: Component = await driver.findComponent(ON.id('navRtl0020_btn1')); + await navRtl0020_btn1.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn2: Component = await driver.findComponent(ON.id('rtlMain_btn2')); + await rtlMain_btn2.click(); + await Utils.sleep(1000); + let navRtl0020_btn2: Component = await driver.findComponent(ON.id('navRtl0020_btn2')); + await navRtl0020_btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0130_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + await Settings.switchCusLocales('ug-CN'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn7: Component = await driver.findComponent(ON.id('navRtl0010_btn7')); + await navRtl0010_btn7.click(); + await Utils.sleep(1000); + await Settings.switchCusLocales('zh-Hans-CN'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0140_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn3: Component = await driver.findComponent(ON.id('navRtl0010_btn3')); + await navRtl0010_btn3.click(); + await Utils.sleep(1000); + let navRtl0010_btn4: Component = await driver.findComponent(ON.id('navRtl0010_btn4')); + await navRtl0010_btn4.click(); + await Utils.sleep(1000); + let navRtl0010_btn6: Component = await driver.findComponent(ON.id('navRtl0010_btn6')); + await navRtl0010_btn6.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await navRtl0010_btn3.click(); //横竖屏切回 + await Utils.sleep(1000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let rtlMain_btn1: Component = await driver.findComponent(ON.id('rtlMain_btn1')); + await rtlMain_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn1: Component = await driver.findComponent(ON.id('navRtl0010_btn1')); + await navRtl0010_btn1.click(); + await Utils.sleep(1000); + let navRtl0010_btn3: Component = await driver.findComponent(ON.id('navRtl0010_btn3')); + await navRtl0010_btn3.click(); + await Utils.sleep(1000); + let navRtl0010_btn5: Component = await driver.findComponent(ON.id('navRtl0010_btn5')); + await navRtl0010_btn5.click(); + await Utils.sleep(1000); + let navRtl0010_btn6: Component = await driver.findComponent(ON.id('navRtl0010_btn6')); + await navRtl0010_btn6.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await navRtl0010_btn3.click(); //横竖屏切回 + await Utils.sleep(1000); + await Settings.switchCusLocales('zh-Hans-CN'); //语言切回 + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_RTL_0150_2 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationTest/UIComponentNavNavigation.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationTest/UIComponentNavNavigation.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..78abefb86630941f738370ec9fe2afc48fedeb32 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavNavigationTest/UIComponentNavNavigation.test.ets @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavNavigation() { + + describe('UIComponentNavNavigation', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_1 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_1 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_1 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point, true, 6); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_1 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_2 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_2 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_2 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('nav0490_btn1')); + await btn.click(); + await Utils.sleep(2000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point, true, 3); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 6); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_2 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_3 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_3 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_3 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('nav0490_btn1')); + await btn.click(); + await Utils.sleep(2000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point, true, 8); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('nav0490_btn2')); + await btn2.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 8); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0490_3 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0510 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0510 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0510 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0510'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point, true, 8); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('nav0510_btn1')); + await btn.click(); + await Utils.sleep(2000); + let btn2: Component = await driver.findComponent(ON.id('nav0510_btn2')); + await btn2.click(); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 8); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0510 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0520 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0520 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0520 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0520'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('nav0520_btn1')); + await btn1.click(); + await Utils.sleep(1000); + let btn2: Component = await driver.findComponent(ON.id('nav0520_btn3')); + await btn2.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('nav0520_btn4')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0520 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0530 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0530 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0530 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let nv0550_nr: Component = await driver.findComponent(ON.id('nv0550_nr2')); + await nv0550_nr.click(); + await Utils.sleep(1000); + let btn3: Component = await driver.findComponent(ON.id('nav0550_btn3')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0530 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0550 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0550 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0550 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let nv0550_nr: Component = await driver.findComponent(ON.id('nv0550_nr')); + await nv0550_nr.click(); + await Utils.sleep(1000); + let btn1: Component = await driver.findComponent(ON.id('nav0550_btn1')); + let btn2: Component = await driver.findComponent(ON.id('nav0550_btn2')); + await btn1.click(); + await Utils.sleep(1000); + await btn2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0550 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0560 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0560 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0560 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0560'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('nav0560_btn2')); + await btn.click(); + await Utils.sleep(1000); + let scroll: Component = await driver.findComponent(ON.type('Scroll')); + let point = await scroll.getBoundsCenter(); + await driver.mouseScroll(point, true, 3); + await Utils.sleep(2000); + // let btn2: Component = await driver.findComponent(ON.id('nav0560_btn2')); + let titleBar: Component = await driver.findComponent(ON.type('TitleBar')) + let point2 = await titleBar.getBounds(); + let center = (point2.left + point2.right) / 2; + await driver.mouseClick({ + x: center, + y: point2.top + 20 + }, MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0560 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0570 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0570 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0570 start.`); + Settings.createWindow('testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0570'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('nav0570_btn1')); + await btn.click(); + // await Utils.sleep(3000); + /*let divider: Component = await driver.findComponent(ON.type('Divider')); + let point = await divider.getBoundsCenter(); + await driver.mouseDrag(point, { + x: point.x - 100, y: point.y + }, 400);*/ + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_0570 end.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationNavigationInterfaceTest/UIComponentNavigationNavigationInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationNavigationInterfaceTest/UIComponentNavigationNavigationInterface.test.ets new file mode 100755 index 0000000000000000000000000000000000000000..26e1852d8f7d48c1d4cb7ce4d0120b531e2d76bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavigationNavigationInterfaceTest/UIComponentNavigationNavigationInterface.test.ets @@ -0,0 +1,654 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import Logger from '../model/Logger' +import Settings from '../model/Settings' +import { Driver, MouseButton, ON } from '@ohos.UiTest'; +import { Component } from '@ohos.UiTest'; +import Utils from '../model/Utils'; +import windowSnap from '../model/snapShot'; + +export default function UIComponentNavigationNavigationInterface() { + + describe('UIComponentNavigationNavigationInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0040 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0040 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0040'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0040 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0050 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0050 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0050'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0050 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0070 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0070 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0070'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0070 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0080 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0080 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0080'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0080 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0090'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let TitleBar: Component = await driver.findComponent(ON.type('TitleBar')); + await Utils.sleep(1000); + let point = await TitleBar.getBounds(); + let height = point.bottom - point.top; + await Utils.sleep(100); + let h2 = px2vp(height); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090 height=${height},h2=${h2}`); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0090 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0100'); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let TitleBar: Component = await driver.findComponent(ON.type('TitleBar')); + await Utils.sleep(1000); + let point = await TitleBar.getBounds(); + let height = point.bottom - point.top; + await Utils.sleep(100); + let h2 = px2vp(height); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100 height=${height},h2=${h2}`); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0100 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0140 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0140 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0140'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0140 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0150 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0150 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0150'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0150 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0160 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0160 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0160 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0170 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0170 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0170 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0200 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0200 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0200'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0200 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0210 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0210 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0210'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0210 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0220 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0220 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0220 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0230 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0230 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0230'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0230 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0240 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0240 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0240'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0240 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0290'); + await Utils.sleep(2000); + await windowSnap.snapShot('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290_1'); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('interface0290_btn')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0290 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0310 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0310 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0310'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0310 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0330 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0330 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0330'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0330 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0340 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0340 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0340'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0340 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0360 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0360 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0360'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0360 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0370 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0370 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0370'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0370 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0380 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0380 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0380 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0420 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0420 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0420 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0420'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list: Component = await driver.findComponent(ON.type('List')); + await Utils.sleep(1000); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 4); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0420 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0430 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0430 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0430 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0430'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list: Component = await driver.findComponent(ON.type('List')); + await Utils.sleep(1000); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 4); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0430 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0440 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0440 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0440 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0490 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0490 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0490 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0490'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0490 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0510 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0510 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0510'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0510 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0570 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0570 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0570 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('interface0570_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0570 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0580 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0580 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0580 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('interface0570_btn2')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0580 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0590 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0590 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0590 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('interface0570_btn3')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0590 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0600 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0600 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0600 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.text('collect')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + // let list: Component = await driver.findComponent(ON.type('List')); + // let point = await list.getBoundsCenter(); + // await driver.mouseScroll(point, true, 6); + // await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0600 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0610 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0610 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0610 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('interface0610_btn1')); + await Utils.sleep(1000); + await btn.click(); + await Utils.sleep(2000); + let list: Component = await driver.findComponent(ON.type('List')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 6); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0610 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0620 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0620 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0620 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let nr1: Component = await driver.findComponent(ON.id('interface0650_nr1')); + await Utils.sleep(1000); + await nr1.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + let nr2: Component = await driver.findComponent(ON.id('interface0650_nr2')); + await Utils.sleep(1000); + await nr2.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0620 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0650 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0650 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0650 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let nr1: Component = await driver.findComponent(ON.id('interface0650_nr1')); + await Utils.sleep(1000); + await nr1.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + let nr2: Component = await driver.findComponent(ON.id('interface0650_nr2')); + await Utils.sleep(1000); + await nr2.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0650 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0660 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0660 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0660 start.`); + Settings.createWindow('testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let nr1: Component = await driver.findComponent(ON.id('interface0650_nr1')); + await Utils.sleep(1000); + await nr1.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(1000); + let nr2: Component = await driver.findComponent(ON.id('interface0650_nr2')); + await Utils.sleep(1000); + await nr2.click(); + await Utils.sleep(1000); + await driver.triggerKey(2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_NAVIGATION_INTERFACE_0660 end.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index daf797ea095d73d75a47ee5fe88209d0fec33dae..bfbb1088691ff184511a56666b230a5ac17cd37e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -19,7 +19,7 @@ import windowSnap from '../model/snapShot'; import Logger from '../model/Logger'; import Utils from '../model/Utils'; import uiAppearance from '@ohos.uiAppearance'; -import { Driver ,ON } from '@ohos.UiTest' +import { Driver , MouseButton ,ON,Component } from '@ohos.UiTest'; /* * UIComponentUISupportColor @@ -40,6 +40,20 @@ import { Driver ,ON } from '@ohos.UiTest' export default function UIComponentUISupportColor() { describe('UIComponentUISupportColor', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) /* @@ -390,5 +404,137 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0710 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0710 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0710 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('supportColor0720_btn1')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0710 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0720 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0720 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0720 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('supportColor0720_btn2')); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0720 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0730 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0730 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0730 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('supportColor0720_btn2')); + await btn.click(); + await Utils.sleep(2000); + await btn.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0730 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0740 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0740 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0740 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720'); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let btn: Component = await driver.findComponent(ON.id('supportColor0720_btn2')); + await btn.click(); + await Utils.sleep(2000); + let btn3: Component = await driver.findComponent(ON.id('supportColor0720_btn3')); + await btn3.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0740 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0750 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0750 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0750 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0750 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0760 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0760 + * @tc.desc Navigation:symbol --??? + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0760 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0730'); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0760 end.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0770 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0770 + * @tc.desc Navigation:symbol + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0770 start.`); + Settings.createWindow('testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0740'); + await Utils.sleep(2000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }); + await Utils.sleep(1000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, () => { + }); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + await uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORTCOLOR_0770 end.`); + done(); + }) }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets index c74ae272407cbf707ddcfaaacf42c1e132d5452d..426851f5572844ab7257a601a6e30043eb0d3400 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Settings.ets @@ -21,8 +21,10 @@ import { BusinessError } from '@ohos.base' import Window from '@ohos.window' import common from '@ohos.app.ability.common'; import { i18n } from '@kit.LocalizationKit'; -import { router } from '@kit.ArkUI'; +import { router, uiAppearance } from '@kit.ArkUI'; import { systemDateTime } from '@kit.BasicServicesKit'; +import { ConfigurationConstant } from '@kit.AbilityKit'; +import Utils from './Utils'; const TAG: string = '[TEST]'; @@ -36,14 +38,14 @@ async function sleep(time: number): Promise { } class Settings { - isPhone: boolean = true; + isPhone: boolean = false; windowClass: window.Window | undefined = undefined windowCreateType: string = "changeWindow"; private static DEFAULT_WIDTH: number = 720; - private static DEFAULT_HEIGHT: number = 1280; + private static DEFAULT_HEIGHT: number = 1412; private static DEFAULT_DPI: number = 240; - private static DEFAULT_OFFSET_X: number = 0; - private static DEFAULT_OFFSET_Y: number = 60; + private static DEFAULT_OFFSET_X: number = 100; + private static DEFAULT_OFFSET_Y: number = 132; private portrait: boolean = true changeWindowPosition(windowClass: window.Window, X: number | undefined, Y: number | undefined) { @@ -145,6 +147,27 @@ class Settings { } } + async initEnv() { + let context = getContext() + let promise = await Window.getLastWindow(context); + let orientation = Window.Orientation.PORTRAIT; + try { + getContext().getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); + await promise.setPreferredOrientation(orientation); + Utils.sleep(1000); + uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, () => { + }); + Utils.sleep(1000); + i18n.System.setAppPreferredLanguage('zh-Hans-CN'); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch CusLocales,appPreferredLanguage2=${appPreferredLanguage2}`); + } + + /* * 窗口页面更新 * Setting.createWindow(pageURI: String, {X,Y,width,height,dpi}?:{X?:number,Y?:number,width?:number,height?:number,dpi?:number}):void diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets index 7f06aa4d872061e0682441fd8f47b33730bc78c1..5cab11d482a8d7318966168a30c45ca5cb5dd534 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/model/Utils.ets @@ -14,6 +14,9 @@ */ import {Driver , ON} from '@ohos.UiTest' +import { BusinessError, screenLock } from '@kit.BasicServicesKit'; +import Settings from './Settings'; +import { KeyCode } from '@kit.InputKit'; export default class Utils { @@ -39,7 +42,44 @@ export default class Utils { } + /** + * The app breathes and then lights up the screen + * + * @param driver + */ + static async lockAndUnlock(driver: Driver) { + await screenLock.lock((err: BusinessError, data: Boolean) => { + if (err) { + console.error(`Failed to lock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded in locking the screen. result: ${data}`); + }); + await Utils.sleep(2000); + await screenLock.unlock((err: BusinessError) => { + if (err) { + console.error(`Failed to unlock the screen, Code: ${err.code}, message: ${err.message}`); + return; + } + console.info(`Succeeded unlocking the screen.`); + }); + await driver.drag(100, 900, 100, 1, 1000); + } + /** + * The application switches to the desktop and back to the application + * + * @param driver + */ + static async homeAndBack(driver: Driver) { + let currentWindow = await Settings.windowClass; + if (currentWindow) { + await currentWindow.hide(); + await driver.triggerKey(KeyCode.KEYCODE_HOME); + await Utils.sleep(2000); + await currentWindow.showWindow(); + } + } } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets index 5b2992dcb24394039f4c71907479c34895c1a73a..05797d1fd6b4b23b42b121f95e03d5cdf710e2aa 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -59,13 +59,28 @@ export default class TestAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); GlobalThis.getInstance().setContext("context", this.context) - windowStage.loadContent('testability/pages/Index', (err) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; + // + let atManager = abilityAccessCtrl.createAtManager(); + let appFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; + let permissionFlags = 0; + bundleManager.getBundleInfoForSelf(appFlags, (err, data) => { + if (err) { + Logger.error(TAG, 'getAllApplicationInfo failed: %{public}s', err.message); + console.error("") } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); - }); + let tokenID = data.appInfo.accessTokenId; //系统应用可以通过bundleManager.getApplicationInfo获取,普通应用可以通过bundleManager.getBundleInfoForSelf获取 + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.READ_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.WRITE_MEDIA', permissionFlags, (err, data) => { + if (err) { + Logger.info(TAG, `grantUserGrantedPermission fail, err->${JSON.stringify(err)}`) + } + }) + }) + } onWindowStageDestroy() { diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0010.ets new file mode 100755 index 0000000000000000000000000000000000000000..59c3c7ad704d80c606c8572e943949e9444a4dea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0010.ets @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavModifier0010 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State _width: number | undefined = undefined + @State mode: NavigationMode = NavigationMode.Auto + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + @Builder + NavigationMenus() { + Row() { + Image('Add_active.png') + .width(24) + .height(24) + Image('collect_active.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more_active.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @State isCusToolbar: boolean = false; + + build() { + Column() { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + Button('超长文本').id('modifier0010_btn1').onClick(() => { + this.subMsg = + '这是一段超长文本显示在subtitle位置...这是一段超长文本显示在subtitle位置...这是一段超长文本显示在subtitle位置...' + + '这是一段超长文本显示在subtitle位置...这是一段超长文本显示在subtitle位置...'; + }) + Button('NavigationTitleMode.Free').id('modifier0010_btn2').onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }).margin({ top: 10 }) + Button('NavigationTitleMode.Mini').id('modifier0010_btn3').onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }).margin({ top: 10 }) + Button('hideToolBar').id('modifier0010_btn4').onClick(() => { + this.hideToolBar = true; + }).margin({ top: 10 }) + Button('navBarWidth300').id('modifier0010_btn5').onClick(() => { + this._width = 300; + this.mode = NavigationMode.Split; + }).margin({ top: 10 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarWidth(this._width) + .mode(this.mode) + .toolbarConfiguration(this.ToolBarItems()) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0150.ets new file mode 100755 index 0000000000000000000000000000000000000000..84e7041faca457b10e268e67afd2c131c91feae9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0150.ets @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavModifier0150 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State mode: NavigationMode = NavigationMode.Auto + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State navBarPosition: NavBarPosition = NavBarPosition.Start; + @State backButtonIcon: string | Resource = $r('sys.symbol.backward_fill') + @State minNavWidth: number | undefined = undefined + @State maxNavWidth: number | undefined = undefined + @State minContentWidth: number | undefined = undefined + @State _width: string | number = '100%' + @State toolItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(30) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + Button('NavBarPosition.End').id('modifier0150_btn1').onClick(() => { + this.navBarPosition = NavBarPosition.End; + }).margin({ top: 5 }) + Button('NavigationMode.Split').id('modifier0150_btn2').onClick(() => { + this.mode = NavigationMode.Split; + this._width = '95%' + }).margin({ top: 5 }) + Button('NavigationMode.Stack').id('modifier0150_btn3').onClick(() => { + this.mode = NavigationMode.Stack; + }).margin({ top: 5 }) + Button('backButtonIcon').id('modifier0150_btn4').onClick(() => { + this.backButtonIcon = 'ccreturn.png'; + }).margin({ top: 5 }) + Button('minNavWidth').id('modifier0150_btn5').onClick(() => { + this.minNavWidth = 350; + }).margin({ top: 5 }) + Button('maxNavWidth').id('modifier0150_btn6').onClick(() => { + this.maxNavWidth = 450; + this._width = 500; + }).margin({ top: 5 }) + Button('NavigationTitleMode.Mini').id('modifier0150_btn7').onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }).margin({ top: 5 }) + Button('minContentWidth').id('modifier0150_btn8').onClick(() => { + this.minContentWidth = 420; + }).margin({ top: 5 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .backButtonIcon(this.backButtonIcon) + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .toolbarConfiguration(this.ToolBarItems) + .navBarPosition(this.navBarPosition) + .mode(this.mode) + .hideNavBar(false) + .minContentWidth(this.minContentWidth) + .navBarWidthRange([this.minNavWidth, this.maxNavWidth]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0220.ets new file mode 100755 index 0000000000000000000000000000000000000000..08dff28732908b946ff76b36f077ab08398ede3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0220.ets @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { image } from '@kit.ImageKit' +import { effectKit } from '@kit.ArkGraphics2D'; +import { BusinessError } from '@kit.BasicServicesKit'; + +const color = new ArrayBuffer(96); +let opts : image.InitializationOptions = { + editable: true, + pixelFormat: 3, + size: { + height: 4, + width: 6 + } +} +@Entry +@Component +struct UIComponentNavModifier0220 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State mode: NavigationMode = NavigationMode.Auto + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State navBarPosition: NavBarPosition = NavBarPosition.Start; + @State backButtonIcon: string | PixelMap |undefined = undefined + @State minNavWidth: number | undefined = undefined + @State maxNavWidth: number | undefined = undefined + @State minContentWidth: number | undefined = undefined + @State _width: string | number = '100%' + + @State toolItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + async aboutToAppear() { + console.info('aboutToAppear initial imagePixelMap'); + image.createPixelMap(color, opts).then((pixelMap) => { + effectKit.createColorPicker(pixelMap).then(colorPicker => { + console.info("color picker=" + colorPicker); + this.backButtonIcon = pixelMap + }).catch( (reason : BusinessError) => { + console.error("error=" + reason.message); + }) + }) + } + /*private async getPixmapFromMedia() { + // let unit8Array = await getContext(this)?.resourceManager?.getMediaByNameSync('resources/base/media/cat.png'); + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ + bundleName: resource.bundleName, + moduleName: resource.moduleName, + id: resource.id + }) + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)) + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ + desiredPixelFormat: image.PixelMapFormat.RGBA_8888 + }) + await imageSource.release() + return createPixelMap + }*/ + + build() { + Column() { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(30) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .backButtonIcon(this.backButtonIcon) + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .toolbarConfiguration(this.ToolBarItems) + .navBarPosition(this.navBarPosition) + .mode(this.mode) + .hideNavBar(false) + .minContentWidth(this.minContentWidth) + .navBarWidthRange([this.minNavWidth, this.maxNavWidth]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0280.ets new file mode 100755 index 0000000000000000000000000000000000000000..20e1adbd062a0794504cf8c5cac128e030d30563 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0280.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Styles +function itemStyle() { + .width(336) + .height(621) + .margin({ top: 48, left: 12 }) + .borderRadius(24) + .backgroundColor('#FFFFFF') +} + +@Extend(Text) +function itemTextStyle() { + .fontColor('#182431') + .fontSize(36) + .fontWeight(500) + .opacity(0.4) + .margin({ top: 82, bottom: 40 }) +} + +@Entry +@Component +struct UIComponentNavModifier0280 { + @State currentIndex: number = 0 + @State firstState: ItemState = ItemState.Normal + @State secondState: ItemState = ItemState.Normal + @State thirdState: ItemState = ItemState.Normal + @State nextLabel: string | undefined = undefined; + + build() { + Stepper({ + index: this.currentIndex + }) { + // 第一个步骤页 + StepperItem() { + Column() { + Text('Page One') + .itemTextStyle() + Button('超长文本').id('modifier0280_btn1').onClick(() => { + this.nextLabel = + '这是一段超长文本显示在nextLabel位置...这是一段超长文本显示在nextLabel位置...这是一段超长文本显示在nextLabel位置...' + + '这是一段超长文本显示在nextLabel位置...这是一段超长文本显示在nextLabel位置...'; + }).margin(20) + Button('nextLabel test1').id('modifier0280_btn2').onClick(() => { + this.nextLabel = 'test1'; + }).margin(20) + Button('change status:' + this.firstState).id('modifier0280_btn3') + .backgroundColor('#007dFF') + .onClick(() => { + this.firstState = this.firstState === ItemState.Skip ? ItemState.Normal : ItemState.Skip + }).margin(20) + }.itemStyle() + } + .nextLabel(this.nextLabel) + .status(this.firstState) + + // 第二个步骤页 + StepperItem() { + Column() { + Text('Page Two') + .itemTextStyle() + Button('change status:' + this.secondState) + .backgroundColor('#007dFF') + .onClick(() => { + this.secondState = this.secondState === ItemState.Disabled ? ItemState.Normal : ItemState.Disabled + }) + }.itemStyle() + } + .nextLabel(this.nextLabel) + .prevLabel('Previous') + .status(this.secondState) + + // 第三个步骤页 + StepperItem() { + Column() { + Text('Page Three') + .itemTextStyle() + Button('change status:' + this.thirdState) + .backgroundColor('#007dFF') + .onClick(() => { + this.thirdState = this.thirdState === ItemState.Waiting ? ItemState.Normal : ItemState.Waiting + }) + }.itemStyle() + } + .status(this.thirdState) + + // 第四个步骤页 + StepperItem() { + Column() { + Text('Page Four') + .itemTextStyle() + }.itemStyle() + } + } + .backgroundColor('#F1F3F5') + .onFinish(() => { + // 此处可处理点击最后一页的Finish时的逻辑,例如路由跳转等 + console.info('onFinish') + }) + .onSkip(() => { + // 此处可处理点击跳过时的逻辑,例如动态修改Stepper的index值使其跳转到某一步骤页等 + console.info('onSkip') + }) + .onChange((prevIndex?: number, index?: number) => { + if (index) { + this.currentIndex = index + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0300.ets new file mode 100755 index 0000000000000000000000000000000000000000..d5e8d544a94a5f26657976d49674a17ef93f692a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0300.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Styles +function itemStyle1() { + .width(336) + .height(621) + .margin({ top: 48, left: 12 }) + .borderRadius(24) + .backgroundColor('#FFFFFF') +} + +@Extend(Text) +function itemTextStyle2() { + .fontColor('#182431') + .fontSize(36) + .fontWeight(500) + .opacity(0.4) + .margin({ top: 82, bottom: 40 }) +} + +@Entry +@Component +struct UIComponentNavModifier0300 { + @State currentIndex: number = 0 + @State firstState: ItemState = ItemState.Normal + @State secondState: ItemState = ItemState.Normal + @State thirdState: ItemState = ItemState.Normal + @State nextLabel: string | undefined = undefined; + + build() { + Stepper({ + index: this.currentIndex + }) { + // 第一个步骤页 + StepperItem() { + Column() { + Text('Page One') + .itemTextStyle2() + }.itemStyle1() + } + .nextLabel(this.nextLabel) + .status(this.firstState) + + // 第二个步骤页 + StepperItem() { + Column() { + Text('Page Two') + .itemTextStyle2() + Button('change status:' + this.secondState) + .backgroundColor('#007dFF') + .onClick(() => { + this.secondState = this.secondState === ItemState.Disabled ? ItemState.Normal : ItemState.Disabled + }) + }.itemStyle1() + } + .nextLabel(this.nextLabel) + .prevLabel('Previous') + .status(this.secondState) + + // 第三个步骤页 + StepperItem() { + Column() { + Text('Page Three') + .itemTextStyle2() + Button('change status:' + this.thirdState) + .backgroundColor('#007dFF') + .onClick(() => { + this.thirdState = this.thirdState === ItemState.Waiting ? ItemState.Normal : ItemState.Waiting + }) + }.itemStyle1() + } + .status(this.thirdState) + + // 第四个步骤页 + StepperItem() { + Column() { + Text('Page Four') + .itemTextStyle2() + }.itemStyle1() + } + } + .height('90%') + .backgroundColor('#F1F3F5') + .onFinish(() => { + // 此处可处理点击最后一页的Finish时的逻辑,例如路由跳转等 + console.info('onFinish') + }) + .onSkip(() => { + // 此处可处理点击跳过时的逻辑,例如动态修改Stepper的index值使其跳转到某一步骤页等 + console.info('onSkip') + }) + .onChange((prevIndex?: number, index?: number) => { + if (index) { + this.currentIndex = index + } + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490.ets new file mode 100755 index 0000000000000000000000000000000000000000..746ee5909bb464e82722bed8cab6794061415475 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0490 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State barStyle: BarStyle = BarStyle.STANDARD; + @State titleMode: NavigationTitleMode | undefined = undefined; + + build() { + Column() { + Navigation() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + Button('BarStyle.STACK').id('nav0490_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.barStyle = BarStyle.STACK; + }) + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + + Button('NavigationTitleMode.Free').id('nav0490_btn2') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + .title( + { + main: 'NavTitle', + sub: 'subtitle' + }, + { + backgroundBlurStyle: BlurStyle.COMPONENT_THICK, + barStyle: this.barStyle, + } + ) + .mode(NavigationMode.Stack) + .titleMode(this.titleMode) + .hideTitleBar(false) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0510.ets new file mode 100755 index 0000000000000000000000000000000000000000..321c37ecf1c13408744fb1620da9d4456ec90ee8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0510.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0510 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State barStyle: BarStyle = BarStyle.STANDARD; + @State titleMode: NavigationTitleMode | undefined = undefined; + + build() { + Column() { + Navigation() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + + Button('BarStyle.STACK').id('nav0510_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.barStyle = BarStyle.STACK; + }) + Button('NavigationTitleMode.Free').id('nav0510_btn2') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + .title( + { + main: 'NavTitle', + sub: 'subtitle' + }, + { + backgroundColor: Color.Yellow, + backgroundBlurStyle: BlurStyle.COMPONENT_THICK, + barStyle: this.barStyle, + } + ) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) + .mode(NavigationMode.Stack) + .titleMode(this.titleMode) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0520.ets new file mode 100755 index 0000000000000000000000000000000000000000..96150636ed6fe5a47c9d7ad64feab1c7992f3ee9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0520.ets @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0520 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State navBarPosition: NavBarPosition = NavBarPosition.Start; + @State titleMode: NavigationTitleMode | undefined = undefined; + @State mode:NavigationMode = NavigationMode.Stack + @State edge: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]; + + build() { + Column() { + Navigation() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + + Button('取消顶端安全区扩展').id('nav0520_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.edge = [SafeAreaEdge.BOTTOM]; + }) + Button('NavigationMode.Stack').id('nav0520_btn2') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.mode = NavigationMode.Stack; + }) + Button('NavigationMode.Split').id('nav0520_btn3') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.mode = NavigationMode.Split; + }) + Button('NavBarPosition.End').id('nav0520_btn4') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.navBarPosition = NavBarPosition.End; + }) + + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + .title( + { + main: 'NavTitle', + sub: 'subtitle' + }, + { + backgroundColor: Color.Yellow, + backgroundBlurStyle: BlurStyle.COMPONENT_THICK + } + ) + .expandSafeArea([SafeAreaType.SYSTEM],this.edge) + .mode(this.mode) + .titleMode(this.titleMode) + .navBarPosition(this.navBarPosition) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550.ets new file mode 100755 index 0000000000000000000000000000000000000000..ac23ec67a319b531f258db2d673a17d0405f3417 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0550 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State bgColor: Color = Color.Red; + @State barStyle: BarStyle = BarStyle.STANDARD; + @State mode: NavigationMode | undefined = undefined; + + build() { + Column() { + Navigation() { + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`color and blur`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(150) + .width('100%') + Button('switch color').id('nav0550_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.bgColor = Color.Transparent; + }) + Button('switch blur').id('nav0550_btn2') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.barStyle = BarStyle.STACK; + }) + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + }.title({ + main: 'test only blur', + sub: '' + }, + { + backgroundColor: this.bgColor, + barStyle: this.barStyle + }) + }.id('nv0550_nr') + .margin({ top: 10, bottom: 10 }) + + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`only blur`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(150) + .width('100%') + Button('switch blur').id('nav0550_btn3') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.barStyle = BarStyle.STACK; + }) + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + }.title({ + main: 'test only blur', + sub: '' + }, + { + backgroundColor: this.bgColor, + barStyle: this.barStyle + }) + }.id('nv0550_nr2') + .margin({ top: 10, bottom: 10 }) + } + .title( + { + main: 'Main Page', + sub: 'subtitle' + } + ) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0560.ets new file mode 100755 index 0000000000000000000000000000000000000000..2ecfda97eec10bc930e53b5d95006aec76d3b317 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0560.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0560 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State bgColor: Color = Color.White; + @State barStyle: BarStyle = BarStyle.STANDARD; + @State mode: NavigationMode | undefined = undefined; + + build() { + Column() { + Navigation() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(100) + .width('100%') + Button('NavigationMode.Split').id('nav0560_btn2') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.mode = NavigationMode.Split; + }) + Button('Color.Transparent').id('nav0560_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.bgColor = Color.Transparent; + }) + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + .title( + { + main: 'NavTitle', + sub: 'subtitle' + }, + { + backgroundColor: this.bgColor, + barStyle: BarStyle.STACK, + } + ).mode(this.mode) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0570.ets new file mode 100755 index 0000000000000000000000000000000000000000..91ca81e582577e027bf7767b08b832f6e2546775 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0570.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigation0570 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + private scrollerForScroll: Scroller = new Scroller(); + @State bgColor: Color = Color.White; + @State barStyle: BarStyle = BarStyle.STANDARD; + @State mode: NavigationMode | undefined = undefined; + + build() { + Column() { + Navigation() { + Column() { + Scroll(this.scrollerForScroll) { + Column() { + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(150) + .width('100%') + Button('NavigationMode.Stack').id('nav0570_btn1') + .height('50vp') + .margin({ top: 12 }) + .onClick(() => { + this.mode = NavigationMode.Stack; + }) + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Orange) + .margin({ top: 12 }) + } + }, (item: string) => item) + } + } + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } + .title( + { + main: 'NavTitle中文', + sub: 'subtitle' + }, + { + backgroundColor: this.bgColor, + barStyle: BarStyle.STACK, + } + ) + .mode(this.mode) + .navBarWidthRange([50, 200]) + .minContentWidth(200) + .navBarWidth(100) + .borderWidth(1) + }.width(300).height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationAction/UIComponentNavNavigationAction0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationAction/UIComponentNavNavigationAction0010.ets new file mode 100755 index 0000000000000000000000000000000000000000..002848bcf319d14e62e978f113b61387903c8531 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationAction/UIComponentNavNavigationAction0010.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavNavigationAction0010 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State _width: number | string| undefined = '100%' + @State mode: NavigationMode = NavigationMode.Auto + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + @Builder + NavigationMenus() { + Row() { + Image('Add_active.png') + .width(24) + .height(24) + Image('collect_active.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more_active.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @State isCusToolbar: boolean = false; + + build() { + Column() { + Navigation() { + Column({ space: 8 }) { + Text('block').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + Slider({ style: SliderStyle.OutSet, value: 40 }) + .blockSize({ width: 40, height: 40 }) + .blockBorderColor(Color.Red) + .blockBorderWidth(5) + Divider() + Text('step').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + Slider({ style: SliderStyle.InSet, value: 40, step: 10 }) + .showSteps(true) + .stepSize(8) + .stepColor(Color.Yellow) + Divider() + Text('track').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + Slider({ style: SliderStyle.InSet, value: 40 }) + .trackBorderRadius(2) + Divider() + Text('selected').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + Slider({ style: SliderStyle.InSet, value: 40 }) + .selectedBorderRadius(2) + } + Button('change width').id('navAction0010_btn').onClick(() => { + this._width = (this._width == 300) ? '100%' : 300; + }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus(this.NavigationMenus) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .mode(this.mode) + .toolbarConfiguration(this.ToolBarItems()) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('100%').backgroundColor('#F1F3F5') + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageFour.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageFour.ets new file mode 100755 index 0000000000000000000000000000000000000000..2b63ee326f404c3a778b8967634edf953bace658 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageFour.ets @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +class MyNavigationModifier implements AttributeModifier { + private _titleMode: NavigationTitleMode = NavigationTitleMode.Mini; + + public set titleMode(value: NavigationTitleMode) { + this._titleMode = value; + } + + private _mode: NavigationMode = NavigationMode.Auto; + + public set mode(value: NavigationMode) { + this._mode = value; + } + + private _hideTitleBar: boolean = false; + + public set hideTitleBar(value: boolean) { + this._hideTitleBar = value; + } + + private _hideToolBar: boolean = false; + + public set hideToolBar(value: boolean) { + this._hideToolBar = value; + } + + private _edge: Array = []; + + public set edge(value: Array) { + this._edge = value; + } + + private _type: Array = []; + + public set type(value: Array) { + this._type = value; + } + + private _type2: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD]; + + public set type2(value: Array) { + this._type2 = value; + } + + private _edge2: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]; + + public set edge2(value: Array) { + this._edge2 = value; + } + + private _marginValue: number = 0; + + public set marginValue(value: number) { + this._marginValue = value; + } + + private _paddingValue: number = 0; + + public set paddingValue(value: number) { + this._paddingValue = value; + } + + applyNormalAttribute(instance: NavigationAttribute): void { + instance.ignoreLayoutSafeArea(this._type, this._edge) + .padding(this._paddingValue) + .margin(this._marginValue) + .expandSafeArea(this._type2, this._edge2) + .hideTitleBar(this._hideTitleBar) + .hideToolBar(this._hideToolBar) + .titleMode(this._titleMode) + .mode(this._mode) + } +} + +@Entry +@Component +struct PageFour { + @State barStyle: BarStyle = BarStyle.STANDARD + @State hideNavBar: boolean = false + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @State pathStack: NavPathStack = new NavPathStack(); + @State navBarPosition: NavBarPosition = NavBarPosition.Start + @State navBarWidth: number = 200 + @State modifier: MyNavigationModifier = new MyNavigationModifier(); + + build() { + Navigation() { + Column() { + Scroll() { + Column() { + Row() { + Button('hideTitleBar=true') + .id('page3_btn7') + .onClick(() => { + this.modifier.hideTitleBar = true + }) + .margin({ bottom: 10, top: 10 }) + .backgroundColor(Color.Transparent) + } + + Row() { + Button('hideToolBar=true') + .id('page3_btn11') + .onClick(() => { + this.modifier.hideToolBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Transparent) + } + + Button('ExpandEdgeNone') + .id('page3_btn16') + .onClick(() => { + this.modifier.edge = [] + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Transparent) + Button('ExpandTypeNone') + .id('page3_btn17') + .onClick(() => { + this.modifier.type = [] + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Transparent) + } + } + } + .width("100%") + .backgroundColor(Color.Red) + } + .attributeModifier(this.modifier) + .navBarWidth(this.navBarWidth) + .title("NavTitle", { + backgroundColor: "#90121314", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN, + barStyle: this.barStyle, // 设置标题栏悬浮 + }) + .hideNavBar(this.hideNavBar) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'nav5', icon: 'collect.png' }, + { value: 'nav6', icon: 'more.png' }, + { value: 'more', icon: 'more_active.png' } + ], { + backgroundColor: "#44556446", + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageOne.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageOne.ets new file mode 100755 index 0000000000000000000000000000000000000000..699265ff17e2e947ae656d21ad78fb94b2d5fe57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageOne.ets @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 window from '@ohos.window'; +import { BusinessError } from '@kit.BasicServicesKit'; + +@Entry +@Component +export struct pageOneTmp { + @Consume('pageInfos') pageInfos: NavPathStack + pageId: number = 0; + @State hideTitleBar: boolean = false + @State barStyle: BarStyle = BarStyle.STANDARD + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @State top: number = 0 + @State bottom: number = 0 + @State edge: Array = []; + @State type: Array = []; + @State type2: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD]; + @State edge2: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]; + @State marginValue: number = 0 + + build() { + NavDestination() { + Column() { + Scroll() { + Column() { + Button('hideTitleBar=true').id('page1_btn1').onClick(() => { + this.hideTitleBar = true + }).margin({ bottom: 10 }) + Button('hideTitleBar=false').id('page1_btn2').onClick(() => { + this.hideTitleBar = false + }).margin({ bottom: 10 }) + Button('ExpandTop') + .id('page1_btn3') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.TOP] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandBottom') + .id('page1_btn4') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandAll') + .id('page1_btn5') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandNone') + .id('page1_btn6') + .onClick(() => { + this.edge = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeNone') + .id('page1_btn7') + .onClick(() => { + this.type = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeSystem') + .id('page1_btn8') + .onClick(() => { + this.type = [LayoutSafeAreaType.SYSTEM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Row() { + Button('paddingTop++') + .id('page1_btn9') + .onClick(() => { + this.top++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingTop--') + .id('page1_btn10') + .onClick(() => { + this.top-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Row() { + Button('paddingBottom++') + .id('page1_btn11') + .onClick(() => { + this.bottom++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingBottom--') + .id('page1_btn12') + .onClick(() => { + this.bottom-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Button('标题浮动切换:' + this.barStyle).id('page1_btn13') + .onClick(() => { + if (this.barStyle == BarStyle.STANDARD) { + this.barStyle = BarStyle.STACK; + } else { + this.barStyle = BarStyle.STANDARD; + } + }).margin({ top: 2, left: 20 }) + + Divider().strokeWidth(2).margin(20) + + Column({ space: 10 }) { + Button('取消NavDestination安全区向上下延伸').id('page1_btn14') + .onClick(() => { + this.edge2 = [SafeAreaEdge.START, SafeAreaEdge.END] + }) + + Button('设置NavDestination安全区类型为CUTOUT').id('page1_btn15') + .onClick(() => { + this.type2 = [SafeAreaType.CUTOUT] + }) + + Button('设置NavDestination安全区类型为KEYBOARD').id('page1_btn16') + .onClick(() => { + this.type2 = [SafeAreaType.KEYBOARD] + }) + + + Button('设置主窗口的布局为沉浸式布局').id('page1_btn17') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(true, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + }) + + Button('设置主窗口的布局为非沉浸式布局').id('page1_btn18') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(false, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to no-full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to no-full-screen mode.'); + }); + }) + }) + + Button('设置主窗口全屏模式时导航栏、状态栏不可见').id('page1_btn19') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable([], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be invisible.'); + }); + }) + }) + Button('设置主窗口全屏模式时导航栏、状态栏可见').id('page1_btn20') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable(['status', 'navigation'], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be visible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be visible.'); + }); + }) + }) + + + Button('margin++ :' + this.marginValue).id('page1_btn21') + .onClick(() => { + this.marginValue += 10 + }) + + Button('margin-- :' + this.marginValue).id('page1_btn22') + .onClick(() => { + this.marginValue -= 10 + }) + + } + + } + } + }.backgroundColor(Color.Red) + } + .margin(this.marginValue) + .expandSafeArea(this.type2, this.edge2) + .padding({ top: this.top, bottom: this.bottom }) + .title("NavTitle", { + backgroundColor: "#90121314", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN, + barStyle: this.barStyle, // 设置标题栏悬浮 + }) + .hideTitleBar(this.hideTitleBar) + .backgroundColor(Color.Yellow) + .ignoreLayoutSafeArea(this.type, this.edge) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageThree.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageThree.ets new file mode 100755 index 0000000000000000000000000000000000000000..d677be851d833810a6204908b602498780f38094 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageThree.ets @@ -0,0 +1,392 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { pageOneTmp } from './PageOne' +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +class MyNavigationModifier implements AttributeModifier { + private _titleMode: NavigationTitleMode = NavigationTitleMode.Mini; + + public set titleMode(value: NavigationTitleMode) { + this._titleMode = value; + } + + private _mode: NavigationMode = NavigationMode.Auto; + + public set mode(value: NavigationMode) { + this._mode = value; + } + + private _hideTitleBar: boolean = false; + + public set hideTitleBar(value: boolean) { + this._hideTitleBar = value; + } + + private _hideToolBar: boolean = false; + + public set hideToolBar(value: boolean) { + this._hideToolBar = value; + } + + private _edge: Array = []; + + public set edge(value: Array) { + this._edge = value; + } + + private _type: Array = []; + + public set type(value: Array) { + this._type = value; + } + + private _type2: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD]; + + public set type2(value: Array) { + this._type2 = value; + } + + private _edge2: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]; + + public set edge2(value: Array) { + this._edge2 = value; + } + + private _marginValue: number = 0; + + public set marginValue(value: number) { + this._marginValue = value; + } + + private _paddingValue: number = 0; + + public set paddingValue(value: number) { + this._paddingValue = value; + } + + applyNormalAttribute(instance: NavigationAttribute): void { + instance.ignoreLayoutSafeArea(this._type, this._edge) + .padding(this._paddingValue) + .margin(this._marginValue) + .expandSafeArea(this._type2, this._edge2) + .hideTitleBar(this._hideTitleBar) + .hideToolBar(this._hideToolBar) + .titleMode(this._titleMode) + .mode(this._mode) + } +} + +@Entry +@Component +struct PageThree { + @State barStyle: BarStyle = BarStyle.STANDARD + @State hideNavBar: boolean = false + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @State pathStack: NavPathStack = new NavPathStack(); + @State navBarPosition: NavBarPosition = NavBarPosition.Start + @State navBarWidth: number = 200 + @State modifier: MyNavigationModifier = new MyNavigationModifier(); + + build() { + Navigation() { + Column() { + Scroll() { + Column() { + Button('titleMode为NavigationTitleMode.Mini') + .id('page3_btn1') + .onClick(() => { + this.modifier.titleMode = NavigationTitleMode.Mini + }) + .margin({ bottom: 10, top: 50 }) + .backgroundColor(Color.Orange) + Button('titleMode为NavigationTitleMode.Free') + .id('page3_btn2') + .onClick(() => { + this.modifier.titleMode = NavigationTitleMode.Free + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Orange) + Button('titleMode为NavigationTitleMode.Full') + .id('page3_btn3') + .onClick(() => { + this.modifier.titleMode = NavigationTitleMode.Full + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Orange) + + Button('mode=NavigationMode.Auto') + .id('page3_btn4') + .onClick(() => { + this.modifier.mode = NavigationMode.Auto + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Button('mode=NavigationMode.Stack') + .id('page3_btn5') + .onClick(() => { + this.modifier.mode = NavigationMode.Stack + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Button('mode=NavigationMode.Split') + .id('page3_btn6') + .onClick(() => { + this.modifier.mode = NavigationMode.Split + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Row() { + Button('hideTitleBar=true') + .id('page3_btn7') + .onClick(() => { + this.modifier.hideTitleBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideTitleBar=false') + .id('page3_btn8') + .onClick(() => { + this.modifier.hideTitleBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Row() { + Button('hideNavBar=true') + .id('page3_btn9') + .onClick(() => { + this.hideNavBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideNavBar=false') + .id('page3_btn10') + .onClick(() => { + this.hideNavBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Row() { + Button('hideToolBar=true') + .id('page3_btn11') + .onClick(() => { + this.modifier.hideToolBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideToolBar=false') + .id('page3_btn12') + .onClick(() => { + this.modifier.hideToolBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Row() { + Button('ExpandTop') + .id('page3_btn13') + .onClick(() => { + this.modifier.edge = [LayoutSafeAreaEdge.TOP] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandBottom') + .id('page3_btn14') + .onClick(() => { + this.modifier.edge = [LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandAll') + .id('page3_btn15') + .onClick(() => { + this.modifier.edge = [LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + } + + Button('ExpandEdgeNone') + .id('page3_btn16') + .onClick(() => { + this.modifier.edge = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeNone') + .id('page3_btn17') + .onClick(() => { + this.modifier.type = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeSystem') + .id('page3_btn18') + .onClick(() => { + this.modifier.type = [LayoutSafeAreaType.SYSTEM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Row() { + Button('margin++:0') + .id('page3_btn19') + .onClick(() => { + this.modifier.marginValue = 20 + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + + Button('margin--:0') + .id('page3_btn20') + .onClick(() => { + this.modifier.marginValue = 0 + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Row() { + Button('padding++:0') + .id('page3_btn21') + .onClick(() => { + this.modifier.paddingValue = 20 + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('padding--:0') + .id('page3_btn22') + .onClick(() => { + this.modifier.paddingValue = 0 + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Button('标题浮动切换:' + this.barStyle).id('page3_btn23') + .onClick(() => { + if (this.barStyle == BarStyle.STANDARD) { + this.barStyle = BarStyle.STACK; + } else { + this.barStyle = BarStyle.STANDARD; + } + }).margin({ top: 2, left: 20 }).backgroundColor("#AAB26C") + Divider().strokeWidth(2).margin(20) + + Column({ space: 10 }) { + Button('取消navigaiton安全区向上下延伸').id('page3_btn24') + .onClick(() => { + this.modifier.edge2 = [] + }) + + Button('设置navigaiton安全区类型为CUTOUT').id('page3_btn25') + .onClick(() => { + this.modifier.type2 = [SafeAreaType.CUTOUT] + }) + + Button('设置navigaiton安全区类型为KEYBOARD').id('page3_btn26') + .onClick(() => { + this.modifier.type2 = [SafeAreaType.KEYBOARD] + }) + } + + Divider().strokeWidth(2).margin({ top: 10, bottom: 10 }) + + Button('设置主窗口的布局为沉浸式布局').id('page3_btn27') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(true, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + }) + + Button('设置主窗口的布局为非沉浸式布局').id('page3_btn28') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(false, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to no-full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to no-full-screen mode.'); + }); + }) + }) + Button('设置主窗口全屏模式时导航栏、状态栏不可见').id('page3_btn29') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable([], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be invisible.'); + }); + }) + }) + + + Button('设置主窗口全屏模式时导航栏、状态栏可见').id('page3_btn30') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable(['status', 'navigation'], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be visible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be visible.'); + }); + }) + }) + Divider().strokeWidth(2).margin({ top: 10, bottom: 50 }) + } + } + } + .width("100%") + .backgroundColor(Color.Red) + } + .attributeModifier(this.modifier) + .navBarWidth(this.navBarWidth) + .title("NavTitle", { + backgroundColor: "#90121314", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN, + barStyle: this.barStyle, // 设置标题栏悬浮 + }) + .hideNavBar(this.hideNavBar) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'nav5', icon: 'collect.png' }, + { value: 'nav6', icon: 'more.png' }, + { value: 'more', icon: 'more_active.png' } + ], { + backgroundColor: "#44556446", + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageTwo.ets new file mode 100755 index 0000000000000000000000000000000000000000..0e2c98a8ab8b07096a1547440ac7686eae3c28e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/PageTwo.ets @@ -0,0 +1,417 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 window from '@ohos.window'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { pageOneTmp } from './PageOne' + +@Entry +@Component +struct PageTwo { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State barStyle: BarStyle = BarStyle.STANDARD + @State hideNavBar: boolean = false + @State hideTitleBar: boolean = false + @State hideToolBar: boolean = false + @State Click: ClickEffectLevel = ClickEffectLevel.HEAVY + @State pathStack: NavPathStack = new NavPathStack(); + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State edge: Array = []; + @State type: Array = []; + @State mode: NavigationMode = NavigationMode.Auto + @State navBarPosition: NavBarPosition = NavBarPosition.Start + @State navBarWidth: number = 200 + @State top: number = 0 + @State bottom: number = 0 + @State left: number = 0 + @State right: number = 0 + @State type2: Array = [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD]; + @State edge2: Array = [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]; + @State marginValue: number = 0 + + @Builder + PageMap(name: string) { + if (name === 'pageOne') { + pageOneTmp({ pageId: Date.now() }) + } + } + + build() { + Navigation(this.pageInfos) { + Column() { + Scroll() { + Column() { + Button('pushPageone', { stateEffect: true, type: ButtonType.Capsule }) + .id('navExp_btn1') + .width('80%') + .height(40) + .margin({ bottom: 10 }) + .onClick(() => { + this.pageInfos.pushPath({ name: 'pageOne' }) //将name指定的NavDestination页面信息入栈 + }) + Button('titleMode为NavigationTitleMode.Mini') + .id('navExp_btn2') + .onClick(() => { + this.titleMode = NavigationTitleMode.Mini + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Orange) + Button('titleMode为NavigationTitleMode.Free') + .id('navExp_btn3') + .onClick(() => { + this.titleMode = NavigationTitleMode.Free + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Orange) + Button('titleMode为NavigationTitleMode.Full') + .id('navExp_btn4') + .onClick(() => { + this.titleMode = NavigationTitleMode.Full + }) + .margin({ bottom: 10 }) + .backgroundColor(Color.Orange) + Row() { + Button('navBarWidth++') + .id('navExp_btn5') + .onClick(() => { + this.navBarWidth++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('navBarWidth--') + .id('navExp_btn6') + .onClick(() => { + this.navBarWidth-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Button('mode=NavigationMode.Auto') + .id('navExp_btn7') + .onClick(() => { + this.mode = NavigationMode.Auto + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Button('mode=NavigationMode.Stack') + .id('navExp_btn8') + .onClick(() => { + this.mode = NavigationMode.Stack + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Button('mode=NavigationMode.Split') + .id('navExp_btn9') + .onClick(() => { + this.mode = NavigationMode.Split + }) + .margin({ bottom: 10 }) + .backgroundColor("#71B26C") + Row() { + Button('hideTitleBar=true') + .id('navExp_btn10') + .onClick(() => { + this.hideTitleBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideTitleBar=false') + .id('navExp_btn11') + .onClick(() => { + this.hideTitleBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Row() { + Button('hideNavBar=true') + .id('navExp_btn12') + .onClick(() => { + this.hideNavBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideNavBar=false') + .id('navExp_btn13') + .onClick(() => { + this.hideNavBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Row() { + Button('hideToolBar=true') + .id('navExp_btn14') + .onClick(() => { + this.hideToolBar = true + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + Button('hideToolBar=false') + .id('navExp_btn15') + .onClick(() => { + this.hideToolBar = false + }) + .margin({ bottom: 10 }) + .backgroundColor("#6CB2AC") + } + + Button('ExpandTop') + .id('navExp_btn16') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.TOP] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandBottom') + .id('navExp_btn17') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandAll') + .id('navExp_btn18') + .onClick(() => { + this.edge = [LayoutSafeAreaEdge.TOP, LayoutSafeAreaEdge.BOTTOM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandNone') + .id('navExp_btn19') + .onClick(() => { + this.edge = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeNone') + .id('navExp_btn20') + .onClick(() => { + this.type = [] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Button('ExpandTypeSystem') + .id('navExp_btn21') + .onClick(() => { + this.type = [LayoutSafeAreaType.SYSTEM] + }) + .margin({ bottom: 10 }) + .backgroundColor("#AD6CB2") + Row() { + Button('paddingTop++') + .id('navExp_btn22') + .onClick(() => { + this.top++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingTop--') + .id('navExp_btn23') + .onClick(() => { + this.top-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Row() { + Button('paddingBottom++') + .id('navExp_btn24') + .onClick(() => { + this.bottom++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingBottom--') + .id('navExp_btn25') + .onClick(() => { + this.bottom-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Row() { + Button('paddingLeft++') + .id('navExp_btn26') + .onClick(() => { + this.left++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingLeft--') + .id('navExp_btn27') + .onClick(() => { + this.left-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Row() { + Button('paddingRight++') + .id('navExp_btn28') + .onClick(() => { + this.right++ + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + Button('paddingRight--') + .id('navExp_btn29') + .onClick(() => { + this.right-- + }) + .margin({ bottom: 10 }) + .backgroundColor("#B2786C") + } + + Button('标题浮动切换:' + this.barStyle).id('navExp_btn30') + .onClick(() => { + if (this.barStyle == BarStyle.STANDARD) { + this.barStyle = BarStyle.STACK; + } else { + this.barStyle = BarStyle.STANDARD; + } + }).margin({ top: 2, left: 20 }).backgroundColor("#AAB26C") + Divider().strokeWidth(2).margin(20) + + + Column({ space: 10 }) { + Button('取消navigaiton安全区向上下延伸').id('navExp_btn31') + .onClick(() => { + this.edge2 = [] + }) + + Button('设置navigaiton安全区类型为CUTOUT').id('navExp_btn32') + .onClick(() => { + this.type2 = [SafeAreaType.CUTOUT] + }) + + Button('设置navigaiton安全区类型为KEYBOARD').id('navExp_btn33') + .onClick(() => { + this.type2 = [SafeAreaType.KEYBOARD] + }) + + + Button('设置主窗口的布局为沉浸式布局').id('navExp_btn34') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(true, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to full-screen mode.'); + }); + }) + }) + + Button('设置主窗口的布局为非沉浸式布局').id('navExp_btn35') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowLayoutFullScreen(false, (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the window layout to no-full-screen mode. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the window layout to no-full-screen mode.'); + }); + }) + }) + Button('设置主窗口全屏模式时导航栏、状态栏不可见').id('navExp_btn36') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable([], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be invisible.'); + }); + }) + }) + + + Button('设置主窗口全屏模式时导航栏、状态栏可见').id('navExp_btn37') + .onClick(() => { + window.getLastWindow(getContext(this), (err, win) => { + win.setWindowSystemBarEnable(['status', 'navigation'], (err: BusinessError) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to set the system bar to be visible. Cause code: ${err.code}, message: ${err.message}`); + return; + } + console.info('Succeeded in setting the system bar to be visible.'); + }); + }) + }) + + + Button('margin++ :' + this.marginValue).id('navExp_btn38') + .onClick(() => { + this.marginValue += 10 + }) + + Button('margin-- :' + this.marginValue).id('navExp_btn39') + .onClick(() => { + this.marginValue -= 10 + }) + + } + } + } + } + .width("100%") + .backgroundColor(Color.Red) + } + .expandSafeArea(this.type2, this.edge2) + .padding({ + top: this.top, + bottom: this.bottom, + left: this.left, + right: this.right + }) + .margin(this.marginValue) + .titleMode(this.titleMode) + .hideTitleBar(this.hideTitleBar) + .navBarWidth(this.navBarWidth) + .hideToolBar(this.hideToolBar) + .navDestination(this.PageMap) + .title("NavTitle", { + backgroundColor: "#90121314", + backgroundBlurStyle: BlurStyle.BACKGROUND_THIN, + barStyle: this.barStyle, // 设置标题栏悬浮 + }) + .hideNavBar(this.hideNavBar) + .mode(this.mode) + .ignoreLayoutSafeArea(this.type, this.edge) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'nav5', icon: 'collect.png' }, + { value: 'nav6', icon: 'more.png' }, + { value: 'more', icon: 'more_active.png' } + ], { + backgroundColor: "#44556446", + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.ets new file mode 100755 index 0000000000000000000000000000000000000000..e2f55dfa3553690f792ad1950322b9da0bce85a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion.ets @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavNavigationContentExpansion { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State hideTitleBar: boolean = false; + @State navBarPosition: NavBarPosition | undefined = undefined; + @State _width: string | number = '100%' + @State mode: NavigationMode = NavigationMode.Auto + @State types: Array | null = null + @State edges: Array | null = null + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(68) + .width('100%') + Row() { + Button('Stack').id('navExp_btn1').onClick(() => { + this.mode = NavigationMode.Stack; + }).margin({ top: 5, left: 5 }) + Button('Split').id('navExp_btn2').onClick(() => { + this.mode = NavigationMode.Split; + this._width = '95%' + }).margin({ top: 5, left: 5 }) + Button('Free').id('navExp_btn3').onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }).margin({ top: 5, left: 5 }) + Button('Mini').id('navExp_btn4').onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + Row() { + Button('hideTitleBar=true').id('navExp_btn5').onClick(() => { + this.hideTitleBar = true; + }).margin({ top: 5, left: 5 }) + Button('hideToolBar=true').id('navExp_btn6').onClick(() => { + this.hideToolBar = true; + }).margin({ top: 5, left: 5 }) + Button('ExpandTop').id('navExp_btn7').onClick(() => { + this.edges = [LayoutSafeAreaEdge.TOP]; + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + Row() { + Button('ExpandBottom').id('navExp_btn8').onClick(() => { + this.edges = [LayoutSafeAreaEdge.BOTTOM]; + }).margin({ top: 5, left: 5 }) + Button('ExpandAll').id('navExp_btn9').onClick(() => { + this.edges = [LayoutSafeAreaEdge.BOTTOM, LayoutSafeAreaEdge.TOP]; + }).margin({ top: 5, left: 5 }) + Button('ExpandTypeSystem').id('navExp_btn10').onClick(() => { + this.types = [LayoutSafeAreaType.SYSTEM] + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + Row() { + }.alignSelf(ItemAlign.Start) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('text' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(500) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus([ + { value: 'menu1', icon: 'Add_active.png' }, + { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }, + { value: 'menu4', icon: 'Add.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(this.hideTitleBar) + .navBarPosition(this.navBarPosition) + .mode(this.mode) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'more', icon: 'more_active.png' }, + { value: 'menu5', icon: 'collect.png' }, + { value: 'menu6', icon: 'more.png' } + ]) + // .ignoreLayoutSafeArea(this.types,this.edges) + // .ignoreLayoutSafeArea([LayoutSafeAreaType.SYSTEM],[LayoutSafeAreaEdge.TOP]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('100%').backgroundColor(Color.Pink) + .expandSafeArea([SafeAreaType.SYSTEM], + [SafeAreaEdge.TOP, SafeAreaEdge.END, SafeAreaEdge.BOTTOM, SafeAreaEdge.START]) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain.ets new file mode 100755 index 0000000000000000000000000000000000000000..167ec76c9a6fbf92c1f71dcc58ca6eb0bfdeb3f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 '@kit.ArkUI' + +@Entry +@Component +struct UIComponentNavNavigationContentExpansionMain { + pageInfo: NavPathStack = new NavPathStack() + + build() { + Navigation(this.pageInfo) { + Column() { + Button('TO Page1', { stateEffect: true, type: ButtonType.Capsule }) + .id('expMain_btn1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationContentExpansion/PageOne' + }) + }) + Button('TO Page2', { stateEffect: true, type: ButtonType.Capsule }) + .id('expMain_btn2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationContentExpansion/PageTwo' + }) + }) + Button('TO Page3', { stateEffect: true, type: ButtonType.Capsule }) + .id('expMain_btn3') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationContentExpansion/PageThree' + }) + }) + Button('TO Page4', { stateEffect: true, type: ButtonType.Capsule }) + .id('expMain_btn4') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationContentExpansion/PageFour' + }) + }) + } + }.title('MainPage') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160.ets new file mode 100755 index 0000000000000000000000000000000000000000..985c457f60cdbef022c36f349e3979f35fb24aae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160.ets @@ -0,0 +1,241 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { JSON } from '@kit.ArkTS'; + +class DerivedNavPathStack extends NavPathStack { + getParent(): NavPathStack | null { + console.log('[derive-test] reached DerivedNavPathStack\'s getParent'); + return super.getParent(); + } +} + +@Entry +@Component +struct NavCustomZing0160 { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + derivedStack2: DerivedNavPathStack = new DerivedNavPathStack(); + faStack: NavPathStack = new NavPathStack(); + + @Builder + pageMap(name: string) { + if (name === 'pageOne') { + PageOne() + } else if (name === 'pageTwo') { + PageTwo() + } else if (name === 'pageThree') { + PageThree() + } + } + + build() { + Column({ space: 10 }) { + Button('父Navigation push pageOne') + .onClick(() => { + this.faStack.pushPath({ name: 'pageOne' }) + }) + + Button('子Navigation getParent且清除父Navigation的路由栈') + .onClick(() => { + let stack = this.derivedStack.getParent() + if (stack) { + stack.clear() + console.log('[derive-test] getParent return :' + JSON.stringify(this.derivedStack.getParent())) + } else { + console.log('[derive-test] getParent return :' + this.derivedStack.getParent()) + } + }) + + Navigation(this.faStack) { + Navigation(this.derivedStack) { + Column({ space: 10 }) { + + }.width('100%') + } + .height('70%') + .title('子Navigation') + .backgroundColor('#ffb0cdb0') + .navDestination(this.pageMap) + } + .height('35%') + .title('父Navigation') + .backgroundColor(Color.Pink) + .navDestination(this.pageMap) + + Button('无父Navigation getParent') + .onClick(() => { + let stack = this.derivedStack2.getParent() + if (stack) { + stack.clear() + console.log('[derive-test] getParent return :' + JSON.stringify(this.derivedStack2.getParent())) + } else { + console.log('[derive-test] getParent return :' + this.derivedStack2.getParent()) + } + }) + Navigation(this.derivedStack2) { + } + .height('35%') + .title('无父Navigation') + .backgroundColor(Color.Pink) + .navDestination(this.pageMap) + + } + } +} + +@Component +struct PageOne { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .title('pageOne') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageOne onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] pageOne on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] pageOne onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] pageOne onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] pageOne onWillShow") + }) + .onShown(() => { + console.log("[derive-test] pageOne onShown") + }) + .onWillHide(() => { + console.log("[derive-test] pageOne onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] pageOne onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] pageOne onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] pageOne onDisAppear") + }) + + } +} + + +@Component +struct PageTwo { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .title('pageTwo') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageTwo onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] PageTwo on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] PageTwo onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] PageTwo onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] PageTwo onWillShow") + }) + .onShown(() => { + console.log("[derive-test] PageTwo onShown") + }) + .onWillHide(() => { + console.log("[derive-test] PageTwo onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] PageTwo onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] PageTwo onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] PageTwo onDisAppear") + }) + } +} + +@Component +struct PageThree { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .title('pageThree') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageThree onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] pageThree on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] pageThree onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] pageThree onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] pageThree onWillShow") + }) + .onShown(() => { + console.log("[derive-test] pageThree onShown") + }) + .onWillHide(() => { + console.log("[derive-test] pageThree onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] pageThree onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] pageThree onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] pageThree onDisAppear") + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/PageMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/PageMain.ets new file mode 100755 index 0000000000000000000000000000000000000000..6bcb83816236d9722c6dd811c27e8468c905fc74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationCustomZing/PageMain.ets @@ -0,0 +1,477 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 { BusinessError, Callback } from '@ohos.base'; +import { JSON } from '@kit.ArkTS'; +import observer from '@ohos.arkui.observer'; + +class DerivedNavPathStack extends NavPathStack { + // usr defined property 'id' + id: string = "__default__" + + // new function in derived class + setId(id: string) { + this.id = id; + } + + // new function in derived class + getInfo(): string { + return "this page used Derived NavPathStack, id: " + this.id + } + + // overwrite function of NavPathStack + pushPath(info: NavPathInfo): void + pushPath(info: NavPathInfo, animated?: boolean): void + pushPath(info: NavPathInfo, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack pushPath'); + super.pushPath(info, animated); + } + + pushPathByName1(name: string, param: ESObject, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s pushPathByName'); + super.pushPathByName(name, param, animated); + } + + pushPathByName2(name: string, param: ESObject, onPop: Callback, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s pushPathByName(onPop)'); + super.pushPathByName(name, param, onPop, animated); + } + + pushDestination(info: NavPathInfo): Promise + pushDestination(info: NavPathInfo, animated?: boolean): Promise + pushDestination(info: NavPathInfo, animated?: boolean): Promise { + console.log('[derive-test] reached DerivedNavPathStack pushDestination'); + return super.pushDestination(info, animated); + } + + pushDestinationByName1(name: string, param: Object, animated?: boolean): Promise { + console.log('[derive-test] reached DerivedNavPathStack\'s pushDestinationByName10'); + return super.pushDestinationByName(name, param, animated); + } + + pushDestinationByName2(name: string, param: Object, onPop: Callback, animated?: boolean): Promise { + console.log('[derive-test] reached DerivedNavPathStack\'s pushDestinationByName2'); + return super.pushDestinationByName(name, param, onPop, animated); + } + + replacePath(info: NavPathInfo): void + replacePath(info: NavPathInfo, animated?: boolean): void + replacePath(info: NavPathInfo, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s replacePath'); + super.replacePath(info, animated); + } + + replacePathByName(name: string, param: Object, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s replacePathByName'); + super.replacePathByName(name, param, animated); + } + + removeByIndexes(indexes: Array): number { + console.log('[derive-test] reached DerivedNavPathStack\'s removeByIndexes'); + return super.removeByIndexes(indexes); + } + + removeByName(name: string): number { + console.log('[derive-test] reached DerivedNavPathStack\'s removeByName'); + return super.removeByName(name); + } + + pop(animated?: boolean | undefined): NavPathInfo | undefined + pop(result: Object, animated?: boolean | undefined): NavPathInfo | undefined + pop(result?: Object, animated?: boolean | undefined): NavPathInfo | undefined { + console.log('[derive-test] reached DerivedNavPathStack\'s pop'); + return super.pop(result, animated); + } + + popToName(name: string, animated?: boolean): number + popToName(name: string, result: Object, animated?: boolean): number + popToName(name: string, result?: Object, animated?: boolean): number { + console.log('[derive-test] reached DerivedNavPathStack\'s popToName'); + return super.popToName(name, result, animated); + } + + popToIndex(index: number, animated?: boolean): void + popToIndex(index: number, result: Object, animated?: boolean): void + popToIndex(index: number, result?: Object, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s popToIndex'); + super.popToIndex(index, result, animated); + } + + moveToTop(name: string, animated?: boolean): number { + console.log('[derive-test] reached DerivedNavPathStack\'s moveToTop'); + return super.moveToTop(name, animated); + } + + moveIndexToTop(index: number, animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s moveIndexToTop'); + super.moveIndexToTop(index, animated); + } + + clear(animated?: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s clear'); + super.clear(animated); + } + + getAllPathName(): Array { + console.log('[derive-test] reached DerivedNavPathStack\'s getAllPathName'); + return super.getAllPathName(); + } + + getParamByIndex(index: number): ESObject | undefined { + console.log('[derive-test] reached DerivedNavPathStack\'s getParamByIndex'); + return super.getParamByIndex(index); + } + + getParamByName(name: string): Array { + console.log('[derive-test] reached DerivedNavPathStack\'s getParamByName'); + return super.getParamByName(name); + } + + getIndexByName(name: string): Array { + console.log('[derive-test] reached DerivedNavPathStack\'s getIndexByName'); + return super.getIndexByName(name); + } + + size(): number { + console.log('[derive-test] reached DerivedNavPathStack\'s size'); + return super.size(); + } + + disableAnimation(value: boolean): void { + console.log('[derive-test] reached DerivedNavPathStack\'s disableAnimation'); + super.disableAnimation(value); + } + + getParent(): NavPathStack | null { + console.log('[derive-test] reached DerivedNavPathStack\'s getParent'); + return super.getParent(); + } + + setInterception(interception: NavigationInterception): void { + console.log('[derive-test] reached DerivedNavPathStack\'s setInterception'); + super.setInterception(interception); + } + + pushAndPopIndex(): void { + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.pushPathByName('pageOne', new param('ok')); + super.popToIndex(1); + } + + pushAndReplace(): void { + super.pushPathByName('pageOne', new param('ok')); + super.replacePathByName('pageTwo', new param('ok')); + } +} + +class param { + info: string = "default_param"; + + constructor(info: string) { + this.info = info + } +} + +@Entry +@Component +struct PageMain { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + @State disableAnimationValue: boolean = false + @State modeValue: NavigationMode[] = [NavigationMode.Stack, NavigationMode.Split, NavigationMode.Auto] + @State modeValueIndex: number = 0 + @State modeValueStr: string[] = ['NavigationMode.Stack', 'NavigationMode.Split', 'NavigationMode.Auto'] + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`[derive-test] navDesUpdateCallback, info: ${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + @Builder + pageMap(name: string) { + if (name === 'pageOne') { + PageOne() + } else if (name === 'pageTwo') { + PageTwo() + } else if (name === 'pageThree') { + PageThree() + } + } + + @State text: string = '' + + build() { + Column({ space: 5 }) { + Row({ space: 5 }) { + Button('observer.on') + .onClick(() => { + this.observerOn() + }) + + Button('observer.off') + .onClick(() => { + this.observerOff() + }) + } + + Text(this.text).fontSize(20).fontColor(Color.Orange).width('100%').height(60).margin(6) + + Scroll() { + Column({ space: 5 }) { + Button('pushPath pageOne') + .onClick(() => { + this.derivedStack.pushPath({ name: 'pageOne', param: new param('ok') }, true) + }) + + Button('pushPathByName pageTwo') + .onClick(() => { + this.derivedStack.pushPathByName1('pageTwo', new param('ok'), false) + }) + + Button('pushPathByName(onPop) pageThree') + .onClick(() => { + this.derivedStack.pushPathByName2('pageThree', new param('ok'), (popInfo) => { + console.log('[pushPathByName(onPop)]last page is: ' + popInfo.info.name + ', result: ' + + JSON.stringify(popInfo.result)) + }) + }) + + Button('replacePath pageTwo') + .onClick(() => { + this.derivedStack.replacePath({ name: 'pageTwo', param: new param('ok') }) + }) + + Button('replacePathByName pageTwo') + .onClick(() => { + this.derivedStack.replacePathByName('pageTwo', new param('ok')) + }) + + Button('removeByIndexes [0]') + .onClick(() => { + let mes = this.derivedStack.removeByIndexes([0]) + console.log('[derive-test] removeByIndexes return :' + mes) + }) + + Button('removeByName pageOne') + .onClick(() => { + let mes = this.derivedStack.removeByName('pageOne') + console.log('[derive-test] removeByName return :' + mes) + }) + + Button('getAllPathName') + .onClick(() => { + let mes = JSON.stringify(this.derivedStack.getAllPathName()) + console.log('[derive-test] getAllPathName return :' + mes) + this.text = 'getAllPathName return :' + mes + }) + + Button('moveToTop pageOne') + .onClick(() => { + let mes = this.derivedStack.moveToTop('pageOne') + console.log('[derive-test] moveToTop return :' + mes) + }) + + Button('moveIndexToTop 0') + .onClick(() => { + this.derivedStack.moveIndexToTop(0) + }) + Button('pushAndReplace') + .onClick(() => { + this.derivedStack.pushAndReplace() + }) + Button('pushAndPopIndex') + .onClick(() => { + this.derivedStack.pushAndPopIndex() + }) + Button('getParent') + .onClick(() => { + let stack = this.derivedStack.getParent() + if (stack) { + stack.clear() + } else { + console.log('[derive-test] getParent return :' + this.derivedStack.getParent()) + } + }) + } + + }.width('100%').height('60%').borderWidth(1).borderColor('#ffe20ea6') + + Navigation(this.derivedStack) { + } + .borderWidth(1) + .height('30%') + .title('Navigation') + .minContentWidth(50) + .navDestination(this.pageMap) + .mode(this.modeValue[this.modeValueIndex]) + .navBarWidthRange(['240vp', '432vp']) + } + + } +} + +@Component +struct PageOne { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .title('pageOne') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageOne onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] pageOne on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] pageOne onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] pageOne onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] pageOne onWillShow") + }) + .onShown(() => { + console.log("[derive-test] pageOne onShown") + }) + .onWillHide(() => { + console.log("[derive-test] pageOne onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] pageOne onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] pageOne onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] pageOne onDisAppear") + }) + + } +} + +@Component +struct PageTwo { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .title('pageTwo') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageTwo onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] PageTwo on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] PageTwo onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] PageTwo onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] PageTwo onWillShow") + }) + .onShown(() => { + console.log("[derive-test] PageTwo onShown") + }) + .onWillHide(() => { + console.log("[derive-test] PageTwo onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] PageTwo onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] PageTwo onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] PageTwo onDisAppear") + }) + } +} + +@Component +struct PageThree { + derivedStack: DerivedNavPathStack = new DerivedNavPathStack(); + curStringifyParam: string = ""; + + build() { + NavDestination() { + Column({ space: 10 }) { + } + } + .mode(NavDestinationMode.DIALOG) + .title('pageThree') + .backgroundColor(Color.Pink) + .onReady((context: NavDestinationContext) => { + console.log('[derive-test] PageThree onReady'); + this.derivedStack = context.pathStack as DerivedNavPathStack; + }) + .onBackPressed(() => { + console.log(`[derive-test] pageThree on backpress`) + this.derivedStack?.pop() + return true + }) + .onWillAppear(() => { + console.log("[derive-test] pageThree onWillAppear") + }) + .onAppear(() => { + console.log("[derive-test] pageThree onAppear") + }) + .onWillShow(() => { + console.log("[derive-test] pageThree onWillShow") + }) + .onShown(() => { + console.log("[derive-test] pageThree onShown") + }) + .onWillHide(() => { + console.log("[derive-test] pageThree onWillHide") + }) + .onHidden(() => { + console.log("[derive-test] pageThree onHidden") + }) + .onWillDisappear(() => { + console.log("[derive-test] pageThree onWillDisappear") + }) + .onDisAppear(() => { + console.log("[derive-test] pageThree onDisAppear") + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationNewInstance/PageMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationNewInstance/PageMain.ets new file mode 100755 index 0000000000000000000000000000000000000000..ce90b6e72093892126c149b32abb90aa1571a12b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationNewInstance/PageMain.ets @@ -0,0 +1,513 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 observer from '@ohos.arkui.observer'; + +class NavDestinationIdHelper { + private ids: Array = []; + private static instance: NavDestinationIdHelper = new NavDestinationIdHelper() + + static getInstance() { + return NavDestinationIdHelper.instance + } + + addId(id: string): number { + this.ids.push(id) + return this.ids.length + } + + removeId(id: string): boolean { + let index: number = this.ids.findIndex(element => element === id) + if (index === -1) { + return false + } + this.ids.splice(index, 1) + return true + } + + getIdArray(): Array { + return this.ids + } +} + +@Component +export struct MyButton { + text: string = "" + onClickFunction: (event: ClickEvent) => void = () => { + } + backGdColor = '#ccc' + + build() { + Button() { + Text(this.text) + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ top: 6 }) + .onClick(this.onClickFunction) + .backgroundColor(this.backGdColor) + } +} + +@Entry({ routeName: "newInstanceTest" }) +@Component +struct forcedNewInstance { + @Provide('stack') stack: NavPathStack = new NavPathStack() + + // func() { + // console.log('test') + // } + + aboutToAppear(): void { + this.getUIContext().getUIObserver().on('routerPageUpdate', (info) => { + console.log('[router] observerInfo: ' + JSON.stringify(info)) + }) + } + + @Builder + pageMap(name: string) { + if (name.substring(0, 7) == "pageOne") { + PageOne() + } else if (name.substring(0, 7) == "pageTwo") { + PageTwo() + } + } + + @State mode: NavigationMode = NavigationMode.Auto + + build() { + Navigation(this.stack) { + Text("空白过渡页面") + + }.navDestination(this.pageMap) + .mode(NavigationMode.Auto) + .onAppear(() => { + this.stack.pushDestination({ name: "pageTwo" }) + }) + } +} + +@Component +export struct PageOne { + @Consume('stack') stack: NavPathStack + @State stackSize: number = -1 + @State stackArray: Array = [] + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + name: string = "PAGE_ONE" + + build() { + NavDestination() { + Column() { + Text('当前栈信息: ') + .fontSize(35) + .fontWeight(FontWeight.Bold) + Text(JSON.stringify(this.stackArray)) + .fontSize(20) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('current id: ' + this.curId) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .margin(15) + Text('all id: ' + JSON.stringify(this.idArray)) + .fontSize(18) + .margin(20) + } + + MyButton({ + text: "push new_instance pageTwo", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + + MyButton({ + text: "push pageOne", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }) + } + }) + + MyButton({ + text: "push pageTwo", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }) + } + }) + + MyButton({ + text: "push new_instance pageOne", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageOne" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + MyButton({ + text: "pop*2 + push pageTwo", + onClickFunction: () => { + this.stack.pop() + this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + + MyButton({ + text: "pop*2 + push pageTwo,pageOne", + onClickFunction: () => { + this.stack.pop() + this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushPath({ name: "pageOne" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + + MyButton({ + text: "clear + push pageTwo", + onClickFunction: () => { + this.stack.clear() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + Divider().strokeWidth(5).backgroundColor(Color.Black).margin(5) + Scroll() { + Column() { + Row() { + MyButton({ + text: "pop", + onClickFunction: () => { + this.stack.pop() + } + }) + MyButton({ + text: "popToIndex 0", + onClickFunction: () => { + this.stack.popToIndex(0) + } + }) + MyButton({ + text: "clear", + onClickFunction: () => { + this.stack.clear() + } + }) + } + + MyButton({ + text: "popToName pageTwo", + onClickFunction: () => { + this.stack.popToName('pageTwo') + } + }) + MyButton({ + text: "removeByName:pageOne", + onClickFunction: () => { + this.stack.removeByName('pageOne') + } + }) + MyButton({ + text: "removeByIndexes:1", + onClickFunction: () => { + this.stack.removeByIndexes([1]) + } + }) + MyButton({ + text: `removeByNavDestinationId:${this.curId}`, + onClickFunction: () => { + this.stack.removeByNavDestinationId(this.curId) + } + }) + } + }.height(200) + + } + .title('Page One') + .id("2") + .onReady((ctx) => { + // get from query + let id = this.queryNavDestinationInfo()?.navDestinationId + // get from onReady + this.stack = ctx.pathStack + this.curId = ctx.navDestinationId ? ctx.navDestinationId : "__invalid__" + NavDestinationIdHelper.getInstance().addId(this.curId) + }) + .onWillShow(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onWillShow') + }) + .onShown(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onShown') + this.stackSize = this.stack.size() + + }) + .onWillHide(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onWillHide') + }) + .onHidden(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onHidden') + }) + .onWillAppear(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onWillAppear') + }) + .onAppear(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onAppear') + }) + .onWillDisappear(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onWillDisappear') + }) + .onDisAppear(() => { + console.log('[Nav][new_instance][life] ' + 'Page One' + ' onDisAppear') + }) + + } +} + +@Component +export struct PageTwo { + @Consume('stack') stack: NavPathStack + // stack: NavPathStack = new NavPathStack() + @State stackSize: number = -1 + @State stackArray: Array = [] + // color: Color = (Tool.count) % 2 == 0 ? Color.Pink : Color.Gray + @State name: string = "PAGE_TWO" + @State mode: NavigationMode = NavigationMode.Auto + private scroller: Scroller = new Scroller() + @State disableAnimation: boolean = false + @State curId: string = "NA" + @State idArray: Array = NavDestinationIdHelper.getInstance().getIdArray(); + @State count: number = 0; + + navDesUpdateCallback(info: NavDestinationInfo) { + console.log(`testTag navDesUpdateCallback,info:${JSON.stringify(info)}`); + } + + observerOn() { + observer.on('navDestinationUpdate', this.navDesUpdateCallback); + } + + observerOff() { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + aboutToDisappear(): void { + observer.off('navDestinationUpdate', this.navDesUpdateCallback); + } + + build() { + NavDestination() { + Scroll(this.scroller) { + Column() { + Column() { + Text('当前栈信息: (索引:名称)') + .fontSize(35) + .fontWeight(FontWeight.Bold) + Text(JSON.stringify(this.stackArray)) + .fontSize(20) + .fontWeight(FontWeight.Bold) + } + + Column() { + Text('current id: ' + this.curId) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .margin(15) + Text('all id: ' + JSON.stringify(this.idArray)) + .fontSize(18) + .margin(20) + } + + //不使用New Instance + Column() { + Column() { + Text('不使用New Instance') + .fontSize(22) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Start) + .position({ top: 7, left: 7 }) + }.margin(5) + + Scroll(this.scroller) { + Column() { + Row({ space: 5 }) { + Button('observerOn') + .onClick(() => { + this.observerOn() + }) + + Button('observerOff') + .onClick(() => { + this.observerOff() + }) + + } + + Column() { + Button('全局是否禁用转场动画,disableAnimation: ' + this.disableAnimation) + .margin(10) + .onClick(() => { + this.disableAnimation = !this.disableAnimation + this.stack.disableAnimation(this.disableAnimation) + }) + MyButton({ + text: "push pageTwo", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }) + } + }) + } + } + }.height("200vp").scrollBar(BarState.On) + + }.backgroundColor('#598') + .width('100%') + .height('210vp') + .margin(10) + + // 使用New Instance + Column({ space: 5 }) { + Column() { + Text('使用New Instance') + .fontSize(22) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Start) + } + + Scroll(this.scroller) { + Column() { + MyButton({ + text: "pop*2,push pageTwo*2", + onClickFunction: () => { + this.stack.pop() + this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + MyButton({ + text: "pop + push 新实例 (无动画)", + onClickFunction: () => { + this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE, animated: false }) + } + }) + MyButton({ + text: "pop + push 新实例 two x2", + onClickFunction: () => { + this.stack.pop() + this.stack.pushDestination({ name: "pageTwo" + this.count++ }, + { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushDestination({ name: "pageTwo" + this.count++ }, + { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + MyButton({ + text: "push 新实例 pageTwo*5", + onClickFunction: () => { + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + MyButton({ + text: "push 新实例 Two*2 + pop*2", + onClickFunction: () => { + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + this.stack.pop() + this.stack.pop() + } + }) + MyButton({ + text: "pop*2,push pageTwo", + onClickFunction: () => { + this.stack.pop() + this.stack.pop() + this.stack.pushDestination({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + }) + MyButton({ + text: "push*100,popToName,push*10", + onClickFunction: () => { + let i: number + for (i = 1; i <= 100; i++) { + // this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + this.stack.popToName("pageTwo") + for (i = 1; i <= 10; i++) { + // this.stack.pop() + this.stack.pushPath({ name: "pageTwo" }, { launchMode: LaunchMode.NEW_INSTANCE }) + } + } + }) + } + }.height('295vp').scrollBar(BarState.On) + }.backgroundColor('#aff') + .width('100%') + .height('300vp') + } + }.height('100%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + }.width(20).backgroundColor('#ededed') + + } + .title(this.name) //.backgroundColor(this.color) + .onReady((ctx: NavDestinationContext) => { + this.stack = ctx.pathStack + this.name = ctx.pathInfo.name + let allName = this.stack.getAllPathName() + this.stackArray = [] + for (let i = 0; i < allName.length; i++) { + this.stackArray.push(i + ":" + allName[i]) + } + }) + .onWillShow(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onWillShow') + }) + .onShown(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onShown') + this.stackSize = this.stack.size() + + }) + .onWillHide(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onWillHide') + }) + .onHidden(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onHidden') + }) + .onWillAppear(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onWillAppear') + }) + .onAppear(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onAppear') + }) + .onWillDisappear(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onWillDisappear') + }) + .onDisAppear(() => { + console.log('[Nav][new_instance][life] ' + this.name + ' onDisAppear') + }) + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/Page.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/Page.ets new file mode 100755 index 0000000000000000000000000000000000000000..d416bbfc0020625276759f4ff0ae4111f1ac3445 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/Page.ets @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 Settings from '../../../test/model/Settings'; + +@Builder +export function PageBuilder(name: string, param: Object) { + Page() +} + +@Entry +@Component +struct Page { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State navBarPosition: NavBarPosition | undefined = undefined; + @State _width: string | number = '100%' + @State mode: NavigationMode = NavigationMode.Auto + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(68) + .width('100%') + Row() { + Button('rtl').id('navRtl0010_btn1').onClick(() => { + Settings.switchCusLocales('ug-CN'); + }).margin({ top: 5, left: 5 }) + Button('ltr').id('navRtl0010_btn2').onClick(() => { + Settings.switchCusLocales('zh-Hans-CN'); + }).margin({ top: 5, left: 5 }) + Button('changeOrientation').id('navRtl0010_btn3').onClick(() => { + Settings.changeOrientation(); + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + Row() { + Button('NavBarPosition.Start').id('navRtl0010_btn4').onClick(() => { + this.navBarPosition = NavBarPosition.Start; + }).margin({ top: 5, left: 5 }) + Button('NavBarPosition.End').id('navRtl0010_btn5').onClick(() => { + this.navBarPosition = NavBarPosition.End; + }).margin({ top: 5, left: 5 }) + Button('NavigationMode.Split').id('navRtl0010_btn6').onClick(() => { + this.mode = NavigationMode.Split; + this._width = '95%' + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + Row() { + Button('NavigationTitleMode.Mini').id('navRtl0010_btn7').onClick(() => { + this.titleMode = NavigationTitleMode.Mini; + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus([ + { value: 'menu1', icon: 'Add_active.png' }, + { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }, + { value: 'menu4', icon: 'Add.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarPosition(this.navBarPosition) + .mode(this.mode) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'more', icon: 'more_active.png' }, + { value: 'menu5', icon: 'collect.png' }, + { value: 'menu6', icon: 'more.png' } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('95%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/PageTwo.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/PageTwo.ets new file mode 100755 index 0000000000000000000000000000000000000000..ae59d73265731ec75b21e2b25d36736f65bd654b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/PageTwo.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 Settings from '../../../test/model/Settings'; + +@Builder +export function PageTwoBuilder(name: string, param: Object) { + PageTwo() +} + +@Entry +@Component +struct PageTwo { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Mini + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State navBarPosition: NavBarPosition | undefined = undefined; + @State _width: string | number = '100%' + @State mode: NavigationMode = NavigationMode.Auto + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + Navigation() { + Navigation() { + Row() { + Button('rtl').id('navRtl0020_btn1').onClick(() => { + Settings.switchCusLocales('ug-CN'); + }).margin({ top: 5, left: 5 }) + Button('ltr').id('navRtl0020_btn2').onClick(() => { + Settings.switchCusLocales('zh-Hans-CN'); + }).margin({ top: 5, left: 5 }) + Button('changeOrientation').id('navRtl0020_btn3').onClick(() => { + Settings.changeOrientation(); + }).margin({ top: 5, left: 5 }) + }.alignSelf(ItemAlign.Start) + } + .title({ main: 'New Navigation', sub: 'new sub' }, { backgroundColor: '#ffeeee22' }) + .width(this._width) + .height('30%') + .backgroundColor(Color.Pink) + + Divider().width(6).color(Color.Orange).margin(10); + Image('img.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(168) + .width('100%') + } + .title({ main: 'MainTitle', sub: this.subMsg }, { backgroundColor: '#ffeeeecc' }) + .menus([{ value: 'menu1', icon: 'Add_active.png' }, { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }, + { value: 'menu4', icon: 'Add.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarPosition(this.navBarPosition) + .mode(this.mode) + .toolbarConfiguration([ + { value: 'add', icon: 'Add_active.png' }, + { value: 'app', icon: 'collect_active.png' }, + { value: 'collect', icon: 'collect.png' }, + { value: 'more', icon: 'more_active.png' }, + { value: 'menu5', icon: 'collect.png' }, + { value: 'menu6', icon: 'more.png' } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(this._width).height('95%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain.ets new file mode 100755 index 0000000000000000000000000000000000000000..2046df32128b2b830e76840f4c9a01757d01fb84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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 '@kit.ArkUI' + +@Entry +@Component +struct UIComponentNavNavigationRtlMain { + pageInfo: NavPathStack = new NavPathStack() + + build() { + Navigation(this.pageInfo) { + Column() { + Button('TO Page', { stateEffect: true, type: ButtonType.Capsule }) + .id('rtlMain_btn1') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationRtl/Page' + }) + }) + Button('TO Page2', { stateEffect: true, type: ButtonType.Capsule }) + .id('rtlMain_btn2') + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + router.pushUrl({ + url: 'testability/pages/UIComponentNavNavigationRtl/PageTwo' + }) + }) + } + }.title('MainPage') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0040.ets new file mode 100755 index 0000000000000000000000000000000000000000..eda63953844dd93cdb7054483e5d13d86adb9ce9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0040.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0040 { + @State msg: string = 'NavDestination:CustomBuilder' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + Text('subtitle') + .fontColor('#182431') + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title(this.NavigationTitle) + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0050.ets new file mode 100755 index 0000000000000000000000000000000000000000..363e5918de85b31c2fbce0d5bb6f08dc9c708e06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0050.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0050 { + @State msg: string = 'NavDestination:CustomBuilder\n fontSize(30)' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title(this.NavigationTitle) + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0070.ets new file mode 100755 index 0000000000000000000000000000000000000000..2f23be5fe0d74c3ee85b768f6cc60e8ff696a577 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0070.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0070 { + @State msg: string = 'NavDestination:NavigationCommonTitle' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title({ main: 'NavDestination', sub: 'subTitle' }) + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0080.ets new file mode 100755 index 0000000000000000000000000000000000000000..f7ab02938c34dd964950821ebae7021a76889646 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0080.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0080 { + @State msg: string = 'NavDestination:NavigationCustomTitle,TitleHeight.MainOnly' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title({ builder: this.NavigationTitle, height: 120 }) + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0090.ets new file mode 100755 index 0000000000000000000000000000000000000000..dd5d53e2b9671f87c19041b712b03750d9f2a62a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0090.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0090 { + @State msg: string = 'NavDestination:NavigationCustomTitle,TitleHeight.MainOnly' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title({ builder: this.NavigationTitle, height: TitleHeight.MainOnly }) + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0100.ets new file mode 100755 index 0000000000000000000000000000000000000000..7d300ba76ed65f03e4e1849087f603d80cf3dfc3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0100.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0100 { + @State msg: string = 'NavDestination:NavigationCustomTitle,TitleHeight.MainOnly' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + Text('subtitle') + .fontColor('#182431') + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + } + .title({ builder: this.NavigationTitle, height: TitleHeight.MainWithSub }) + .key('NavDestination_Interface0100') + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0140.ets new file mode 100755 index 0000000000000000000000000000000000000000..21940706ed655c6bc38b20052288488a9669226c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0140.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0140 { + @State msg: string = 'NavDestination:string' + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + private menuItems: Array = [ + { + value: "1", + icon: '2.png', + }, + { + value: "2", + icon: '2.png', + isEnabled: false, + }, + { + value: "3", + icon: '2.png', + isEnabled: true, + } + ] + + build() { + NavDestination() { + Column() { + Text(this.msg).fontColor(Color.Brown).fontSize(18) + .width('80%') + .margin(50) + }.width('100%').height('100%') + }.title('NavDestination Title') + .menus(this.menuItems) + .onBackPressed(() => { + return true + }) + .onReady((context: NavDestinationContext) => { + console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0150.ets new file mode 100755 index 0000000000000000000000000000000000000000..753892588bf10b543617db24ef1be64cdadff964 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0150.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0150 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Mini) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170.ets new file mode 100755 index 0000000000000000000000000000000000000000..968a932a86482a60b238883a4a7059b116d7170e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0170 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0200.ets new file mode 100755 index 0000000000000000000000000000000000000000..52095178ca7b18f1b8ff10c5c99f232a0a2e68a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0200.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0200 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .hideBackButton(false) + .titleMode(NavigationTitleMode.Mini) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0210.ets new file mode 100755 index 0000000000000000000000000000000000000000..f397bf5d7f1344b022536c52a9d0d059504e7d21 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0210.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0210 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .hideBackButton(true) + .titleMode(NavigationTitleMode.Mini) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0230.ets new file mode 100755 index 0000000000000000000000000000000000000000..d4111fe9b64bea0f4eac4b0b8161f76006c7255f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0230.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0230 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .hideNavBar(true) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0240.ets new file mode 100755 index 0000000000000000000000000000000000000000..e2450a3b99d012228d2bf7ec66b9f92c78027dc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0240.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0240 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .hideNavBar(true) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0290.ets new file mode 100755 index 0000000000000000000000000000000000000000..9f08eb6162812ec5c1db7fdf9350a4d0535fa920 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0290.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0290 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State _width: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + Button('change_Width').id('interface0290_btn').onClick(() => { + this._width = 300 + }).margin(30).fontSize(16) + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width((this._width == 0) ? '100%' : this._width).height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0310.ets new file mode 100755 index 0000000000000000000000000000000000000000..ecce80cd9ff2598eef25f8abbce9a31507b2162e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0310.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0310 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State _width: number = 300 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Split) + .navBarPosition(NavBarPosition.Start) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width(300).height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0330.ets new file mode 100755 index 0000000000000000000000000000000000000000..be1c2e808fafd602d6b279151ee9ab8337ef1647 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0330.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0330 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State _width: number = 300 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Split) + .navBarWidth(getContext().resourceManager.getNumber($r('app.float.navBarWidth'))) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0340.ets new file mode 100755 index 0000000000000000000000000000000000000000..98e5d5f302c369750a517f0b14010078ed4172dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0340.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0340 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State _width: number = 300 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Split) + .navBarWidth('200vp') + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0360.ets new file mode 100755 index 0000000000000000000000000000000000000000..6b7096bb26f8cd098e196fff27edc5a6092ebc6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0360.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0360 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Split) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0370.ets new file mode 100755 index 0000000000000000000000000000000000000000..60e4a901ca4724d1985d1dcc0c9a027ad7ac6311 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0370.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0370 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380.ets new file mode 100755 index 0000000000000000000000000000000000000000..bd81893883b1e692f316a154989e5208ac826ceb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380.ets @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0380 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + menus: Array = [ + { + value: 'add', + icon: 'Add.png', + }, + { + value: 'app', + icon: 'cat.jpg', + }, + { + value: 'collect', + icon: 'collect.png', + } + ]; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .opacity(0.4) + }.alignItems(HorizontalAlign.Start) + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(NavigationMode.Stack) + .title(this.NavigationTitle) + .menus(this.menus) + .titleMode(NavigationTitleMode.Full) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0420.ets new file mode 100755 index 0000000000000000000000000000000000000000..35ecfde725266030ed54f3226f141c74a9d230be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0420.ets @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0420 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(324) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0430.ets new file mode 100755 index 0000000000000000000000000000000000000000..835266aa42e437aa0b6025be4ed1d0b63c66d551 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0430.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0430 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(450) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .menus(this.NavigationMenus) + .titleMode(NavigationTitleMode.Free) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ]) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0490.ets new file mode 100755 index 0000000000000000000000000000000000000000..835a34e86e62c950b5f975d0fb3483cf84c87e23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0490.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0490 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(450) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .titleMode(NavigationTitleMode.Free) + .backButtonIcon('return.png') + .toolbarConfiguration(this.ToolBarItems) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0510.ets new file mode 100755 index 0000000000000000000000000000000000000000..1b7a6527dfd519c8d8f25025faae14ee4b736004 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0510.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0510 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @State currentIndex: number = 0 + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + }.width(800) + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(450) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .title(this.NavigationTitle) + .titleMode(NavigationTitleMode.Free) + .backButtonIcon('return.png') + .toolbarConfiguration(this.ToolBarItems) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570.ets new file mode 100755 index 0000000000000000000000000000000000000000..47ba36a3a8a1dbc23f006e9ce967d62fbfab4056 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0570 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @State currentIndex: number = 0 + @State naMode: NavigationMode | undefined = undefined; + @State _width: number = 0; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png') + .width(48) + .margin({ left: 48 }) + } + } + + build() { + Column() { + Navigation() { + Button('切换NavigationMode为Auto').id('interface0570_btn1').onClick(() => { + this.naMode = NavigationMode.Auto; + this._width = 300; + }) + Button('切换NavigationMode为Split').id('interface0570_btn2').onClick(() => { + this.naMode = NavigationMode.Split; + }) + Button('切换NavigationMode为Stack').id('interface0570_btn3').onClick(() => { + this.naMode = NavigationMode.Stack; + }) + TextInput({ placeholder: 'search...' }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(450) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .mode(this.naMode) + .title(this.NavigationTitle) + .titleMode(NavigationTitleMode.Free) + .backButtonIcon('return.png') + .toolbarConfiguration(this.ToolBarItems) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + }.width((this._width == 0) ? '100%' : this._width).height('100%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610.ets new file mode 100755 index 0000000000000000000000000000000000000000..0d3e289d99a5df47231397b847faab28d8f13ba1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610.ets @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentNavigationNavigationInterface0610 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + @State currentIndex: number = 0 + @State titleMode: NavigationTitleMode | undefined = undefined; + @State _width: number = 0; + @State changeRes: string = ''; + + @Builder + NavigationTitle() { + Column() { + Text('Title') + .fontColor('#182431') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontColor('#182431') + .fontSize(14) + .lineHeight(19) + .opacity(0.4) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start) + } + + @Builder + NavigationMenus() { + Row() { + Image('Add.png') + .width(24) + .height(24) + Image('Add.png') + .width(24) + .height(24) + .margin({ left: 24 }) + Image('more.png') + .width(24) + .height(24) + .margin({ left: 24 }) + } + } + + @Builder + ToolBarItems() { + Row() { + Image('Add.png') + .width(48) + .margin({ left: 48 }) + Image('more_active.png') + .width(48) + .margin({ left: 48 }) + Image('collect.png').id('interface0610_img') + .width(48) + .margin({ left: 48 }) + Image('Add_active.png') + .width(48) + .margin({ left: 48 }) + } + } + + build() { + Column() { + Navigation() { + TextInput({ placeholder: 'search...', text: this.changeRes }) + .width('90%') + .height(40) + .backgroundColor('#FFFFFF') + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .backgroundColor('#FFFFFF') + .borderRadius(24) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(450) + .width('100%') + .margin({ top: 12, left: '10%' }) + + Button('切换NavigationTitleMode为Free').id('interface0610_btn1').onClick(() => { + this.titleMode = NavigationTitleMode.Free; + }) + } + .title(this.NavigationTitle) + .titleMode(this.titleMode) + .menus(this.NavigationMenus) + .backButtonIcon('return.png') + .toolbarConfiguration([ + { + value: 'add', + icon: 'Add.png', + activeIcon: 'Add_active.png' + }, + { + value: 'app', + icon: 'more.png', + status: ToolbarItemStatus.ACTIVE, + activeIcon: 'more_active.png' + }, + { + value: 'collect', + icon: 'collect.png', + activeIcon: 'collect_active.png' + } + ], { backgroundColor: '#ffeeeeee' }) + .onNavBarStateChange((isVisible: boolean) => { + this.changeRes = 'onNavBarStateChange callback=>'; + }) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + this.changeRes = `onTitleModeChange callback=> titleModel: ${titleModel}`; + }) + }.width((this._width == 0) ? '100%' : this._width).height('90%').backgroundColor('#F1F3F5') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650.ets new file mode 100755 index 0000000000000000000000000000000000000000..18b2ef30312a4b3c04745d655881dae4a06845ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ +@Entry +@Component +struct UIComponentNavigationNavigationInterface0650 { + @State isActiveWLAN: boolean = false + @State isActiveBluetooth: boolean = false + @State changeRes: string = 'NavDestination Test\n'; + @State changeRes2: string = 'NavRouter Test\n'; + + build() { + Navigation() { + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`WLAN`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用WLAN').fontSize(30).padding({ left: 15 }) + } + }.title("WLAN").onHidden(() => { + this.changeRes += '\nWLAN page onHidden callback;'; + }) + .onBackPressed(() => { + this.changeRes += '\nWLAN page onBack, onBackPressed callback;'; + return false; + }) + } + .id('interface0650_nr1') + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveWLAN ? '#ccc' : '#fff') + .borderRadius(20) + .mode(NavRouteMode.PUSH_WITH_RECREATE) + .onStateChange((isActivated: boolean) => { + this.isActiveWLAN = isActivated; + this.changeRes2 += `\nWLAN isActivated=${isActivated}\n`; + }) + + NavRouter() { + Row() { + Row() + .width(30) + .height(30) + .borderRadius(30) + .margin({ left: 3, right: 10 }) + .backgroundColor(Color.Pink) + Text(`蓝牙`) + .fontSize(22) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + .width('90%') + .height(60) + + NavDestination() { + Flex({ direction: FlexDirection.Row }) { + Text('未找到可用蓝牙').fontSize(30).padding({ left: 15 }) + } + }.title("蓝牙").onHidden(() => { + this.changeRes += '\nBlueTooth page onHidden callback;'; + }) + .onBackPressed(() => { + this.changeRes += '\nBlueTooth page onBack, onBackPressed callback;'; + return false; + }) + } + .id('interface0650_nr2') + .margin({ top: 10, bottom: 10 }) + .backgroundColor(this.isActiveBluetooth ? '#ccc' : '#fff') + .borderRadius(20) + .mode(NavRouteMode.REPLACE) + .onStateChange((isActivated: boolean) => { + this.isActiveBluetooth = isActivated + this.changeRes2 += `\nBlueTooth isActivated=${isActivated}\n`; + }) + + Text(this.changeRes) + .fontSize(17) + .fontColor(Color.Blue) + .width('96%') + .margin(20) + .borderWidth(5) + + Text(this.changeRes2) + .fontSize(17) + .fontColor(Color.Brown) + .width('96%') + .margin(20) + .borderWidth(5) + } + .height('90%') + .width('100%') + .title('设置') + .backgroundColor("#F2F3F5") + .titleMode(NavigationTitleMode.Free) + .mode(NavigationMode.Auto) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720.ets new file mode 100755 index 0000000000000000000000000000000000000000..065b0af7d706424d3e14509616a20a1a34c9dbbc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720.ets @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentUISupportColor0720 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State _width: number | undefined = undefined + @State mode: NavigationMode = NavigationMode.Auto + @State themeColor: number = ThemeColorMode.LIGHT; + @State toolBarItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + @Builder + NavigationTitle() { + Column() { + Text('MainTitle') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontSize(20) + .lineHeight(19) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start).width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + WithTheme({ colorMode: this.themeColor }) { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ text: 'search...' }) + .width('90%') + .borderWidth(6) + .borderColor($r('app.color.Black')) + .margin({ top: 8 }) + Button('changeTheme LIGHT') + .id('supportColor0720_btn1') + .margin({ top: 10 }) + .onClick(() => { + this.themeColor = ThemeColorMode.LIGHT; + }) + Button('changeTheme LIGHT&DARK') + .id('supportColor0720_btn2') + .margin({ top: 10 }) + .onClick(() => { + this.themeColor = (this.themeColor == ThemeColorMode.LIGHT) ? ThemeColorMode.DARK : ThemeColorMode.LIGHT; + }) + Button('changeTheme DARK') + .id('supportColor0720_btn3') + .margin({ top: 10 }) + .onClick(() => { + this.themeColor = ThemeColorMode.DARK; + }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .borderRadius(24) + .borderWidth(6) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .menus([{ value: 'menu1', icon: 'Add_active.png' }, { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarWidth(this._width) + .mode(this.mode) + .toolbarConfiguration(this.ToolBarItems()) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .backgroundColor($r('sys.color.background_primary')) + } + } + .height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], + [SafeAreaEdge.TOP, SafeAreaEdge.END, SafeAreaEdge.BOTTOM, SafeAreaEdge.START]) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0730.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0730.ets new file mode 100755 index 0000000000000000000000000000000000000000..02d29c1e543eec175d4846953270ca1e06ca70f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0730.ets @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentUISupportColor0730 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State _width: number | undefined = undefined + @State mode: NavigationMode = NavigationMode.Auto + @State themeColor: number = ThemeColorMode.DARK; + @State toolBarItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + @Builder + NavigationTitle() { + Column() { + Text('MainTitle') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontSize(20) + .lineHeight(19) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start).width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + WithTheme({ colorMode: this.themeColor }) { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ text: 'search...' }) + .width('90%') + .borderWidth(6) + .borderColor($r('app.color.Black')) + .margin({ top: 8 }) + Button('changeTheme LIGHT&DARK') + .id('supportColor0730_btn1') + .margin({ top: 10 }) + .onClick(() => { + this.themeColor = (this.themeColor == ThemeColorMode.LIGHT) ? ThemeColorMode.DARK : ThemeColorMode.LIGHT; + }) + Button('navBarWidth300').id('supportColor0730_btn2').onClick(() => { + this._width = 300; + this.mode = NavigationMode.Split; + }).margin({ top: 10 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .borderRadius(24) + .borderWidth(6) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .menus([{ value: 'menu1', icon: 'Add_active.png' }, { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarWidth(this._width) + .mode(this.mode) + .toolbarConfiguration(this.ToolBarItems()) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .backgroundColor($r('sys.color.background_primary')) + } + } + .height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], + [SafeAreaEdge.TOP, SafeAreaEdge.END, SafeAreaEdge.BOTTOM, SafeAreaEdge.START]) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0740.ets new file mode 100755 index 0000000000000000000000000000000000000000..c6a28e5dfb331421bbae82dfcfd91c09ed822fe2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0740.ets @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.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. + */ + +@Entry +@Component +struct UIComponentUISupportColor0740 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State currentIndex: number = 0 + @State subMsg: string = 'subTitle' + @State titleMode: NavigationTitleMode = NavigationTitleMode.Full + @State hideBackButton: boolean = false; + @State hideToolBar: boolean = false; + @State _width: number | undefined = undefined + @State mode: NavigationMode = NavigationMode.Auto + @State themeColor: number = ThemeColorMode.SYSTEM; + @State toolBarItems: Array = [ + { + value: 'add', + icon: 'Add.png' + }, + { + value: 'app', + icon: 'collect.png' + }, + { + value: 'collect', + icon: 'collect.png' + } + ] + + @Builder + ToolBarItems() { + Row() { + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('more_active.png') + .width(50) + .margin({ left: 35 }) + Image('Add_active.png') + .width(50) + .margin({ left: 35 }) + Image('collect_active.png') + .width(50) + .margin({ left: 35 }) + Image('ccreturn.png') + .width(50) + .margin({ left: 35 }) + }.width('100%').backgroundColor($r('sys.color.background_primary')) + } + + @Builder + NavigationTitle() { + Column() { + Text('MainTitle') + .fontSize(30) + .lineHeight(41) + .fontWeight(700) + Text('subtitle') + .fontSize(20) + .lineHeight(19) + .margin({ top: 2, bottom: 20 }) + }.alignItems(HorizontalAlign.Start).width('100%').backgroundColor($r('sys.color.background_primary')) + } + + build() { + Column() { + WithTheme({ colorMode: ThemeColorMode.SYSTEM }) { + Navigation() { + Image('chris.png')// Set the height to be the same as that of the title bar to better observe the stack effect. + .height(138) + .width('100%') + TextInput({ text: 'search...' }) + .width('90%') + .borderWidth(6) + .borderColor($r('app.color.Black')) + .margin({ top: 8 }) + + List({ space: 12, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('90%') + .height(72) + .borderRadius(24) + .borderWidth(6) + .fontSize(16) + .fontWeight(500) + .textAlign(TextAlign.Center) + } + }, (item: number) => item.toString()) + } + .height(300) + .width('100%') + .margin({ top: 12, left: '10%' }) + } + .menus([{ value: 'menu1', icon: 'Add_active.png' }, { value: 'menu2', icon: 'collect_active.png' }, + { value: 'menu3', icon: 'more_active.png' }]) + .titleMode(this.titleMode) + .backButtonIcon('return.png') + .hideBackButton(this.hideBackButton) + .hideToolBar(this.hideToolBar) + .hideTitleBar(false) + .navBarWidth(this._width) + .mode(this.mode) + .toolbarConfiguration(this.ToolBarItems()) + .onTitleModeChange((titleModel: NavigationTitleMode) => { + console.info('titleMode' + titleModel) + }) + .backgroundColor($r('sys.color.background_primary')) + } + } + .height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], + [SafeAreaEdge.TOP, SafeAreaEdge.END, SafeAreaEdge.BOTTOM, SafeAreaEdge.START]) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 index e58bd507f3ecff51931c351ebcabf6603cd5c40c..daae2feb7ffb8ec2e58469970496377dccecbcb8 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/module.json5 @@ -12,12 +12,30 @@ "installationFree": false, "pages": "$profile:test_pages", "requestPermissions": [ + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS" + }, { "name": "ohos.permission.WRITE_MEDIA" }, { "name": "ohos.permission.READ_MEDIA" }, + { + "name": "ohos.permission.CAPTURE_SCREEN" + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER" + }, { "name":"ohos.permission.UPDATE_CONFIGURATION" }, diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json index cebaca0ee054e26196800861f14cc2ede61640d2..d286d92079ab15434c348f9de3c4314aa5bb763b 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/color.json @@ -63,6 +63,10 @@ { "name": "search_placeholder", "value": "#FFCFA613" + }, + { + "name": "Black", + "value": "#ff000000" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json index 4038f619b6a75b6e28b75700455d382845eeaec6..d0a3d6550b843ff2529dcfd32e7039e8a291a324 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json @@ -11,6 +11,10 @@ { "name": "bbb", "value": "5" + }, + { + "name": "navBarWidth", + "value": "400vp" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json index ce65c09bf1f31a1214be8ab75ed207896afea2d3..cd20c9faae457178a3f53709b31a1f87342a282e 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json @@ -243,6 +243,22 @@ { "name": "20string", "value": "20" + }, + { + "name": "scrollby_negative_10", + "value": "-10" + }, + { + "name": "scrollby_negative_9", + "value": "-9" + }, + { + "name": "scrollby_10", + "value": "10" + }, + { + "name": "scrollby_abc", + "value": "abc" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/return.png b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/return.png new file mode 100755 index 0000000000000000000000000000000000000000..2fbc032dfe6cd8683016e4c144eec93a15229b88 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/return.png differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92cff61b76d701a3fe495c11c73638078..afce38e16abe763fd60b249d0e4724df9934fb57 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1242,6 +1242,9 @@ "testability/pages/UIComponentPopupBoxSpecificationsShadow/UIComponentPopupBoxSpecificationsShadow021", "testability/pages/UIComponentPopupBoxSpecificationsShadow/UIComponentPopupBoxSpecificationsShadow022", "testability/pages/UIComponentPopupBoxSpecificationsShadow/UIComponentPopupBoxSpecificationsShadow083", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0720", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0730", + "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor0740", "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor092", "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor093", "testability/pages/UIComponentUISupportColor/UIComponentUISupportColor094", @@ -1801,6 +1804,57 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0040", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0050", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0070", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0080", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0090", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0100", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0140", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0150", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0170", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0200", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0210", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0230", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0240", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0290", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0310", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0330", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0340", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0360", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0370", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0380", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0420", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0430", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0490", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0510", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0570", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0610", + "testability/pages/UIComponentNavigationNavigationInterface/UIComponentNavigationNavigationInterface0650", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0490", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0510", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0520", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0550", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0560", + "testability/pages/UIComponentNavNavigation/UIComponentNavNavigation0570", + "testability/pages/UIComponentNavNavigationRtl/UIComponentNavNavigationRtlMain", + "testability/pages/UIComponentNavNavigationRtl/Page", + "testability/pages/UIComponentNavNavigationRtl/PageTwo", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0010", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0150", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0220", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0280", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0300", + "testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansionMain", + "testability/pages/UIComponentNavNavigationContentExpansion/UIComponentNavNavigationContentExpansion", + "testability/pages/UIComponentNavNavigationContentExpansion/PageOne", + "testability/pages/UIComponentNavNavigationContentExpansion/PageTwo", + "testability/pages/UIComponentNavNavigationContentExpansion/PageThree", + "testability/pages/UIComponentNavNavigationContentExpansion/PageFour", + "testability/pages/UIComponentNavNavigationNewInstance/PageMain", + "testability/pages/UIComponentNavNavigationCustomZing/PageMain", + "testability/pages/UIComponentNavNavigationCustomZing/NavCustomZing0160", + "testability/pages/UIComponentNavNavigationAction/UIComponentNavNavigationAction0010" ] }