From a3b174f31dfd438aab285e898ff9fd8296cb5fdb Mon Sep 17 00:00:00 2001 From: jinzhao Date: Fri, 8 Aug 2025 16:34:26 +0800 Subject: [PATCH 1/5] add uicompare cases1 Signed-off-by: jinzhao --- .../entry/src/ohosTest/ets/test/List.test.ets | 151 +++++- ...ComponentListAndGridGridScrollbar.test.ets | 164 ++++++ .../UIComponentListAndGridListAlign.test.ets | 442 ++++++++++++++++ ...IComponentListAndGridGridScrollbar0010.ets | 221 ++++++++ ...IComponentListAndGridGridScrollbar0020.ets | 226 +++++++++ ...IComponentListAndGridGridScrollbar0030.ets | 227 +++++++++ .../resources/base/profile/test_pages.json | 470 +++++++++++++++++- 7 files changed, 1895 insertions(+), 6 deletions(-) create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridListAlignTest/UIComponentListAndGridListAlign.test.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0010.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0020.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0030.ets diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/List.test.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/List.test.ets index fe9572ba..ad104a12 100644 --- a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/List.test.ets +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/List.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,29 +13,124 @@ * limitations under the License. */ -import demoTest from './Demo.test'; +import UIComponentListAndGridListCapability + from './UIComponentListAndGridListCapabilityTest/UIComponentListAndGridListCapability.test'; +import UIComponentListAndGridListAnimation + from './UIComponentListAndGridListAnimationTest/UIComponentListAndGridListAnimation.test'; +import UIComponentListAndGridListAlign + from './UIComponentListAndGridListAlignTest/UIComponentListAndGridListAlign.test'; +import UIComponentListAndGridListDisplayedColumns + from './UIComponentListAndGridListDisplayedColumnsTest/UIComponentListAndGridListDisplayedColumns.test'; +import UIComponentListAndGridGridScrollbar + from './UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test'; +import UIComponentListAndGridGridMirror + from './UIComponentListAndGridGridMirrorTest/UIComponentListAndGridGridMirror.test'; +import UIComponentListAndGridGridLayout + from './UIComponentListAndGridGridLayoutTest/UIComponentListAndGridGridLayout.test'; +import UIComponentListAndGridGridInterface + from './UIComponentListAndGridGridInterfaceTest/UIComponentListAndGridGridInterface.test'; +import UIComponentListAndGridGridFadingEdge + from './UIComponentListAndGridGridFadingEdgeTest/UIComponentListAndGridGridFadingEdge.test'; +import UIComponentListAndGridGridDirectionLayout + from './UIComponentListAndGridGridDirectionLayoutTest/UIComponentListAndGridGridDirectionLayout.test'; +import UIComponentListAndGridGridCapability + from './UIComponentListAndGridGridCapabilityTest/UIComponentListAndGridGridCapability.test'; +import UIComponentListAndGridGridDisplayedColumns + from './UIComponentListAndGridGridDisplayedColumnsTest/UIComponentListAndGridGridDisplayedColumns.test'; +import UIComponentGridXommonSmooth + from './UIComponentGridXommonSmoothTest/UIComponentGridXommonSmooth.test'; +import UIComponentGridTabs + from './UIComponentGridTabsTest/UIComponentGridTabs.test'; +import UIComponentGridJiaoDian + from './UIComponentGridJiaoDianTest/UIComponentGridJiaoDian.test'; +import UIComponentGridForEach + from './UIComponentGridForEachTest/UIComponentGridForEach.test'; +import UIComponentGridEventModifier + from './UIComponentGridEventModifierTest/UIComponentGridEventModifier.test'; +import UIComponentGridEvent + from './UIComponentGridEventTest/UIComponentGridEvent.test'; +import UIComponentGridEdgeEffect + from './UIComponentGridEdgeEffectTest/UIComponentGridEdgeEffect.test'; +import UIComponentGridClipComent + from './UIComponentGridClipComentTest/UIComponentGridClipComent.test'; +import UIComponentGridAnimation + from './UIComponentGridAnimationTest/UIComponentGridAnimation.test'; +import UICustomDrawingSafeAreaScene + from './UICustomDrawingSafeAreaSceneTest/UICustomDrawingSafeAreaScene.test'; +import UIUIAppearanceDarkMode + from './UIUIAppearanceDarkModeTest/UIUIAppearanceDarkMode.test'; +import UIComponentPopupBoxSelectMirror + from './UIComponentPopupBoxSelectMirrorTest/UIComponentPopupBoxSelectMirror.test'; +import UIComponentPopupBoxPopupScenarios + from './UIComponentPopupBoxPopupScenariosTest/UIComponentPopupBoxPopupScenarios.test'; +import UIComponentScrollSwiperIgnoreBlank + from './UIComponentScrollSwiperIgnoreBlankTest/UIComponentScrollSwiperIgnoreBlank.test'; import TestCase from './TestCaseTest/TestCase.test'; import UIComponentLayoutStack from './UIComponentLayoutStackTest/UIComponentLayoutStack.test'; +import UIComponentDrawingSafeAreaE + from './UIComponentDrawingSafeAreaETest/UIComponentDrawingSafeAreaE.test'; +import UIComponentPopupBoxModalTransitionKeyboard + from './UIComponentPopupBoxModalTransitionKeyboardTest/UIComponentPopupBoxModalTransitionKeyboard.test'; +import UIComponentPopupBoxModalTransitionHover + from './UIComponentPopupBoxModalTransitionHoverTest/UIComponentPopupBoxModalTransitionHover.test'; +import UIComponentPopupBoxModalTransitionHeightFree + from './UIComponentPopupBoxModalTransitionHeightFreeTest/UIComponentPopupBoxModalTransitionHeightFree.test'; +import ActionEventCommonEventKeyEventDispatch + from './ActionEventCommonEventKeyEventDispatchTest/ActionEventCommonEventKeyEventDispatch.test'; +import ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization + from './ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimizationTest/ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization.test'; +import BackgroundImageCommonPropertySupportSyncLoad + from './BackgroundImageCommonPropertySupportSyncLoadTest/BackgroundImageCommonPropertySupportSyncLoad.test'; +import UIAttributesHoverEffectDoubleStrokeInterface + from './UIAttributesHoverEffectDoubleStrokeInterfaceTest/UIAttributesHoverEffectDoubleStrokeInterface.test'; +import UIAttributesImageEffectSpherical + from './UIAttributesImageEffectSphericalTest/UIAttributesImageEffectSpherical.test'; import UIComponentArcListScrollBarColor from './UIComponentArcListScrollBarColorTest/UIComponentArcListScrollBarColor.test'; +import UIComponentButtonTextPickerDefaultTextStyle + from './UIComponentButtonTextPickerDefaultTextStyleTest/UIComponentButtonTextPickerDefaultTextStyle.test'; import UIComponentInfomationProgressModifierColor from './UIComponentInfomationProgressModifierColorTest/UIComponentInfomationProgressModifierColor.test'; +import UIComponentMediaCalendarPickerDate + from './UIComponentMediaCalendarPickerDateTest/UIComponentMediaCalendarPickerDate.test'; +import UIComponentMediaDatePickerMode from './UIComponentMediaDatePickerModeTest/UIComponentMediaDatePickerMode.test'; import UIComponentMediaImageAnimatorMonitorInvisibleArea from './UIComponentMediaImageAnimatorMonitorInvisibleAreaTest/UIComponentMediaImageAnimatorMonitorInvisibleArea.test'; +import UIComponentMediaImageFillColorReset + from './UIComponentMediaImageFillColorResetTest/UIComponentMediaImageFillColorReset.test'; import UIComponentMediaImagePredownload from './UIComponentMediaImagePredownloadTest/UIComponentMediaImagePredownload.test'; import UIComponentMediaImageReset from './UIComponentMediaImageResetTest/UIComponentMediaImageReset.test'; +import UIComponentMediaImageSupportThumbnails + from './UIComponentMediaImageSupportThumbnailsTest/UIComponentMediaImageSupportThumbnails.test'; import UIComponentMediaImageSvgAnimateTransform from './UIComponentMediaImageSvgAnimateTransformTest/UIComponentMediaImageSvgAnimateTransform.test'; +import UIComponentMediaPatternLockForeground + from './UIComponentMediaPatternLockForegroundTest/UIComponentMediaPatternLockForeground.test'; +import UIComponentMediaTextPickerDisableTSA + from './UIComponentMediaTextPickerDisableTSATest/UIComponentMediaTextPickerDisableTSA.test'; import UIComponentMediaTimePickerEnableCascade from './UIComponentMediaTimePickerEnableCascadeTest/UIComponentMediaTimePickerEnableCascade.test'; import UIComponentMediaTimePickerStartEndTime from './UIComponentMediaTimePickerStartEndTimeTest/UIComponentMediaTimePickerStartEndTime.test'; import UIComponentMediaVideoAI from './UIComponentMediaVideoAITest/UIComponentMediaVideoAI.test'; import UIComponentMediaVideoReset from './UIComponentMediaVideoResetTest/UIComponentMediaVideoReset.test'; +import UIComponentPopUpBoxDoubleStroke + from './UIComponentPopUpBoxDoubleStrokeTest/UIComponentPopUpBoxDoubleStroke.test'; +import UIComponentPopUpBoxEnter from './UIComponentPopUpBoxEnterTest/UIComponentPopUpBoxEnter.test'; +import UIComponentPopUpBoxFollowDialog + from './UIComponentPopUpBoxFollowDialogTest/UIComponentPopUpBoxFollowDialog.test'; +import UIComponentPopUpBoxModalTransitionBindSheetBottomStyle + from './UIComponentPopUpBoxModalTransitionBindSheetBottomStyleTest/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle.test'; +import UIComponentPopUpBoxModalTransitionBindSheetStyle + from './UIComponentPopUpBoxModalTransitionBindSheetStyleTest/UIComponentPopUpBoxModalTransitionBindSheetStyle.test'; import UIComponentScrollClipContent from './UIComponentScrollClipContentTest/UIComponentScrollClipContent.test'; import UIComponentScrollFadingEdge from './UIComponentScrollFadingEdgeTest/UIComponentScrollFadingEdge.test'; import UIComponentScrollPullDown from './UIComponentScrollPullDownTest/UIComponentScrollPullDown.test'; +import UIComponentScrollScrollPage from './UIComponentScrollScrollPageTest/UIComponentScrollScrollPage.test'; +import UIComponentScrollToTop from './UIComponentScrollToTopTest/UIComponentScrollToTop.test'; +import UIComponentSnapshotComponentContent + from './UIComponentSnapshotComponentContentTest/UIComponentSnapshotComponentContent.test'; import UIComponentSpecialComponentsEmbeddedComponentFingerClick from './UIComponentSpecialComponentsEmbeddedComponentFingerClickTest/UIComponentSpecialComponentsEmbeddedComponentFingerClick.test'; import UIComponentSpecialComponentsEmbeddedComponentKey @@ -81,9 +176,7 @@ import UIComponentWaterFlowSections from './UIComponentWaterFlowSectionsTest/UIC import UIRelativeContainerCollaboration from './UIRelativeContainerCollaborationTest/UIRelativeContainerCollaboration.test'; - export default function testsuite() { - // demoTest(); TestCase(); UIComponentLayoutStack(); UIRelativeContainerCollaboration(); @@ -120,7 +213,57 @@ export default function testsuite() { UIComponentScrollPullDown(); UIComponentWaterFlowMirror(); UIComponentWaterFlowSections(); + UIComponentMediaImageSupportThumbnails(); + UIComponentMediaImageFillColorReset(); + UIComponentMediaTextPickerDisableTSA(); + UIComponentMediaCalendarPickerDate(); + UIComponentMediaDatePickerMode(); + UIComponentMediaPatternLockForeground(); UIComponentSpecialComponentsUIContextComponentSnapshot(); UIComponentSpecialComponentsUIContextAddMenuFocus(); + UIComponentSnapshotComponentContent(); + ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization(); + ActionEventCommonEventKeyEventDispatch(); + BackgroundImageCommonPropertySupportSyncLoad(); + UIComponentScrollToTop(); + UIAttributesHoverEffectDoubleStrokeInterface(); + UIAttributesImageEffectSpherical(); + UIComponentPopUpBoxDoubleStroke(); + UIComponentPopUpBoxEnter(); + UIComponentPopUpBoxFollowDialog(); + UIComponentPopUpBoxModalTransitionBindSheetBottomStyle(); + UIComponentPopUpBoxModalTransitionBindSheetStyle(); + UIComponentButtonTextPickerDefaultTextStyle(); + UIComponentScrollScrollPage(); UIComponentTextChipInterface(); + UIComponentPopupBoxModalTransitionHeightFree(); + UIComponentPopupBoxModalTransitionHover(); + UIComponentPopupBoxModalTransitionKeyboard(); + UIComponentDrawingSafeAreaE(); + UIComponentScrollSwiperIgnoreBlank(); + UIComponentPopupBoxPopupScenarios(); + UIComponentPopupBoxSelectMirror(); + UIUIAppearanceDarkMode(); + UICustomDrawingSafeAreaScene(); + UIComponentGridAnimation(); + UIComponentGridClipComent(); + UIComponentGridEdgeEffect(); + UIComponentGridEvent(); + UIComponentGridEventModifier(); + UIComponentGridForEach(); + UIComponentGridJiaoDian(); + UIComponentGridTabs(); + UIComponentGridXommonSmooth(); + UIComponentListAndGridGridDisplayedColumns(); + UIComponentListAndGridGridCapability(); + UIComponentListAndGridGridDirectionLayout(); + UIComponentListAndGridGridFadingEdge(); + UIComponentListAndGridGridInterface(); + UIComponentListAndGridGridLayout(); + UIComponentListAndGridGridMirror(); + UIComponentListAndGridGridScrollbar(); + UIComponentListAndGridListDisplayedColumns(); + UIComponentListAndGridListAlign(); + UIComponentListAndGridListAnimation(); + UIComponentListAndGridListCapability(); } \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets new file mode 100644 index 00000000..81ebab7e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets @@ -0,0 +1,164 @@ +/** + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; +import { BusinessError, commonEventManager } from '@kit.BasicServicesKit'; +import { Driver, ON ,Component, UiWindow } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; + + +let TAG = 'RunTimeTest'; + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +export default function UIComponentListAndGridGridScrollbar() { + describe('UIComponentListAndGridGridScrollbar', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error(`[${TAG}_afterEach]`, `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info(`[${TAG}_afterEach]`, `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + afterAll(() => { + + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0010 + * @tc.desc Test floating scrollbar display in Grid component + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0010', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0010'; + let pageName = "UIComponentListAndGridGridScrollbar0010"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridGridScrollbar/' + pageName); + let driver: Driver = Driver.create(); + let grid: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + let bounds = await grid.getBounds(); + let center = await grid.getBoundsCenter(); + await Utils.sleep(2000); + await driver.mouseMoveTo({x: bounds.right - 5, y: bounds.top + 50}); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0020 + * @tc.desc Test toggling Grid scrollbar to floating display state + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0020', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0020'; + let pageName = "UIComponentListAndGridGridScrollbar0020"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridGridScrollbar/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let grid: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + let bounds = await grid.getBounds(); + await driver.waitForIdle(1000, 2000); + await button.click(); + await Utils.sleep(2000); + await driver.mouseMoveTo({x: bounds.right - 5, y: bounds.top + 50}); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0030 + * @tc.desc Test floating scrollbar during Grid mirroring effect changes + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0030', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0030'; + let pageName = "UIComponentListAndGridGridScrollbar0030"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridGridScrollbar/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let grid: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + let bounds = await grid.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.mouseMoveTo({x: bounds.right - 5, y: bounds.top + 50}); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await button.click(); + await Utils.sleep(2000); + await driver.mouseMoveTo({x: bounds.left + 5, y: bounds.top + 50}); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0040 + * @tc.desc Test externally-bound scrollbar hover display in Grid component + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0040', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_SCROLLBAR_0040'; + let pageName = "UIComponentListAndGridGridScrollbar0040"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridGridScrollbar/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let grid: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + let bounds = await grid.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.mouseMoveTo({x: bounds.right - 5, y: bounds.top + 50}); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridListAlignTest/UIComponentListAndGridListAlign.test.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridListAlignTest/UIComponentListAndGridListAlign.test.ets new file mode 100644 index 00000000..7c2197ca --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridListAlignTest/UIComponentListAndGridListAlign.test.ets @@ -0,0 +1,442 @@ +/** + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium'; +import { BusinessError, commonEventManager } from '@kit.BasicServicesKit'; +import { Driver, ON ,Component, UiWindow } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; + + +let TAG = 'RunTimeTest'; + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +export default function UIComponentListAndGridListAlign() { + describe('UIComponentListAndGridListAlign', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error(`[${TAG}_afterEach]`, `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info(`[${TAG}_afterEach]`, `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + afterAll(() => { + + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0180 + * @tc.desc Test rapid horizontal scrolling in List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0180', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0180'; + let pageName = "UIComponentListAndGridListAlign0180"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0190 + * @tc.desc Test slow horizontal scrolling in List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0190', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0190'; + let pageName = "UIComponentListAndGridListAlign0190"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 1000); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0220 + * @tc.desc Configure edge scroll effects in horizontal List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0220', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0220'; + let pageName = "UIComponentListAndGridListAlign0220"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 5000); + await driver.waitForIdle(2000, 3000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 1000); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0260 + * @tc.desc Test rapid horizontal scrolling in List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0260', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0260'; + let pageName = "UIComponentListAndGridListAlign0260"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0270 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0270 + * @tc.desc Test slow horizontal scrolling in List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0270', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0270'; + let pageName = "UIComponentListAndGridListAlign0270"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0300 + * @tc.desc Configure edge scroll effects in horizontal List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0300', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0300'; + let pageName = "UIComponentListAndGridListAlign0300"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, bounds.left, center.y, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0380 + * @tc.desc Test rapid vertical scrolling in List with center alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0380', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0380'; + let pageName = "UIComponentListAndGridListAlign0380"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0390 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0390 + * @tc.desc Test slow vertical scrolling in List with center alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0390', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0390'; + let pageName = "UIComponentListAndGridListAlign0390"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 1000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0430 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0430 + * @tc.desc Configure edge scroll effects in vertical List with center alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0430', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0430'; + let pageName = "UIComponentListAndGridListAlign0430"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 1000); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0470 + * @tc.desc Test rapid vertical scrolling in List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0470', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0470'; + let pageName = "UIComponentListAndGridListAlign0470"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0480 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0480 + * @tc.desc Test slow vertical scrolling in List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0480', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0480'; + let pageName = "UIComponentListAndGridListAlign0480"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 1000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0520 + * @tc.desc Configure edge scroll effects in vertical List with end alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0520', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0520'; + let pageName = "UIComponentListAndGridListAlign0520"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 1000); + await driver.waitForIdle(1000, 2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0560 + * @tc.desc Test rapid vertical scrolling in List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0560', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0560'; + let pageName = "UIComponentListAndGridListAlign0560"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0570 + * @tc.desc Test slow vertical scrolling in List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0570', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0570'; + let pageName = "UIComponentListAndGridListAlign0570"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0610 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0610 + * @tc.desc Configure edge scroll effects in vertical List with start alignment + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0610', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_ALIGN_0610'; + let pageName = "UIComponentListAndGridListAlign0610"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentListAndGridListAlign/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + let list: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + let center = await list.getBoundsCenter(); + let bounds = await list.getBounds(); + await driver.waitForIdle(1000, 2000); + await driver.swipe(center.x, center.y, center.x, bounds.top, 5000); + await driver.waitForIdle(2000, 3000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0010.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0010.ets new file mode 100644 index 00000000..657f7889 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0010.ets @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridGridScrollbar0010 { + @State name: string = 'UIComponentListAndGridGridScrollbar0010'; + @State message: string = this.name; + @State numbers: number[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + columnCount: number = 5; + itemCount: number = 0; + rowCount: number = 0; + itemHeight: number = 80; + rowsGap: number = 10; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 0;i < 30; i++) { + this.itemCount++; + this.numbers.push(i); + } + this.rowCount = Math.ceil(this.itemCount / this.columnCount); + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Pink) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.scroller.scrollPage({ + next: true, + animation: true + }); + }) + + Grid(this.scroller) { + ForEach(this.numbers, (day: number) => { + GridItem() { + Text(day.toString()) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.itemHeight) + .textAlign(TextAlign.Center) + } + }, (day: number) => day.toString()) + } + .id(this.name + '_03') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(this.rowsGap) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Auto) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(Color.Grey) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragStart"); + this.message += `\n Grid onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("Grid onItemDragEnter"); + this.message += `\n Grid onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragLeave"); + this.message += `\n Grid onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("Grid onItemDragMove"); + this.message += `\n Grid onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("Grid onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n Grid onItemDrop, event: ${event.toString()}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info('Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()); + this.message += `\n Grid onScrollBarUpdate, index: ${index.toString()}, offset: ${offset.toString()}`; + return { + totalOffset: (index / this.columnCount) * (this.itemHeight + this.rowsGap) - offset, + totalLength: this.itemHeight * this.rowCount + this.rowsGap * (this.rowCount - 1) + }; + }) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n Grid onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("Grid onWillScroll"); + this.message += `\n Grid onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n Grid onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("Grid onScrollStart"); + this.message += `\n Grid onScrollStart`; + }) + .onScrollStop(() => { + console.info("Grid onScrollStop"); + this.message += `\n Grid onScrollStop`; + }) + .onReachStart(() => { + console.info("Grid onReachStart"); + this.message += `\n Grid onReachStart`; + }) + .onReachEnd(() => { + console.info("Grid onReachEnd"); + this.message += `\n Grid onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_04') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .backgroundColor(Color.Green) + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0020.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0020.ets new file mode 100644 index 00000000..4f77eb02 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0020.ets @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridGridScrollbar0020 { + @State name: string = 'UIComponentListAndGridGridScrollbar0020'; + @State message: string = this.name; + @State numbers: number[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State barStateValue: BarState = BarState.On; + columnCount: number = 5; + itemCount: number = 0; + rowCount: number = 0; + itemHeight: number = 80; + rowsGap: number = 10; + switched: boolean = false; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 0;i < 30; i++) { + this.itemCount++; + this.numbers.push(i); + } + this.rowCount = Math.ceil(this.itemCount / this.columnCount); + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Pink) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('switch barState') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + if (this.switched) { + this.barStateValue = BarState.On; + this.switched = false; + } else { + this.barStateValue = BarState.Auto; + this.switched = true; + } + }) + + Grid(this.scroller) { + ForEach(this.numbers, (day: number) => { + GridItem() { + Text(day.toString()) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.itemHeight) + .textAlign(TextAlign.Center) + } + }, (day: number) => day.toString()) + } + .id(this.name + '_03') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(this.rowsGap) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(this.barStateValue) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(Color.Grey) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragStart"); + this.message += `\n Grid onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("Grid onItemDragEnter"); + this.message += `\n Grid onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragLeave"); + this.message += `\n Grid onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("Grid onItemDragMove"); + this.message += `\n Grid onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("Grid onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n Grid onItemDrop, event: ${event.toString()}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info('Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()); + this.message += `\n Grid onScrollBarUpdate, index: ${index.toString()}, offset: ${offset.toString()}`; + return { + totalOffset: (index / this.columnCount) * (this.itemHeight + this.rowsGap) - offset, + totalLength: this.itemHeight * this.rowCount + this.rowsGap * (this.rowCount - 1) + }; + }) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n Grid onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("Grid onWillScroll"); + this.message += `\n Grid onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n Grid onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("Grid onScrollStart"); + this.message += `\n Grid onScrollStart`; + }) + .onScrollStop(() => { + console.info("Grid onScrollStop"); + this.message += `\n Grid onScrollStop`; + }) + .onReachStart(() => { + console.info("Grid onReachStart"); + this.message += `\n Grid onReachStart`; + }) + .onReachEnd(() => { + console.info("Grid onReachEnd"); + this.message += `\n Grid onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_04') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .backgroundColor(Color.Green) + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0030.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0030.ets new file mode 100644 index 00000000..48bad7cf --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0030.ets @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridGridScrollbar0030 { + @State name: string = 'UIComponentListAndGridGridScrollbar0030'; + @State message: string = this.name; + @State numbers: number[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + columnCount: number = 5; + itemCount: number = 0; + rowCount: number = 0; + itemHeight: number = 80; + rowsGap: number = 10; + @State directionValue: Direction = Direction.Ltr; + switched: boolean = false; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 0;i < 30; i++) { + this.itemCount++; + this.numbers.push(i); + } + this.rowCount = Math.ceil(this.itemCount / this.columnCount); + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Pink) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('switch direction') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + if (this.switched) { + this.directionValue = Direction.Ltr; + this.switched = false + } else { + this.directionValue = Direction.Rtl; + this.switched = true + } + }) + + Grid(this.scroller) { + ForEach(this.numbers, (day: number) => { + GridItem() { + Text(day.toString()) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.itemHeight) + .textAlign(TextAlign.Center) + } + }, (day: number) => day.toString()) + } + .id(this.name + '_03') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(this.rowsGap) + .friction(0.6) + .direction(this.directionValue) + .enableScrollInteraction(true) + .supportAnimation(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Auto) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(Color.Grey) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragStart"); + this.message += `\n Grid onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("Grid onItemDragEnter"); + this.message += `\n Grid onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragLeave"); + this.message += `\n Grid onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("Grid onItemDragMove"); + this.message += `\n Grid onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("Grid onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n Grid onItemDrop, event: ${event.toString()}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info('Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()); + this.message += `\n Grid onScrollBarUpdate, index: ${index.toString()}, offset: ${offset.toString()}`; + return { + totalOffset: (index / this.columnCount) * (this.itemHeight + this.rowsGap) - offset, + totalLength: this.itemHeight * this.rowCount + this.rowsGap * (this.rowCount - 1) + }; + }) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n Grid onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("Grid onWillScroll"); + this.message += `\n Grid onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n Grid onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("Grid onScrollStart"); + this.message += `\n Grid onScrollStart`; + }) + .onScrollStop(() => { + console.info("Grid onScrollStop"); + this.message += `\n Grid onScrollStop`; + }) + .onReachStart(() => { + console.info("Grid onReachStart"); + this.message += `\n Grid onReachStart`; + }) + .onReachEnd(() => { + console.info("Grid onReachEnd"); + this.message += `\n Grid onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_04') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .backgroundColor(Color.Green) + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/resources/base/profile/test_pages.json b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/resources/base/profile/test_pages.json index ccc2ff05..0e8d11dc 100644 --- a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -177,11 +177,94 @@ "testability/pages/UIComponentScrollPullDown/UIComponentScrollPullDown0250", "testability/pages/UIComponentWaterFlowMirror/UIComponentWaterFlowMirror0010_014", "testability/pages/UIComponentWaterFlowSections/UIComponentWaterFlowSections0020", + "testability/pages/UIComponentMediaImageSupportThumbnails/UIComponentMediaImageSupportThumbnails0013", + "testability/pages/UIComponentMediaImageSupportThumbnails/UIComponentMediaImageSupportThumbnails0014", + "testability/pages/UIComponentMediaImageSupportThumbnails/UIComponentMediaImageSupportThumbnails0016", + "testability/pages/UIComponentMediaImageFillColorReset/UIComponentMediaImageFillColorReset0011", + "testability/pages/UIComponentMediaTextPickerDisableTSA/UIComponentMediaTextPickerDisableTSA0014", + "testability/pages/UIComponentMediaTextPickerDisableTSA/UIComponentMediaTextPickerDisableTSA0027", + "testability/pages/UIComponentMediaCalendarPickerDate/UIComponentMediaCalendarPickerDate0010", + "testability/pages/UIComponentMediaDatePickerMode/UIComponentMediaDatePickerMode0010", + "testability/pages/UIComponentMediaPatternLockForeground/UIComponentMediaPatternLockForeground0011", + "testability/pages/UIComponentMediaPatternLockForeground/UIComponentMediaPatternLockForeground0014", + "testability/pages/UIComponentMediaPatternLockForeground/UIComponentMediaPatternLockForeground0019", + "testability/pages/UIComponentMediaPatternLockForeground/UIComponentMediaPatternLockForeground0021", "testability/pages/UIComponentSpecialComponentsUIContextComponentSnapshot/UIComponentSpecialComponentsUIContextComponentSnapshot0180", "testability/pages/UIComponentSpecialComponentsUIContextComponentSnapshot/UIComponentSpecialComponentsUIContextComponentSnapshot0340", "testability/pages/UIComponentSpecialComponentsUIContextComponentSnapshot/UIComponentSpecialComponentsUIContextComponentSnapshot0360", "testability/pages/UIComponentSpecialComponentsUIContextComponentSnapshot/UIComponentSpecialComponentsUIContextComponentSnapshot0460", "testability/pages/UIComponentSpecialComponentsUIContextAddMenuFocus/UIComponentSpecialComponentsUIContextAddMenuFocus0210", + "testability/pages/UIComponentSnapshotComponentContent/UIComponentSnapshotComponentContent0040", + "testability/pages/UIComponentSnapshotComponentContent/UIComponentSnapshotComponentContent0430", + "testability/pages/UIComponentSnapshotComponentContent/UIComponentSnapshotComponentContent0490", + "testability/pages/UIComponentSnapshotComponentContent/UIComponentSnapshotComponentContent0540", + "testability/pages/UIComponentSnapshotComponentContent/UIComponentSnapshotComponentContent0640", + "testability/pages/ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization/ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization0070", + "testability/pages/ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization/ArkUIComponentFunctionSpecialComponentsDialogCustomSelectInputMethodOptimization0210", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0040", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0050", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0060", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0180", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0190", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0200", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0250", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0260", + "testability/pages/ActionEventCommonEventKeyEventDispatch/ActionEventCommonEventKeyEventDispatch0270", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad019", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad020", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad021", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad022", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad023", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad024", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad025", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad026", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad027", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad028", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad029", + "testability/pages/BackgroundImageCommonPropertySupportSyncLoad/BackgroundImageCommonPropertySupportSyncLoad030", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0040", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0050", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0060", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0070", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0120", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0130", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0140", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0150", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0220", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0230", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0240", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0250", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0290", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0300", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0310", + "testability/pages/UIComponentScrollToTop/UIComponentScrollToTop0320", + "testability/pages/UIAttributesHoverEffectDoubleStrokeInterface/UIAttributesHoverEffectDoubleStrokeInterface0270", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0010", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0020", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0030", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0040", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0050", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0060", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0070", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0080", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0090", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0100", + "testability/pages/UIAttributesImageEffectSpherical/UIAttributesImageEffectSpherical0110", + "testability/pages/UIComponentPopUpBoxDoubleStroke/UIComponentPopUpBoxDoubleStroke0010", + "testability/pages/UIComponentPopUpBoxDoubleStroke/UIComponentPopUpBoxDoubleStroke0150", + "testability/pages/UIComponentPopUpBoxEnter/UIComponentPopUpBoxEnter0010", + "testability/pages/UIComponentPopUpBoxEnter/UIComponentPopUpBoxEnter0410", + "testability/pages/UIComponentPopUpBoxFollowDialog/UIComponentPopUpBoxFollowDialog0010", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle0020", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle0030", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle0040", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle/UIComponentPopUpBoxModalTransitionBindSheetBottomStyle0050", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetStyle/UIComponentPopUpBoxModalTransitionBindSheetStyle0030", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetStyle/UIComponentPopUpBoxModalTransitionBindSheetStyle0070", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetStyle/UIComponentPopUpBoxModalTransitionBindSheetStyle0140", + "testability/pages/UIComponentPopUpBoxModalTransitionBindSheetStyle/UIComponentPopUpBoxModalTransitionBindSheetStyle0150", + "testability/pages/UIComponentButtonTextPickerDefaultTextStyle/UIComponentButtonTextPickerDefaultTextStyle0010", + "testability/pages/UIComponentScrollScrollPage/UIComponentScrollScrollPage0130", "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0010", "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0020", "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0030", @@ -225,6 +308,389 @@ "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0410", "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0420", "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0430", - "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0440" + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0440", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0450", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0460", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0470", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0480", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0490", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0500", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0510", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0520", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0530", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0540", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0550", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0560", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0570", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0580", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0590", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0600", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0610", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0620", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0630", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0640", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0650", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0660", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0670", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0680", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0690", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0700", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0710", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0720", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0730", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0740", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0750", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0760", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0770", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0780", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0790", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0800", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0810", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0820", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0830", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0840", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0850", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0860", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0870", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0880", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0890", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0900", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0910", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0920", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0930", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0950", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0960", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0970", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0980", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface0990", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1000", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1010", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1020", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1030", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1040", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1060", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1070", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1080", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1090", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1100", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1110", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1120", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1130", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1140", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1160", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1170", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1180", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1190", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1200", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1210", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1220", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1230", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1240", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1260", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1270", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1280", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1290", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1300", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1310", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1320", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1330", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1340", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1350", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1360", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1370", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1380", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1390", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1400", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1410", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1420", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1430", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1440", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1450", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1460", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1470", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1490", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1500", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1510", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1520", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1530", + "testability/pages/UIComponentTextChipInterface/UIComponentTextChipInterface1540", + "testability/pages/UIComponentPopupBoxModalTransitionHeightFree/UIComponentPopupBoxModalTransitionHeightFree0020", + "testability/pages/UIComponentPopupBoxModalTransitionHeightFree/UIComponentPopupBoxModalTransitionHeightFree0030", + "testability/pages/UIComponentPopupBoxModalTransitionHeightFree/UIComponentPopupBoxModalTransitionHeightFree0040", + "testability/pages/UIComponentPopupBoxModalTransitionHover/UIComponentPopupBoxModalTransitionHover0020", + "testability/pages/UIComponentPopupBoxModalTransitionHover/UIComponentPopupBoxModalTransitionHover0030", + "testability/pages/UIComponentPopupBoxModalTransitionHover/UIComponentPopupBoxModalTransitionHover0040", + "testability/pages/UIComponentPopupBoxModalTransitionHover/UIComponentPopupBoxModalTransitionHover0050", + "testability/pages/UIComponentPopupBoxModalTransitionHover/UIComponentPopupBoxModalTransitionHover0060", + "testability/pages/UIComponentPopupBoxModalTransitionKeyboard/UIComponentPopupBoxModalTransitionKeyboard0010", + "testability/pages/UIComponentPopupBoxModalTransitionKeyboard/UIComponentPopupBoxModalTransitionKeyboard0040", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0010", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0020", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0030", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0040", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0050", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0060", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0070", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0080", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0090", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0130", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0140", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0150", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0160", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0170", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0180", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0190", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0200", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0220", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0230", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0240", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0250", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0260", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0270", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0280", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0290", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0300", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0310", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0320", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0330", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0340", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0350", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0360", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0370", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0380", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0390", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0400", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0410", + "testability/pages/UIComponentDrawingSafeAreaE/UIComponentDrawingSafeAreaE0420", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0010", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0020", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0030", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0040", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0050", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0060", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0070", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0080", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0090", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0100", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0110", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0120", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0130", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0140", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0150", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0160", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0170", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0180", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0190", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0200", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0210", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0220", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0230", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0240", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0250", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0260", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0270", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0280", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0290", + "testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0300", + "testability/pages/UIComponentPopupBoxPopupScenarios/UIComponentPopupBoxPopupScenarios0010", + "testability/pages/UIComponentPopupBoxSelectMirror/UIComponentPopupBoxSelectMirror0020", + "testability/pages/UIComponentPopupBoxSelectMirror/UIComponentPopupBoxSelectMirror0030", + "testability/pages/UIComponentPopupBoxSelectMirror/UIComponentPopupBoxSelectMirror0040", + "testability/pages/UIComponentPopupBoxSelectMirror/UIComponentPopupBoxSelectMirror0050", + "testability/pages/UIUIAppearanceDarkMode/UIUIAppearanceDarkMode0020", + "testability/pages/UIUIAppearanceDarkMode/UIUIAppearanceDarkMode0030", + "testability/pages/UIUIAppearanceDarkMode/UIUIAppearanceDarkMode0040", + "testability/pages/UIUIAppearanceDarkMode/UIUIAppearanceDarkMode0050", + "testability/pages/UIUIAppearanceDarkMode/UIUIAppearanceDarkMode0060", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0330", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0520", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0530", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0540", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0550", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0560", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0570", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0580", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0970_pageA", + "testability/pages/UICustomDrawingSafeAreaScene/UICustomDrawingSafeAreaScene0970_pageB", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0040", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0050", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0110", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0120", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0130", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0140", + "testability/pages/UIComponentGridAnimation/UIComponentGridAnimation0150", + "testability/pages/UIComponentGridClipComent/UIComponentGridClipComent0010", + "testability/pages/UIComponentGridClipComent/UIComponentGridClipComent0240", + "testability/pages/UIComponentGridEdgeEffect/UIComponentGridEdgeEffect0110", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0010", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0020", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0030", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0040", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0090", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0100", + "testability/pages/UIComponentGridEvent/UIComponentGridEvent0110", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0010", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0020", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0030", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0040", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0050", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0060", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0070", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0080", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0090", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0100", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0110", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0120", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0130", + "testability/pages/UIComponentGridEventModifier/UIComponentGridEventModifier0140", + "testability/pages/UIComponentGridForEach/UIComponentGridForEach0010_679", + "testability/pages/UIComponentGridForEach/UIComponentGridForEach0020_681", + "testability/pages/UIComponentGridForEach/UIComponentGridForEach0030_403", + "testability/pages/UIComponentGridForEach/UIComponentGridForEach0040_091", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0010", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0020", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0050", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0060", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0070", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0080", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0090", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0100", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0110", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0120", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0130", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0140", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0150", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0160", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0170", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0180", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0190", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0200", + "testability/pages/UIComponentGridJiaoDian/UIComponentGridJiaoDian0210", + "testability/pages/UIComponentGridTabs/UIComponentGridTabs0010", + "testability/pages/UIComponentGridXommonSmooth/UIComponentGridXommonSmooth0280", + "testability/pages/UIComponentGridXommonSmooth/UIComponentGridXommonSmooth0310", + "testability/pages/UIComponentGridXommonSmooth/UIComponentGridXommonSmooth0320", + "testability/pages/UIComponentGridXommonSmooth/UIComponentGridXommonSmooth0340", + "testability/pages/UIComponentListAndGridGridDisplayedColumns/UIComponentListAndGridGridDisplayedColumns0150_347", + "testability/pages/UIComponentListAndGridGridDisplayedColumns/UIComponentListAndGridGridDisplayedColumns0290_526", + "testability/pages/UIComponentListAndGridGridCapability/UIComponentListAndGridGridCapability0240_582", + "testability/pages/UIComponentListAndGridGridDirectionLayout/UIComponentListAndGridGridDirectionLayout0040_392", + "testability/pages/UIComponentListAndGridGridDirectionLayout/UIComponentListAndGridGridDirectionLayout0050_392", + "testability/pages/UIComponentListAndGridGridDirectionLayout/UIComponentListAndGridGridDirectionLayout0060_279", + "testability/pages/UIComponentListAndGridGridDirectionLayout/UIComponentListAndGridGridDirectionLayout0080_804", + "testability/pages/UIComponentListAndGridGridDirectionLayout/UIComponentListAndGridGridDirectionLayout0090_199", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0030", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0040", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0060", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0070", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0080", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0090", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0100", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0110", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0120", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0130", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0150", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0160", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0170", + "testability/pages/UIComponentListAndGridGridFadingEdge/UIComponentListAndGridGridFadingEdge0180", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0040_950", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0050_157", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0060_056", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0070_428", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0080_641", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0090_099", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0290_148", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0300_519", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0310_394", + "testability/pages/UIComponentListAndGridGridInterface/UIComponentListAndGridGridInterface0320_627", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0020_965", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0030_208", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0130_500", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0140_148", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0150_305", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0160_632", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0170_142", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0170_193", + "testability/pages/UIComponentListAndGridGridLayout/UIComponentListAndGridGridLayout0550_597", + "testability/pages/UIComponentListAndGridGridMirror/UIComponentListAndGridGridMirror0510", + "testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0010", + "testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0020", + "testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0030", + "testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0040", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0010", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0020", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0030", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0050", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0060", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0070", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0080", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0090", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0110", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0120", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0140", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0150", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0160", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0170", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0180", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0190", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0200", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0230", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0240", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0250", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0260", + "testability/pages/UIComponentListAndGridListDisplayedColumns/UIComponentListAndGridListDisplayedColumns0300", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0180", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0190", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0220", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0260", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0270", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0300", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0380", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0390", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0430", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0470", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0480", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0520", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0560", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0570", + "testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0610", + "testability/pages/UIComponentListAndGridListAnimation/UIComponentListAndGridListAnimation0130", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0190", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0200", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0230", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0240", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0270", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0280", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0310", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0320", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0350", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0360", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0400", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0430", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0440", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0470", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0480", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0510", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0520", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0550", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0560", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0590", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0600", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0630", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0640", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0670", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0680", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0710", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0720", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0750", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0760", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0790", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0800", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0820", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0840", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0870", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability0910", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability1100", + "testability/pages/UIComponentListAndGridListCapability/UIComponentListAndGridListCapability1130" ] -} +} \ No newline at end of file -- Gitee From 831d98a2f4c02f59e38c735acab306a0407e52f8 Mon Sep 17 00:00:00 2001 From: jinzhao Date: Fri, 8 Aug 2025 16:35:58 +0800 Subject: [PATCH 2/5] add uicompare cases2 Signed-off-by: jinzhao --- ...IComponentListAndGridGridScrollbar0040.ets | 238 ++++++++++++++++ .../UIComponentListAndGridListAlign0180.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0190.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0220.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0260.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0270.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0300.ets | 258 ++++++++++++++++++ 7 files changed, 1786 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0040.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0180.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0190.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0220.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0260.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0270.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0300.ets diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0040.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0040.ets new file mode 100644 index 00000000..4063c57b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridScrollbar/UIComponentListAndGridGridScrollbar0040.ets @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridGridScrollbar0040 { + @State name: string = 'UIComponentListAndGridGridScrollbar0040'; + @State message: string = this.name; + @State numbers: number[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + columnCount: number = 5; + itemCount: number = 0; + rowCount: number = 0; + itemHeight: number = 80; + rowsGap: number = 10; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 0;i < 30; i++) { + this.itemCount++; + this.numbers.push(i); + } + this.rowCount = Math.ceil(this.itemCount / this.columnCount); + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column() { + Text(this.message) + .fontSize(20) + .fontColor(Color.Pink) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.scroller.scrollPage({ + next: true, + animation: true + }); + }) + + Stack({ alignContent: Alignment.End }) { + + Grid(this.scroller) { + ForEach(this.numbers, (day: number) => { + GridItem() { + Text(day.toString()) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.itemHeight) + .textAlign(TextAlign.Center) + } + }, (day: number) => day.toString()) + } + .id(this.name + '_03') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(this.rowsGap) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .width('100%') + .backgroundColor(Color.Grey) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragStart"); + this.message += `\n Grid onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("Grid onItemDragEnter"); + this.message += `\n Grid onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("Grid onItemDragLeave"); + this.message += `\n Grid onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("Grid onItemDragMove"); + this.message += `\n Grid onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("Grid onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n Grid onItemDrop, event: ${event.toString()}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info('Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()); + this.message += `\n Grid onScrollBarUpdate, index: ${index.toString()}, offset: ${offset.toString()}`; + return { + totalOffset: (index / this.columnCount) * (this.itemHeight + this.rowsGap) - offset, + totalLength: this.itemHeight * this.rowCount + this.rowsGap * (this.rowCount - 1) + }; + }) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n Grid onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("Grid onWillScroll"); + this.message += `\n Grid onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n Grid onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("Grid onScrollFrameBegin"); + this.message += `\n Grid onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("Grid onScrollStart"); + this.message += `\n Grid onScrollStart`; + }) + .onScrollStop(() => { + console.info("Grid onScrollStop"); + this.message += `\n Grid onScrollStop`; + }) + .onReachStart(() => { + console.info("Grid onReachStart"); + this.message += `\n Grid onReachStart`; + }) + .onReachEnd(() => { + console.info("Grid onReachEnd"); + this.message += `\n Grid onReachEnd`; + }) + + ScrollBar({ + scroller: this.scroller, + direction: ScrollBarDirection.Vertical, + state: BarState.Auto + }) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + .width(20) + .backgroundColor('#ededed') + + } + .width('90%') + .height(300) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontStyle(FontStyle.Normal) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_04') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .backgroundColor(Color.Green) + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0180.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0180.ets new file mode 100644 index 00000000..555247c9 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0180.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0180 { + @State name: string = 'UIComponentListAndGridListAlign0180'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0190.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0190.ets new file mode 100644 index 00000000..8991729d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0190.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0190 { + @State name: string = 'UIComponentListAndGridListAlign0190'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0220.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0220.ets new file mode 100644 index 00000000..b2bb3fef --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0220.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0220 { + @State name: string = 'UIComponentListAndGridListAlign0220'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 10; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0260.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0260.ets new file mode 100644 index 00000000..c6494b33 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0260.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0260 { + @State name: string = 'UIComponentListAndGridListAlign0260'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0270.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0270.ets new file mode 100644 index 00000000..0b3399ed --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0270.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0270 { + @State name: string = 'UIComponentListAndGridListAlign0270'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0300.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0300.ets new file mode 100644 index 00000000..0ec6a51b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0300.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0300 { + @State name: string = 'UIComponentListAndGridListAlign0300'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Horizontal; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 10; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(100) + .height(200) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 300 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} -- Gitee From bdcb8b860a633ef5cca9cf54f14188ad541f4d04 Mon Sep 17 00:00:00 2001 From: jinzhao Date: Fri, 8 Aug 2025 16:36:09 +0800 Subject: [PATCH 3/5] add uicompare cases2 Signed-off-by: jinzhao --- .../UIComponentListAndGridListAlign0380.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0390.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0430.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0470.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0480.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0520.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0610.ets | 258 ++++++++++++++++++ 7 files changed, 1806 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0380.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0390.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0430.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0470.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0480.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0520.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0610.ets diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0380.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0380.ets new file mode 100644 index 00000000..0121c224 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0380.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0380 { + @State name: string = 'UIComponentListAndGridListAlign0380'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.CENTER; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0390.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0390.ets new file mode 100644 index 00000000..b940579c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0390.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0390 { + @State name: string = 'UIComponentListAndGridListAlign0390'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.CENTER; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0430.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0430.ets new file mode 100644 index 00000000..a0fcc328 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0430.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0430 { + @State name: string = 'UIComponentListAndGridListAlign0430'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.CENTER; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 10; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0470.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0470.ets new file mode 100644 index 00000000..66702c2d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0470.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0470 { + @State name: string = 'UIComponentListAndGridListAlign0470'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0480.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0480.ets new file mode 100644 index 00000000..8fd1e2c6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0480.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0480 { + @State name: string = 'UIComponentListAndGridListAlign0480'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0520.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0520.ets new file mode 100644 index 00000000..fd11e433 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0520.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0520 { + @State name: string = 'UIComponentListAndGridListAlign0520'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.END; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 10; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0610.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0610.ets new file mode 100644 index 00000000..0a1dc5cb --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0610.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0610 { + @State name: string = 'UIComponentListAndGridListAlign0610'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 10; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} -- Gitee From e02fe54621d3624b10e8bcc89c6d3b12d4751923 Mon Sep 17 00:00:00 2001 From: jinzhao Date: Fri, 8 Aug 2025 16:36:59 +0800 Subject: [PATCH 4/5] add uicompare cases3 Signed-off-by: jinzhao --- .../UIComponentListAndGridListAlign0560.ets | 258 ++++++++++++++++++ .../UIComponentListAndGridListAlign0570.ets | 258 ++++++++++++++++++ 2 files changed, 516 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0560.ets create mode 100644 sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0570.ets diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0560.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0560.ets new file mode 100644 index 00000000..30825448 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0560.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0560 { + @State name: string = 'UIComponentListAndGridListAlign0560'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0570.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0570.ets new file mode 100644 index 00000000..531535a4 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListAlign/UIComponentListAndGridListAlign0570.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentListAndGridListAlign0570 { + @State name: string = 'UIComponentListAndGridListAlign0570'; + @State message: string = this.name; + + @State numbers: number[] = []; + @State text: string = 'drag'; + @State gutterValue: Dimension = 10; + @State listDirection: Axis = Axis.Vertical; + @State ScrollSnapAlignValue: ScrollSnapAlign = ScrollSnapAlign.START; + listScroller: ListScroller = new ListScroller(); + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .width(40) + .height(80) + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + } + + changeIndex(index1: number, index2: number) { + let temp: number; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.numbers.push(i); + } + } + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .fontStyle(FontStyle.Italic) + .textAlign(TextAlign.Center) + .width('90%') + .height(100) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Button('next page') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontWeight(FontWeight.Bold) + .margin(10) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .onClick(() => { + this.listScroller.scrollPage({ + next: true, + animation: true + }); + }) + + List({ + initialIndex: 0, + space: 20, + scroller: this.listScroller + }) { + ForEach(this.numbers, (item: number) => { + ListItem() { + Text(item.toString()) + .width('100%') + .height('100%') + .backgroundColor(Color.White) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + } + .width(200) + .height(100) + }, (item: number) => item.toString()) + } + .alignListItem(ListItemAlign.Start) + .scrollSnapAlign(this.ScrollSnapAlignValue) + .id(this.name + '_02') + .backToTop(true) + .friction(0.6) + .backgroundColor(Color.Grey) + .width('90%') + .height(300) + .enableScrollInteraction(true) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Red) + .scrollBarWidth(4) + .listDirection(this.listDirection) + .lanes( + { + minLength: 200, + maxLength: 200 + }, + this.gutterValue + ) + .margin({ + top: 10, + bottom: 10, + left: 5, + right: 5 + }) + .onItemMove((from: number, to: number) =>{ + console.info("List onItemMove"); + this.message += `\n List onItemMove, from: ${from.toString()}, to: ${to.toString()}`; + return true; + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragStart"); + this.message += `\n List onItemDragStart, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + this.text = this.numbers[itemIndex].toString(); + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.info("List onItemDragEnter"); + this.message += `\n List onItemDragEnter, event: ${JSON.stringify(event)}`; + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.info("List onItemDragLeave"); + this.message += `\n List onItemDragLeave, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}`; + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.info("List onItemDragMove"); + this.message += `\n List onItemDragMove, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}`; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.info("List onItemDrop"); + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.message += `\n List onItemDrop, event: ${JSON.stringify(event)}, itemIndex: ${itemIndex.toString()}, insertIndex: ${insertIndex.toString()}, isSuccess: ${isSuccess}`; + }) + .onScrollVisibleContentChange((start: VisibleListContentInfo, end: VisibleListContentInfo) => { + console.info("List onScrollVisibleContentChange"); + this.message += `\n List onScrollVisibleContentChange, start: ${JSON.stringify(start)}, end: ${JSON.stringify(end)}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollIndex((first: number, last: number) => { + console.info("List onScrollIndex"); + console.info(first.toString()); + console.info(last.toString()); + this.message += `\n List onScrollIndex, first: ${first.toString()}, last: ${last.toString()}`; + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + console.info("List onWillScroll"); + this.message += `\n List onWillScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}, scrollSource: ${scrollSource.toString()}`; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info("List onDidScroll"); + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + this.message += `\n List onDidScroll, scrollOffset: ${scrollOffset.toString()}, scrollState: ${scrollState.toString()}`; + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info("List onScrollFrameBegin"); + this.message += `\n List onScrollFrameBegin, offset: ${offset}, state: ${state}`; + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + console.info("List onScrollStart"); + this.message += `\n List onScrollStart`; + }) + .onScrollStop(() => { + console.info("List onScrollStop"); + this.message += `\n List onScrollStop`; + }) + .onReachStart(() => { + console.info("List onReachStart"); + this.message += `\n List onReachStart`; + }) + .onReachEnd(() => { + console.info("List onReachEnd"); + this.message += `\n List onReachEnd`; + }) + + Scroll() { + Text(this.message) + .fontSize(10) + .fontColor(Color.Red) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + } + .id(this.name + '_03') + .friction(0.6) + .backgroundColor(Color.Yellow) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(200) + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .backgroundColor(Color.Green) + .width('100%') + .height('100%') + + } + +} -- Gitee From c45a7f02b926f7e19c2ced6acb56e83eac57c244 Mon Sep 17 00:00:00 2001 From: jinzhao Date: Mon, 11 Aug 2025 17:13:36 +0800 Subject: [PATCH 5/5] Fix snapshot params Signed-off-by: jinzhao --- .../UIComponentListAndGridGridScrollbar.test.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets index 81ebab7e..f338c938 100644 --- a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentListAndGridGridScrollbarTest/UIComponentListAndGridGridScrollbar.test.ets @@ -125,12 +125,12 @@ export default function UIComponentListAndGridGridScrollbar() { await driver.waitForIdle(1000, 2000); await driver.mouseMoveTo({x: bounds.right - 5, y: bounds.top + 50}); await driver.waitForIdle(1000, 2000); - await windowSnap.snapShot(); + await windowSnap.snapShot(TAG + '_01'); await button.click(); await Utils.sleep(2000); await driver.mouseMoveTo({x: bounds.left + 5, y: bounds.top + 50}); await driver.waitForIdle(1000, 2000); - await windowSnap.snapShot(); + await windowSnap.snapShot(TAG + '_02'); await Utils.sleep(1000); Logger.info(`[${TAG}]`, `Case finish.`); done(); -- Gitee