From 86685cedfc4cf60a9192c90fd18fda6237a48060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Mon, 28 Apr 2025 20:37:21 +0800 Subject: [PATCH 1/4] =?UTF-8?q?add=2026=20=E6=9D=A1=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentTextCommonLineSpace15.ets | 48 ++++++++ .../UiComponentTextCommonLineSpace16.ets | 43 ++++++++ .../UiComponentTextCommonLineSpace17.ets | 62 +++++++++++ .../UiComponentTextCommonLineSpace18.ets | 55 ++++++++++ .../UiComponentTextRicheditor02.ets | 56 ++++++++++ .../UiComponentTextRicheditor03.ets | 56 ++++++++++ .../UiComponentTextRicheditor04.ets | 56 ++++++++++ .../UiComponentTextRicheditor05.ets | 52 +++++++++ .../UiComponentTextRicheditor06.ets | 103 ++++++++++++++++++ .../pages/UiTestCase/UiTestCase27.ets | 44 ++++++++ .../pages/UiTestCase/UiTestCase28.ets | 58 ++++++++++ .../pages/UiTestCase/UiTestCase29.ets | 51 +++++++++ .../pages/UiTestCase/UiTestCase30.ets | 44 ++++++++ .../pages/UiTestCase/UiTestCase31.ets | 44 ++++++++ .../pages/UiTestCase/UiTestCase32.ets | 38 +++++++ .../pages/UiTestCase/UiTestCase33.ets | 37 +++++++ .../pages/UiTestCase/UiTestCase34.ets | 37 +++++++ .../pages/UiTestCase/UiTestCase35.ets | 58 ++++++++++ .../pages/UiTestCase/UiTestCase36.ets | 48 ++++++++ .../pages/UiTestCase/UiTestCase37.ets | 59 ++++++++++ .../pages/UiTestCase/UiTestCase38.ets | 51 +++++++++ .../pages/UiTestCase/UiTestCase39.ets | 39 +++++++ .../pages/UiTestCase/UiTestCase40.ets | 39 +++++++ 23 files changed, 1178 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor04.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase27.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase28.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase29.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase30.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase31.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase32.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase33.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase34.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase35.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase36.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase37.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase38.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase39.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15.ets new file mode 100644 index 00000000..6076a0ab --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextCommonLineSpace15 { + private currentIndex: number = 0; + @State text: string = '' + @State nums: number=10 + build() { + Column() { + Text('UiComponentTextCommonLineSpace15') + { + ContainerSpan() { + Span('This is the Span with the height adaptive policy set!') + .fontSize('16fp') + .fontColor(Color.Black) + Span('This is the Span with the height adaptive policy set') + .fontSize('16fp') + .fontColor(Color.Black) + } + } + .width(336) + .copyOption(CopyOptions.InApp) + .height(500) + .maxLines(2) + .lineSpacing(LengthMetrics.vp(this.nums)) + Button('change size') + .onClick(()=>{ + this.nums=50 + }) + .id('UiComponentTextCommonLineSpace15') + }.width('100%').height('100%').backgroundColor('#F1F3F5') + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16.ets new file mode 100644 index 00000000..03465fa2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' +let i:number=0; +@Entry +@Component +struct UiComponentTextCommonLineSpace16 { + controller: TextAreaController = new TextAreaController() + @State nums: number=100 + @State text: string = 'This is the TextArea with the height adaptive policy set' + + 'This is the TextArea with the height adaptive policy set' + build() { + Column({ space: 8 }) { + Text(this.text) + .width(336) + .height(500) + .margin(20) + .maxLines(2) + .fontSize(16) + .fontColor('#182431') + .lineSpacing(LengthMetrics.px(this.nums)) + .backgroundColor('#FFFFFF') + Button('change size') + .onClick(()=>{ + this.nums=50 + }) + .id('UiComponentTextCommonLineSpace16') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17.ets new file mode 100644 index 00000000..4b64c56b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextCommonLineSpace17 { + controller: TextAreaController = new TextAreaController() + @State text: string = 'This is the TextArea with \n the height adaptive policy set' + + 'This is the TextArea \n with the height adaptive policy set' + build() { + Column({ space: 8 }) { + Text('This is the text with the height \nnadaptive policy set ' + + 'This is the \ntext with the height adaptive policy set') + .width('80%') + .height(90) + .borderWidth(1) + .minFontSize(10) + .maxFontSize(30) + .lineHeight(50) + .lineSpacing(LengthMetrics.vp(10)) + .textCase(TextCase.Normal) + .maxLines(2) + .textOverflow({ overflow: TextOverflow.Clip }) + .decoration({ + type: TextDecorationType.Underline, + color: Color.Red, + style: TextDecorationStyle.WAVY + }) + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(200) + .margin(20) + .maxLines(2) + .fontSize(16) + .lineHeight(50) + .fontColor('#182431') + .lineSpacing(LengthMetrics.vp(0)) + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.text = value + }) + } + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18.ets new file mode 100644 index 00000000..f71e39d4 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextCommonLineSpace18 { + controller: TextAreaController = new TextAreaController() + @State nums: number=100 + @State text: string = 'This is the TextArea with \n the height adaptive policy set' + + 'This is the TextArea \n with the height adaptive policy set' + build() { + Column({ space: 8 }) { + Text('hello world') + { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + ImageSpan($r('app.media.app_icon')) + .width('60vp') + .height('60vp') + .verticalAlign(ImageSpanAlignment.CENTER) + .textBackgroundStyle({color: Color.Green, radius: "5vp"}) + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Lighter) + .fontSize(96) + } + .lineSpacing(LengthMetrics.px(this.nums)) + .width(336) + .copyOption(CopyOptions.InApp) + .height(500) + .maxLines(3) + Button('change size') + .onClick(()=>{ + this.nums=5 + }) + .id('UiComponentTextCommonLineSpace18') + } + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02.ets new file mode 100644 index 00000000..c5057656 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextRicheditor02 { + @State changeValue: string = '' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column({space: 10}) { + Text('onSubmit:' + this.submitValue).fontSize(18).margin(15) + Text('onChange:' + this.changeValue).fontSize(18).margin(15) + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + this.submitValue = value + }) + .onChange((value: string) => { + this.changeValue = value + }) + .margin(20) + .id('UiComponentTextRicheditor02') + Button('Set caretPosition 1') + .onClick(() => { + // 设置光标位置到输入的第一个字符后 + this.controller.caretPosition(1) + }) + Button('Get CaretOffset') + .onClick(() => { + this.positionInfo = this.controller.getCaretOffset() + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03.ets new file mode 100644 index 00000000..7dfc145d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextRicheditor03 { + @State changeValue: string = '' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column({space: 10}) { + Text('onSubmit:' + this.submitValue).fontSize(18).margin(15) + Text('onChange:' + this.changeValue).fontSize(18).margin(15) + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + this.submitValue = value + }) + .onChange((value: string) => { + this.changeValue = value + }) + .margin(20) + .id('UiComponentTextRicheditor03') + Button('Set caretPosition 1') + .onClick(() => { + // 设置光标位置到输入的第一个字符后 + this.controller.caretPosition(1) + }) + Button('Get CaretOffset') + .onClick(() => { + this.positionInfo = this.controller.getCaretOffset() + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor04.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor04.ets new file mode 100644 index 00000000..ef7887e2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor04.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextRicheditor04 { + @State changeValue: string = '' + @State submitValue: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: SearchController = new SearchController() + + build() { + Column({space: 10}) { + Text('onSubmit:' + this.submitValue).fontSize(18).margin(15) + Text('onChange:' + this.changeValue).fontSize(18).margin(15) + Search({ value: this.changeValue, placeholder: 'Type to search...', controller: this.controller }) + .searchButton('SEARCH') + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + this.submitValue = value + }) + .onChange((value: string) => { + this.changeValue = value + }) + .margin(20) + .id('UiComponentTextRicheditor04') + Button('Set caretPosition 1') + .onClick(() => { + // 设置光标位置到输入的第一个字符后 + this.controller.caretPosition(1) + }) + Button('Get CaretOffset') + .onClick(() => { + this.positionInfo = this.controller.getCaretOffset() + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05.ets new file mode 100644 index 00000000..dc72e270 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UiComponentTextRicheditor05 { + build() { + Scroll() { + Column({ space: 15 }) { + Row() { + Gauge({ value: 50, min: 1, max: 100 }) { + Column() { + Text('60') + .maxFontSize("180sp") + .minFontSize("160.0vp") + .fontWeight(FontWeight.Medium) + .fontColor("#ff182431") + .width('40%') + .height('30%') + .textAlign(TextAlign.Center) + .margin({ top: '22.2%' }) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(1) + }.width('100%').height('100%') + } + .startAngle(225) + .endAngle(135) + .colors(Color.Red) + .width('80%') + .height('80%') + .strokeWidth(18) + .trackShadow({ radius: 7, offsetX: 7, offsetY: 7 }) + .padding(18) + .privacySensitive(false) + } + } + } + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets new file mode 100644 index 00000000..a1005865 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 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 UiComponentTextRicheditor06 { + @State text: string = '1/2 2/3' + private start: number = -1; + private end: number = -1; + @State message: string = "[-1, -1]" + @State content: string = "" + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Column() { + Text() { + SymbolSpan($r('sys.symbol.ohos_trash')) + .fontWeight(FontWeight.Normal) + .fontSize(96) + } + .copyOption(CopyOptions.InApp) + RichEditor(this.options) + .onReady(() => { + this.controller.addSymbolSpan($r("sys.symbol.ohos_trash"), + { + style: + { + fontSize: 30 + } + }) + }) + .onSelect((value: RichEditorSelection) => { + this.start = value.selection[0]; + this.end = value.selection[1]; + this.message = "[" + this.start + ", " + this.end + "]" + }) + .aboutToIMEInput((value: RichEditorInsertValue) => { + console.log("---------------------- aboutToIMEInput ----------------------") + console.log("insertOffset:" + value.insertOffset) + console.log("insertValue:" + value.insertValue) + return true; + }) + .onIMEInputComplete((value: RichEditorTextSpanResult) => { + console.log("---------------------- onIMEInputComplete ---------------------") + console.log("spanIndex:" + value.spanPosition.spanIndex) + console.log("spanRange:[" + value.spanPosition.spanRange[0] + "," + value.spanPosition.spanRange[1] + "]") + console.log("offsetInSpan:[" + value.offsetInSpan[0] + "," + value.offsetInSpan[1] + "]") + console.log("value:" + value.value) + }) + .aboutToDelete((value: RichEditorDeleteValue) => { + console.log("---------------------- aboutToDelete --------------------------") + console.log("offset:" + value.offset) + console.log("direction:" + value.direction) + console.log("length:" + value.length) + value.richEditorDeleteSpans.forEach(item => { + console.log("---------------------- item --------------------------") + console.log("spanIndex:" + item.spanPosition.spanIndex) + console.log("spanRange:[" + item.spanPosition.spanRange[0] + "," + item.spanPosition.spanRange[1] + "]") + console.log("offsetInSpan:[" + item.offsetInSpan[0] + "," + item.offsetInSpan[1] + "]") + if (typeof(item as RichEditorImageSpanResult)['imageStyle'] != 'undefined') { + console.log("image:" + (item as RichEditorImageSpanResult).valueResourceStr) + } else { + console.log("text:" + (item as RichEditorTextSpanResult).value) + } + }) + return true; + }) + .onDeleteComplete(() => { + console.log("---------------------- onDeleteComplete ------------------------") + }) + .placeholder("input...", { + fontColor: Color.Gray, + font: { + size: 16, + weight: FontWeight.Normal, + family: "HarmonyOS Sans", + style: FontStyle.Normal + } + }) + .borderWidth(1) + .borderColor(Color.Green) + .width("100%") + .height("30%") + } + .borderWidth(1) + .borderColor(Color.Red) + .width("100%") + .height("70%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase27.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase27.ets new file mode 100644 index 00000000..0636dc0a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase27.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 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 UiTestCase27 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" "1"') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" "0"') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase28.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase28.ets new file mode 100644 index 00000000..0aa4c997 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase28.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 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 UiTestCase28 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" 0.1') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" 2') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" 100') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" -1') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase29.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase29.ets new file mode 100644 index 00000000..e4badc68 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase29.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 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 UiTestCase29 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" "1abc"') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" "100%"') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" "0x000000"') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase30.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase30.ets new file mode 100644 index 00000000..96859615 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase30.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 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 UiTestCase30 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" on') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" off') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase31.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase31.ets new file mode 100644 index 00000000..faccf322 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase31.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 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 UiTestCase31 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" 1') + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" 0') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase32.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase32.ets new file mode 100644 index 00000000..f842b146 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase32.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 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 UiTestCase32 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" on') + .fontFeature('"hwid" off') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase33.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase33.ets new file mode 100644 index 00000000..47a871eb --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase33.ets @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 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 UiTestCase33 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid" on') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase34.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase34.ets new file mode 100644 index 00000000..ad729d5c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase34.ets @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 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 UiTestCase34 { + @State text: string = '' + build() { + Column() { + Text('!!!!!') + .width('80%') + .height(55) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('!!!!!') + .width('80%') + .height(55) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"hwid"') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase35.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase35.ets new file mode 100644 index 00000000..1c846fc0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase35.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 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 UiTestCase35 { + @State text: string = '1/2 2/3 3/4' + controller: TextAreaController = new TextAreaController() + controller2: TextInputController = new TextInputController() + build() { + Column() { + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .maxLength(4) + .showCounter(true) + .style(TextContentStyle.INLINE) + .fontFeature('"frac" on') + .backgroundColor('#FFFFFF') + .onChange((value: string) => { + this.text = value + }) + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller2 }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .width('95%') + .height(40) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .fontFeature('"frac" on') + .onChange((value: string) => { + this.text = value + }) + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase36.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase36.ets new file mode 100644 index 00000000..62419b19 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase36.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 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 UiTestCase36 { + @State text: string = '1/2 2/3' + controller: TextAreaController = new TextAreaController() + @State style : TextContentStyle=TextContentStyle.DEFAULT + build() { + Column() { + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .style(this.style) + .fontFeature('"frac" on') + .onChange((value: string) => { + this.text = value + }) + Button('change style') + .onClick(()=>{ + this.style=TextContentStyle.INLINE + }) + .id('UiTestCase36') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase37.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase37.ets new file mode 100644 index 00000000..7ab767b7 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase37.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 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 UiTestCase37 { + @State text: string = '1/2 2/3' + controller: TextAreaController = new TextAreaController() + @State style : TextContentStyle=TextContentStyle.DEFAULT + build() { + Column() { + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .style(this.style) + .fontFeature('"frac" on') + .onChange((value: string) => { + this.text = value + }) + TextArea({ + text: '', + placeholder: 'this is placeholder', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .style(this.style) + .onChange((value: string) => { + this.text = value + }) + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase38.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase38.ets new file mode 100644 index 00000000..c56b0e43 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase38.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 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 UiTestCase38 { + @State text: string = '' + controller: TextAreaController = new TextAreaController() + @State style : TextContentStyle=TextContentStyle.DEFAULT + build() { + Column() { + TextArea({ + text: this.text, + placeholder: 'The text area can hold an unlimited amount of text. input your word...', + controller: this.controller + }) + .placeholderFont({ size: 16, weight: 400 }) + .width(336) + .height(56) + .margin(20) + .fontSize(16) + .fontColor('#182431') + .backgroundColor('#FFFFFF') + .style(this.style) + .fontFeature('"frac" on') + .onChange((value: string) => { + this.text = value + }) + .id('UiTestCase38_text') + Button('Set setTextSelection') + .backgroundColor('#007DFF') + .margin(15) + .onClick(() => { + this.controller.setTextSelection(-1,0) + }) + .id('UiTestCase38_button') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase39.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase39.ets new file mode 100644 index 00000000..f4d1db56 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase39.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 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 UiTestCase39 { + @State text: string = '' + build() { + Column() { + Text('()[]{}') + .width('80%') + .height(55) + .fontSize(40) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('()[]{}') + .width('80%') + .height(55) + .fontSize(40) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"vert" on') + } + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets new file mode 100644 index 00000000..515a7ec7 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 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 UiTestCase40 { + @State text: string = '' + build() { + Column() { + Text('HarmonyOS') + .width('80%') + .height(55) + .fontSize(40) + .fontColor(Color.Black) + .lineHeight(55) + .textAlign(TextAlign.Center) + Text('HarmonyOS') + .width('80%') + .height(55) + .fontSize(40) + .lineHeight(55) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontFeature('"ss07" on') + } + } +} \ No newline at end of file -- Gitee From 2befffbb5566dd2b5d74a11bc335005e572261e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Mon, 28 Apr 2025 20:40:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?add=2026=20=E6=9D=A1=20case2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentTextCommonLineSpace.test.ets | 106 +++++-- .../UiComponentTextRicheditor.test.ets | 174 +++++++++++ .../ets/test/UiTestCase/UiTestCase.test.ets | 282 +++++++++++++++++- 3 files changed, 529 insertions(+), 33 deletions(-) create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets index 478ac215..f9bdd190 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2024 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 Settings from '../model/Settings' import windowSnap from '../model/snapShot' @@ -72,7 +57,7 @@ export default function UiComponentTextCommmonLineSpace() { { await button.click() } - windowSnap.snapShot() + windowSnap.snapShot("SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0020") await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0020 finish.`); done() @@ -93,7 +78,7 @@ export default function UiComponentTextCommmonLineSpace() { let driver: Driver=Driver.create() let text: Component = await driver.findComponent(ON.id('UiComponentTextCommonLineSpace12')) await text.inputText('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') - windowSnap.snapShot() + windowSnap.snapShot("SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0030") await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0030 finish.`); done() @@ -114,7 +99,7 @@ export default function UiComponentTextCommmonLineSpace() { let driver: Driver=Driver.create() let text: Component = await driver.findComponent(ON.id('UiComponentTextCommonLineSpace13')) await text.inputText(' ') - windowSnap.snapShot() + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0050') await Utils.sleep(1000) Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXTINPUT_PHONENUMBER_0050 finish.`); done() @@ -327,5 +312,90 @@ export default function UiComponentTextCommmonLineSpace() { done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0040 + * @tc.name text contains a ContainerSpan + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0040', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0040 start.`); + Settings.createWindow("testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0090_1') + let driver: Driver=Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentTextCommonLineSpace15')) + await button.click() + await Utils.sleep(1000) + await driver.longClick(248,500) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0090_2') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140 + * @tc.name Dynamically switch lineSpacing + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140 start.`); + Settings.createWindow("testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140_01') + let driver: Driver=Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentTextCommonLineSpace16')) + await button.click() + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140_02') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0150 + * @tc.name Set lineHeight and line spacing at the same time + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0150', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0150 start.`); + Settings.createWindow("testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0140_01') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050 + * @tc.name Set lineHeight and line spacing at the same time + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050 start.`); + Settings.createWindow("testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050_1') + let driver: Driver=Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentTextCommonLineSpace18')) + await button.click() + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050_2') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_LINESPACE_0050 finish.`); + done() + }) }) } diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets new file mode 100644 index 00000000..b74b5101 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets @@ -0,0 +1,174 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Level } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON,Component ,MouseButton } from '@ohos.UiTest' +import { i18n } from '@kit.LocalizationKit' +import { BusinessError } from '@kit.BasicServicesKit' + +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:设置文本颜色 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UiComponentTextRicheditor() { + + describe('UiComponentTextRicheditor', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0070 + * @tc.name Click the search button to make the selected text out of focus + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0070', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0070 start.`); + Settings.createWindow("testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + let text: Component = await driver.findComponent(ON.id('UiComponentTextRicheditor02')) + await text.inputText('aaaaaaaaa') + await Utils.sleep(1000) + await driver.longClick(110,300) + await Utils.sleep(1000) + await driver.mouseClick({x:700,y:300}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0070') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020 + * @tc.name The Search component gestures and clicks the cursor to pop up a single handle and menu + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020 start.`); + Settings.createWindow("testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + let text: Component = await driver.findComponent(ON.id('UiComponentTextRicheditor03')) + await text.inputText('aaaaaaaaa') + await Utils.sleep(1000) + await driver.click(170,300) + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0080 + * @tc.name Click the component input box several times and the cursor appears + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0080', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0080 start.`); + Settings.createWindow("testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + let text: Component = await driver.findComponent(ON.id('UiComponentTextRicheditor03')) + await text.inputText('aaaaaaaaa') + await Utils.sleep(1000) + await driver.click(20,300) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020_1') + await Utils.sleep(1000) + await driver.click(400,300) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020_2') + await Utils.sleep(1000) + await driver.click(100,300) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERACTION_0020_3') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_SEARCH_INTERFACE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_ARKUI_PRIVACYSENSITIVE-GAUGE_0010 + * @tc.name In the Gauge container, set privacySensitive to false + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_ARKUI_PRIVACYSENSITIVE_GAUGE_0010', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_PRIVACYSENSITIVE_GAUGE_0010`); + Settings.createWindow("testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_ARKUI_PRIVACYSENSITIVE_GAUGE_0010') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_ARKUI_PRIVACYSENSITIVE_GAUGE_0010`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_ SHUFFLEEDITING_0370-GAUGE_0010 + * @tc.name In the Gauge container, set privacySensitive to false + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370`); + Settings.createWindow("testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + await driver.longClick(300,100) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370_1') + await driver.mouseClick({x:320, y:270}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await Utils.sleep(1000) + await driver.longClick(500,350) + await driver.mouseClick({x:90, y:160}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370_2') + await Utils.sleep(1000) + await driver.longClick(200,250) + await driver.mouseClick({x:150, y:200}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await driver.mouseClick({x:150, y:170}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await driver.longClick(500,350) + await driver.mouseClick({x:80, y:170}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370_3') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_RICHEDITOR_SYMBOL_SHUFFLEEDITING_0370`); + done() + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets index a35172f8..3ac8c900 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2024 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 Settings from '../model/Settings' import windowSnap from '../model/snapShot' @@ -522,5 +507,272 @@ export default function UiTestCase() { done() }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0035 + * @tc.name Attribute value setting outlier "1" | 0” + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0035', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0035 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase27") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0035') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0035 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0034 + * @tc.name The attribute value is set to an illegal value + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0034', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0034 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase28") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0034') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0034 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0040 + * @tc.name The attribute value is set to an exception string value + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0040', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0040 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase29") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0040') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0033 + * @tc.name The attribute value is set to the normal value on | off + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0033', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0033 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase30") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0033') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0033 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0043 + * @tc.name The attribute value is set to a normal value of 1 | 0 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0043', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0043 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase31") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0043') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0043 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0044 + * @tc.name Set the fontFeature multiple times + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0044', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0044 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase32") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0044') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0044 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0048 + * @tc.name Set fontFeature to the hwid property + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0048', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0048 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase33") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0048') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0048 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0019 + * @tc.name The value of the on|off attribute is not set + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0019', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0019 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase34") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0019') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0019 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0041 + * @tc.name In inline mode (TextArea/TextInput), set the fontFeature text style + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0041', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0041 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase35") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0041') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0041 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0037 + * @tc.name Dynamically switch the style mode of the component to view the display of text styles + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0037', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0037 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase36") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + let button: Component = await driver.findComponent(ON.id('UiTestCase36')) + await button.click() + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0037') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0037 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0023 + * @tc.name Dynamically switch the style mode of the component to view the display of text styles + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0023', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0023 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase37") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + await driver.longClick(60,100) + await Utils.sleep(1000) + await driver.mouseClick({x:300, y:200}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await driver.mouseClick({x:150, y:200}, MouseButton.MOUSE_BUTTON_LEFT, 2072); + await driver.longClick(60,300) + await Utils.sleep(1000) + await driver.mouseClick({x:60, y:230}, MouseButton.MOUSE_BUTTON_LEFT, 2072) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0023') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0023 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0080 + * @tc.name The start position is less than 0 and the end position is equal to 0 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0080', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0080 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase38") + await Utils.sleep(1000) + let driver: Driver=Driver.create() + let button: Component = await driver.findComponent(ON.id('UiTestCase38_button')) + let text: Component = await driver.findComponent(ON.id('UiTestCase38_text')) + await text.inputText('aaaa') + await button.click() + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0080') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_TEXTAREA_SELECTION_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0047 + * @tc.name Set fontFeature to vert + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0047', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0047 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase39") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0047') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0047 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0026 + * @tc.name Set fontFeature to ss07 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0026', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0026 start.`); + Settings.createWindow("testability/pages/UiTestCase/UiTestCase40") + await Utils.sleep(1000) + windowSnap.snapShot('SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0026') + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_COMMON_FONTFEATURE_0026 finish.`); + done() + }) }) } -- Gitee From 33ab0ad88ba3529f01c21179248aee41b8c4c9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Tue, 29 Apr 2025 09:42:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=88=E6=9D=83?= =?UTF-8?q?=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentTextCommonLineSpace.test.ets | 15 +++++++++++++++ .../UiComponentTextRicheditor.test.ets | 17 ++++++++++++++++- .../ets/test/UiTestCase/UiTestCase.test.ets | 15 +++++++++++++++ .../UiComponentTextRicheditor06.ets | 1 - .../pages/UiTestCase/UiTestCase40.ets | 4 ++-- .../ohosTest/resources/base/element/string.json | 4 ---- 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets index f9bdd190..b1006636 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2024 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 Settings from '../model/Settings' import windowSnap from '../model/snapShot' diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets index b74b5101..a22dc7cd 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentTextRicheditor/UiComponentTextRicheditor.test.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2024 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 Settings from '../model/Settings' import windowSnap from '../model/snapShot' @@ -13,7 +28,7 @@ import { BusinessError } from '@kit.BasicServicesKit' * Settings.createWindow(config.url): * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 * - * windowSnap.snapShot(globalThis.context): + * windowSnap.snapShot(globalThis.contex): * 窗口截屏&图片文件保存,存储在设备端 * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets index 3ac8c900..7c0cc7bb 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiTestCase/UiTestCase.test.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2024 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 Settings from '../model/Settings' import windowSnap from '../model/snapShot' diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets index a1005865..69a465af 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06.ets @@ -86,7 +86,6 @@ struct UiComponentTextRicheditor06 { font: { size: 16, weight: FontWeight.Normal, - family: "HarmonyOS Sans", style: FontStyle.Normal } }) diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets index 515a7ec7..119cba0b 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiTestCase/UiTestCase40.ets @@ -19,14 +19,14 @@ struct UiTestCase40 { @State text: string = '' build() { Column() { - Text('HarmonyOS') + Text('Hello world') .width('80%') .height(55) .fontSize(40) .fontColor(Color.Black) .lineHeight(55) .textAlign(TextAlign.Center) - Text('HarmonyOS') + Text('Hello world') .width('80%') .height(55) .fontSize(40) diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/element/string.json b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/element/string.json index 273e23b0..619b795e 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/element/string.json +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/element/string.json @@ -32,10 +32,6 @@ "name": "boardSize_10", "value": "0vp" }, - { - "name": "fontfamily_1", - "value": "HarmonyOS Sans" - }, { "name": "span", "value": "span" -- Gitee From ca84bd65855e6b2a6db0186d5d795b20ee171b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Tue, 29 Apr 2025 15:40:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../entry/src/ohosTest/ets/test/List.test.ets | 2 ++ .../resources/base/profile/test_pages.json | 25 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/List.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/List.test.ets index bed6552e..5fa47ecf 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/List.test.ets +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/List.test.ets @@ -17,8 +17,10 @@ import UiTestCase from './UiTestCase/UiTestCase.test' import UiComponentTextCommonLineSpace from './UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace.test' +import UiComponentTextRicheditor from './UiComponentTextRicheditor/UiComponentTextRicheditor.test' export default function testsuite() { UiTestCase(); UiComponentTextCommonLineSpace(); + UiComponentTextRicheditor(); } \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/profile/test_pages.json b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/profile/test_pages.json index ad727d5b..472d0fbb 100644 --- a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -16,6 +16,10 @@ "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace12", "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace13", "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace14", + "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace15", + "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace16", + "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace17", + "testability/pages/UiComponentTextCommonLineSpace/UiComponentTextCommonLineSpace18", "testability/pages/UiTestCase/UiTestCase01", "testability/pages/UiTestCase/UiTestCase02", "testability/pages/UiTestCase/UiTestCase03", @@ -41,6 +45,25 @@ "testability/pages/UiTestCase/UiTestCase23", "testability/pages/UiTestCase/UiTestCase24", "testability/pages/UiTestCase/UiTestCase25", - "testability/pages/UiTestCase/UiTestCase26" + "testability/pages/UiTestCase/UiTestCase26", + "testability/pages/UiTestCase/UiTestCase27", + "testability/pages/UiTestCase/UiTestCase28", + "testability/pages/UiTestCase/UiTestCase29", + "testability/pages/UiTestCase/UiTestCase30", + "testability/pages/UiTestCase/UiTestCase31", + "testability/pages/UiTestCase/UiTestCase32", + "testability/pages/UiTestCase/UiTestCase33", + "testability/pages/UiTestCase/UiTestCase34", + "testability/pages/UiTestCase/UiTestCase35", + "testability/pages/UiTestCase/UiTestCase36", + "testability/pages/UiTestCase/UiTestCase37", + "testability/pages/UiTestCase/UiTestCase38", + "testability/pages/UiTestCase/UiTestCase39", + "testability/pages/UiTestCase/UiTestCase40", + "testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor02", + "testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor03", + "testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor04", + "testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor05", + "testability/pages/UiComponentTextRicheditor/UiComponentTextRicheditor06" ] } -- Gitee