提交 d6a87ef3 编写于 作者: L limeng

xts文件名修改

Signed-off-by: Nlimeng <limeng208@huawei.com>
上级 02f45609
...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter'; ...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter';
@Entry @Entry
@Component @Component
struct SR000HTP2K { struct BindMenu {
@Builder MenuBuilder() { @Builder MenuBuilder() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text('Test menu item 1') Text('Test menu item 1')
...@@ -38,7 +38,7 @@ struct SR000HTP2K { ...@@ -38,7 +38,7 @@ struct SR000HTP2K {
Row() { Row() {
Text('placeholder') Text('placeholder')
.width("40%").height('100%') .width("40%").height('100%')
.key('SR000HTP2K_placeholder') .key('BindMenu_placeholder')
Text('click for Menu') Text('click for Menu')
.width("60%").height('100%') .width("60%").height('100%')
.borderWidth(1).borderColor(Color.Green).textAlign(TextAlign.Center) .borderWidth(1).borderColor(Color.Green).textAlign(TextAlign.Center)
...@@ -82,7 +82,7 @@ struct SR000HTP2K { ...@@ -82,7 +82,7 @@ struct SR000HTP2K {
events_emitter.emit(event, eventData) events_emitter.emit(event, eventData)
} }
}) })
.key('SR000HTP2K_bindMenu1') .key('BindMenu_bindMenu1')
} }
.width("90%").height(50).margin(10) .width("90%").height(50).margin(10)
...@@ -120,7 +120,7 @@ struct SR000HTP2K { ...@@ -120,7 +120,7 @@ struct SR000HTP2K {
events_emitter.emit(event, eventData) events_emitter.emit(event, eventData)
} }
}) })
.key('SR000HTP2K_bindContextMenu1') .key('BindMenu_bindContextMenu1')
} }
.width("90%").height(50).margin(10) .width("90%").height(50).margin(10)
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUESG_SI { struct CanvasAPI {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private context2: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context2: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
...@@ -46,7 +46,7 @@ struct SR000HUESG_SI { ...@@ -46,7 +46,7 @@ struct SR000HUESG_SI {
.height('500px') .height('500px')
.backgroundColor('#ff83835d') .backgroundColor('#ff83835d')
.margin({ top: 5 }) .margin({ top: 5 })
.key('SR000HUESG_SI_Canvas1') .key('CanvasAPI_Canvas1')
.onReady(() => { .onReady(() => {
this.noTransform() this.noTransform()
this.transformByField1() this.transformByField1()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUET2 { struct CanvasAPICanvasRender {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings) private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings)
...@@ -27,7 +27,7 @@ struct SR000HUET2 { ...@@ -27,7 +27,7 @@ struct SR000HUET2 {
.width('100%') .width('100%')
.height('30%') .height('30%')
.backgroundColor('#ffff00') .backgroundColor('#ffff00')
.key('SR000HUET2_Canvas1') .key('CanvasAPICanvasRender_Canvas1')
.onReady(() => { .onReady(() => {
this.context_fillText1() this.context_fillText1()
this.context_fillText2() this.context_fillText2()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUESL { struct CanvasAPIUnit {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings) private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings)
...@@ -27,7 +27,7 @@ struct SR000HUESL { ...@@ -27,7 +27,7 @@ struct SR000HUESL {
.width('100%') .width('100%')
.height('30%') .height('30%')
.backgroundColor('#ffff00') .backgroundColor('#ffff00')
.key('SR000HUESL_Canvas1') .key('CanvasAPIUnit_Canvas1')
.onReady(() => { .onReady(() => {
this.context_font1() this.context_font1()
this.context_font2() this.context_font2()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUES3 { struct CanvasColor {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private img: ImageBitmap = new ImageBitmap('/pages/images/test1.jpg') private img: ImageBitmap = new ImageBitmap('/pages/images/test1.jpg')
...@@ -35,7 +35,7 @@ struct SR000HUES3 { ...@@ -35,7 +35,7 @@ struct SR000HUES3 {
this.strokeStyle_CanvasGradient() this.strokeStyle_CanvasGradient()
this.strokeStyle_CanvasPattern() this.strokeStyle_CanvasPattern()
}) })
.id('SR000HUES3_Canvas1') .id('CanvasColor_Canvas1')
} }
} }
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUES7 { struct CanvasShader {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private context1: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context1: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
...@@ -28,7 +28,7 @@ struct SR000HUES7 { ...@@ -28,7 +28,7 @@ struct SR000HUES7 {
.height('20%') .height('20%')
.backgroundColor('#ff83835d') .backgroundColor('#ff83835d')
.margin({ top: 5 }) .margin({ top: 5 })
.key('SR000HUES7_Canvas1') .key('CanvasShader_Canvas1')
.onReady(() => { .onReady(() => {
this.createConicGradient1() this.createConicGradient1()
this.createConicGradient2() this.createConicGradient2()
...@@ -54,7 +54,7 @@ struct SR000HUES7 { ...@@ -54,7 +54,7 @@ struct SR000HUES7 {
.height('20%') .height('20%')
.backgroundColor('#ff83835d') .backgroundColor('#ff83835d')
.margin({ top: 5 }) .margin({ top: 5 })
.key('SR000HUES7_Canvas2') .key('CanvasShader_Canvas2')
.onReady(() => { .onReady(() => {
this.clamp1() this.clamp1()
this.clamp2() this.clamp2()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HR4C4 { struct ImageText {
@State align1: ImageSpanAlignment = ImageSpanAlignment.BASELINE @State align1: ImageSpanAlignment = ImageSpanAlignment.BASELINE
@State align2: ImageSpanAlignment = ImageSpanAlignment.CENTER @State align2: ImageSpanAlignment = ImageSpanAlignment.CENTER
@State align3: ImageSpanAlignment = ImageSpanAlignment.TOP @State align3: ImageSpanAlignment = ImageSpanAlignment.TOP
...@@ -33,19 +33,19 @@ struct SR000HR4C4 { ...@@ -33,19 +33,19 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan($r('app.media.icon')).width('114px').height("114px") ImageSpan($r('app.media.icon')).width('114px').height("114px")
.verticalAlign(this.align1) .verticalAlign(this.align1)
.key('SR000HR4C4_ImageSpan1') .key('ImageText_ImageSpan1')
Span('Span').fontSize(this.fontSize1) Span('Span').fontSize(this.fontSize1)
ImageSpan('/pages/images/img1.png').width('150px').height("150px") ImageSpan('/pages/images/img1.png').width('150px').height("150px")
.verticalAlign(this.align2) .verticalAlign(this.align2)
.key('SR000HR4C4_ImageSpan2') .key('ImageText_ImageSpan2')
Span('Span').fontSize(this.fontSize2) Span('Span').fontSize(this.fontSize2)
ImageSpan($r('app.media.icon')).width('114px').height("114px") ImageSpan($r('app.media.icon')).width('114px').height("114px")
.verticalAlign(this.align3) .verticalAlign(this.align3)
.key('SR000HR4C4_ImageSpan3') .key('ImageText_ImageSpan3')
Span('Span').fontSize(this.fontSize3) Span('Span').fontSize(this.fontSize3)
ImageSpan('/pages/images/img1.png').width('150px').height("150px") ImageSpan('/pages/images/img1.png').width('150px').height("150px")
.verticalAlign(this.align4) .verticalAlign(this.align4)
.key('SR000HR4C4_ImageSpan4') .key('ImageText_ImageSpan4')
Span('Span Text4').fontSize(this.fontSize4) Span('Span Text4').fontSize(this.fontSize4)
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
...@@ -55,7 +55,7 @@ struct SR000HR4C4 { ...@@ -55,7 +55,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.Contain) .objectFit(ImageFit.Contain)
.key('SR000HR4C4_ImageSpan5') .key('ImageText_ImageSpan5')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -65,7 +65,7 @@ struct SR000HR4C4 { ...@@ -65,7 +65,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.Cover) .objectFit(ImageFit.Cover)
.key('SR000HR4C4_ImageSpan6') .key('ImageText_ImageSpan6')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -75,7 +75,7 @@ struct SR000HR4C4 { ...@@ -75,7 +75,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.Auto) .objectFit(ImageFit.Auto)
.key('SR000HR4C4_ImageSpan7') .key('ImageText_ImageSpan7')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -85,7 +85,7 @@ struct SR000HR4C4 { ...@@ -85,7 +85,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.Fill) .objectFit(ImageFit.Fill)
.key('SR000HR4C4_ImageSpan8') .key('ImageText_ImageSpan8')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -95,7 +95,7 @@ struct SR000HR4C4 { ...@@ -95,7 +95,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.ScaleDown) .objectFit(ImageFit.ScaleDown)
.key('SR000HR4C4_ImageSpan9') .key('ImageText_ImageSpan9')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -105,7 +105,7 @@ struct SR000HR4C4 { ...@@ -105,7 +105,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px') ImageSpan('/pages/images/test1.jpg').width(this.w+'px').height(this.h+'px')
.objectFit(ImageFit.None) .objectFit(ImageFit.None)
.key('SR000HR4C4_ImageSpan10') .key('ImageText_ImageSpan10')
} }
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Green) .borderColor(Color.Green)
...@@ -114,16 +114,16 @@ struct SR000HR4C4 { ...@@ -114,16 +114,16 @@ struct SR000HR4C4 {
Text() { Text() {
Span('Span Text1 ').fontSize(20) Span('Span Text1 ').fontSize(20)
.key('SR000HR4C4_Span1') .key('ImageText_Span1')
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.key('SR000HR4C4_ImageSpan11') .key('ImageText_ImageSpan11')
Span('Span Text2 ').fontSize(20) Span('Span Text2 ').fontSize(20)
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({top: 15}) .margin({top: 15})
.width('90%') .width('90%')
.textIndent(this.indent) .textIndent(this.indent)
.key('SR000HR4C4_Text1') .key('ImageText_Text1')
Button("indent+50") Button("indent+50")
.margin(10) .margin(10)
.width('30%') .width('30%')
...@@ -135,11 +135,11 @@ struct SR000HR4C4 { ...@@ -135,11 +135,11 @@ struct SR000HR4C4 {
.onClick(() => { .onClick(() => {
this.indent += 50; this.indent += 50;
}) })
.key('SR000HR4C4_Button1') .key('ImageText_Button1')
Text() { Text() {
ImageSpan(null).width('276px').height("183px") ImageSpan(null).width('276px').height("183px")
.key('SR000HR4C4_ImageSpan12') .key('ImageText_ImageSpan12')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -147,7 +147,7 @@ struct SR000HR4C4 { ...@@ -147,7 +147,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan(undefined).width('276px').height("183px") ImageSpan(undefined).width('276px').height("183px")
.key('SR000HR4C4_ImageSpan13') .key('ImageText_ImageSpan13')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -155,7 +155,7 @@ struct SR000HR4C4 { ...@@ -155,7 +155,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('').width('276px').height("183px") ImageSpan('').width('276px').height("183px")
.key('SR000HR4C4_ImageSpan14') .key('ImageText_ImageSpan14')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -165,7 +165,7 @@ struct SR000HR4C4 { ...@@ -165,7 +165,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.verticalAlign(null) .verticalAlign(null)
.key('SR000HR4C4_ImageSpan15') .key('ImageText_ImageSpan15')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -174,7 +174,7 @@ struct SR000HR4C4 { ...@@ -174,7 +174,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.verticalAlign(undefined) .verticalAlign(undefined)
.key('SR000HR4C4_ImageSpan16') .key('ImageText_ImageSpan16')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -183,7 +183,7 @@ struct SR000HR4C4 { ...@@ -183,7 +183,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.objectFit(null) .objectFit(null)
.key('SR000HR4C4_ImageSpan17') .key('ImageText_ImageSpan17')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -192,7 +192,7 @@ struct SR000HR4C4 { ...@@ -192,7 +192,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.objectFit(undefined) .objectFit(undefined)
.key('SR000HR4C4_ImageSpan18') .key('ImageText_ImageSpan18')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -200,7 +200,7 @@ struct SR000HR4C4 { ...@@ -200,7 +200,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.key('SR000HR4C4_ImageSpan19') .key('ImageText_ImageSpan19')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
...@@ -209,7 +209,7 @@ struct SR000HR4C4 { ...@@ -209,7 +209,7 @@ struct SR000HR4C4 {
Text() { Text() {
ImageSpan('/pages/images/test1.jpg').width('276px').height("183px") ImageSpan('/pages/images/test1.jpg').width('276px').height("183px")
.key('SR000HR4C4_ImageSpan20') .key('ImageText_ImageSpan20')
} }
.borderWidth(1).borderColor(Color.Green) .borderWidth(1).borderColor(Color.Green)
.margin({ top: 5 }) .margin({ top: 5 })
......
...@@ -16,7 +16,7 @@ import MyUtils from '../common/MyUtils'; ...@@ -16,7 +16,7 @@ import MyUtils from '../common/MyUtils';
@Entry @Entry
@Component @Component
struct SR000HTP23 { struct ListDelete {
@State arr: number[] = [0, 1, 2] @State arr: number[] = [0, 1, 2]
@State arr2: number[] = [0, 1, 2] @State arr2: number[] = [0, 1, 2]
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HTP2C { struct ListRebound {
@State Number: String[] = ['0', '1', '2', '3'] @State Number: String[] = ['0', '1', '2', '3']
scroller: Scroller = new Scroller() scroller: Scroller = new Scroller()
@State isRefreshing: boolean = false @State isRefreshing: boolean = false
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HTP2O { struct NavigationParam {
private arr: number[] = [0, 1, 2] private arr: number[] = [0, 1, 2]
@Builder NavigationTitle() { @Builder NavigationTitle() {
...@@ -62,7 +62,7 @@ struct SR000HTP2O { ...@@ -62,7 +62,7 @@ struct SR000HTP2O {
} }
.title($r("app.string.test_title")) .title($r("app.string.test_title"))
.titleMode(NavigationTitleMode.Free) .titleMode(NavigationTitleMode.Free)
.key('SR000HTP2O_Navigation1') .key('NavigationParam_Navigation1')
Navigation() { Navigation() {
List({ space: 5, initialIndex: 0 }) { List({ space: 5, initialIndex: 0 }) {
...@@ -85,7 +85,7 @@ struct SR000HTP2O { ...@@ -85,7 +85,7 @@ struct SR000HTP2O {
} }
.title("test_string_title") .title("test_string_title")
.titleMode(NavigationTitleMode.Free) .titleMode(NavigationTitleMode.Free)
.key('SR000HTP2O_Navigation2') .key('NavigationParam_Navigation2')
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HUESC { struct OffScreenCanvas {
private settings: RenderingContextSettings = new RenderingContextSettings(true) private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private settings_false: RenderingContextSettings = new RenderingContextSettings(false) private settings_false: RenderingContextSettings = new RenderingContextSettings(false)
...@@ -26,7 +26,7 @@ struct SR000HUESC { ...@@ -26,7 +26,7 @@ struct SR000HUESC {
Canvas(this.context) Canvas(this.context)
.width('100%') .width('100%')
.height('100%') .height('100%')
.key('SR000HUESC_Canvas1') .key('OffScreenCanvas_Canvas1')
.onReady(() => { .onReady(() => {
this.offscreenCanvas.getContext(null) this.offscreenCanvas.getContext(null)
this.offscreenCanvas.getContext(undefined) this.offscreenCanvas.getContext(undefined)
......
...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter'; ...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter';
@Entry @Entry
@Component @Component
struct SR000HTP2G { struct TextAreaCallback {
controller: TextAreaController = new TextAreaController() controller: TextAreaController = new TextAreaController()
build() { build() {
...@@ -59,7 +59,7 @@ struct SR000HTP2G { ...@@ -59,7 +59,7 @@ struct SR000HTP2G {
.width('80%') .width('80%')
.tabIndex(2) .tabIndex(2)
.margin({ top: 5, bottom: 5 }) .margin({ top: 5, bottom: 5 })
.key('SR000HTP2G_TextArea1') .key('TextAreaCallback_TextArea1')
TextArea({ placeholder: 'input your word', controller: this.controller }) TextArea({ placeholder: 'input your word', controller: this.controller })
.placeholderColor("rgb(0,0,225)") .placeholderColor("rgb(0,0,225)")
...@@ -82,7 +82,7 @@ struct SR000HTP2G { ...@@ -82,7 +82,7 @@ struct SR000HTP2G {
.width('80%') .width('80%')
.tabIndex(3) .tabIndex(3)
.margin({ top: 5, bottom: 5 }) .margin({ top: 5, bottom: 5 })
.key('SR000HTP2G_TextArea2') .key('TextAreaCallback_TextArea2')
}.width('100%') }.width('100%')
} }
......
...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP2KTest() { export default function BindMenuTest() {
const SUITE = 'SR000HTP2K' const SUITE = 'BindMenu'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
describe('SR000HTP2KTest', function () { describe('BindMenuTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP2K", url: "TestAbility/pages/BindMenu",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP2K" == pages.name)) { if (pages == null || !("BindMenu" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -65,7 +65,7 @@ export default function SR000HTP2KTest() { ...@@ -65,7 +65,7 @@ export default function SR000HTP2KTest() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP2K_placeholder', 10, "") sendEventByKey('BindMenu_placeholder', 10, "")
} }
let callback = (event) => { let callback = (event) => {
...@@ -79,7 +79,7 @@ export default function SR000HTP2KTest() { ...@@ -79,7 +79,7 @@ export default function SR000HTP2KTest() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP2K_bindMenu1', 10, "") sendEventByKey('BindMenu_bindMenu1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
}); });
...@@ -120,7 +120,7 @@ export default function SR000HTP2KTest() { ...@@ -120,7 +120,7 @@ export default function SR000HTP2KTest() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP2K_bindContextMenu1', 11, "") sendEventByKey('BindMenu_bindContextMenu1', 11, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
}); });
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUESG_SITest() { export default function CanvasAPITest() {
const SUITE = 'SR000HUESG_SI' const SUITE = 'CanvasAPI'
describe('SR000HUESG_SITest', function () { describe('CanvasAPITest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUESG_SI", url: "TestAbility/pages/CanvasAPI",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUESG_SI" == pages.name)) { if (pages == null || !("CanvasAPI" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUESG_SITest() { ...@@ -49,7 +49,7 @@ export default function SR000HUESG_SITest() {
it('ArkUI_Canvas_API_0100', 0, async function (done) { it('ArkUI_Canvas_API_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_API_0100' let CASE = 'ArkUI_Canvas_API_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUESG_SI_Canvas1') let strJson = getInspectorByKey('CanvasAPI_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUET2Test() { export default function CanvasAPICanvasRenderTest() {
const SUITE = 'SR000HUET2' const SUITE = 'CanvasAPICanvasRender'
describe('SR000HUET2Test', function () { describe('CanvasAPICanvasRenderTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUET2", url: "TestAbility/pages/CanvasAPICanvasRender",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUET2" == pages.name)) { if (pages == null || !("CanvasAPICanvasRender" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUET2Test() { ...@@ -49,7 +49,7 @@ export default function SR000HUET2Test() {
it('ArkUI_Canvas_API_CanvasRender_0100', 0, async function (done) { it('ArkUI_Canvas_API_CanvasRender_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_API_CanvasRender_0100' let CASE = 'ArkUI_Canvas_API_CanvasRender_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUET2_Canvas1') let strJson = getInspectorByKey('CanvasAPICanvasRender_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUESLTest() { export default function CanvasAPIUnitTest() {
const SUITE = 'SR000HUESL' const SUITE = 'CanvasAPIUnit'
describe('SR000HUESLTest', function () { describe('CanvasAPIUnitTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUESL", url: "TestAbility/pages/CanvasAPIUnit",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUESL" == pages.name)) { if (pages == null || !("CanvasAPIUnit" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUESLTest() { ...@@ -49,7 +49,7 @@ export default function SR000HUESLTest() {
it('ArkUI_Canvas_API_Unit_0100', 0, async function (done) { it('ArkUI_Canvas_API_Unit_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_API_Unit_0100' let CASE = 'ArkUI_Canvas_API_Unit_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUESL_Canvas1') let strJson = getInspectorByKey('CanvasAPIUnit_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUES3Test() { export default function CanvasColorTest() {
const SUITE = 'SR000HUES3' const SUITE = 'CanvasColor'
describe('SR000HUES3Test', function () { describe('CanvasColorTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUES3", url: "TestAbility/pages/CanvasColor",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUES3" == pages.name)) { if (pages == null || !("CanvasColor" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUES3Test() { ...@@ -49,7 +49,7 @@ export default function SR000HUES3Test() {
it('ArkUI_Canvas_Color_0100', 0, async function (done) { it('ArkUI_Canvas_Color_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_Color_0100' let CASE = 'ArkUI_Canvas_Color_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUES3_Canvas1') let strJson = getInspectorByKey('CanvasColor_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUES7Test() { export default function CanvasShaderTest() {
const SUITE = 'SR000HUES7' const SUITE = 'CanvasShader'
describe('SR000HUES7Test', function () { describe('CanvasShaderTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUES7", url: "TestAbility/pages/CanvasShader",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUES7" == pages.name)) { if (pages == null || !("CanvasShader" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUES7Test() { ...@@ -49,7 +49,7 @@ export default function SR000HUES7Test() {
it('ArkUI_Canvas_Shader_0100', 0, async function (done) { it('ArkUI_Canvas_Shader_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_Shader_0100' let CASE = 'ArkUI_Canvas_Shader_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUES7_Canvas1') let strJson = getInspectorByKey('CanvasShader_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
...@@ -64,7 +64,7 @@ export default function SR000HUES7Test() { ...@@ -64,7 +64,7 @@ export default function SR000HUES7Test() {
it('ArkUI_Canvas_Shader_0200', 0, async function (done) { it('ArkUI_Canvas_Shader_0200', 0, async function (done) {
let CASE = 'ArkUI_Canvas_Shader_0200' let CASE = 'ArkUI_Canvas_Shader_0200'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUES7_Canvas2') let strJson = getInspectorByKey('CanvasShader_Canvas2')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
*/ */
import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
export default function SR000HR4C4Test() { export default function ImageTextTest() {
const SUITE = 'SR000HR4C4' const SUITE = 'ImageText'
describe('SR000HR4C4Test', function () { describe('ImageTextTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HR4C4", url: "TestAbility/pages/ImageText",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HR4C4" == pages.name)) { if (pages == null || !("ImageText" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -48,19 +48,19 @@ export default function SR000HR4C4Test() { ...@@ -48,19 +48,19 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0100' let CASE = 'ArkUI_Image_Text_0100'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan1'); let strJson = getInspectorByKey('ImageText_ImageSpan1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('BASELINE') expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('BASELINE')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan2'); strJson = getInspectorByKey('ImageText_ImageSpan2');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('CENTER') expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('CENTER')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan3'); strJson = getInspectorByKey('ImageText_ImageSpan3');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('TOP') expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('TOP')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan4'); strJson = getInspectorByKey('ImageText_ImageSpan4');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('BOTTOM') expect(obj.$attrs.verticalAlign.split('.')[1]).assertEqual('BOTTOM')
...@@ -77,27 +77,27 @@ export default function SR000HR4C4Test() { ...@@ -77,27 +77,27 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0200' let CASE = 'ArkUI_Image_Text_0200'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan5'); let strJson = getInspectorByKey('ImageText_ImageSpan5');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Contain') expect(obj.$attrs.objectFit).assertEqual('ImageFit.Contain')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan6'); strJson = getInspectorByKey('ImageText_ImageSpan6');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover') expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan7'); strJson = getInspectorByKey('ImageText_ImageSpan7');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Auto') expect(obj.$attrs.objectFit).assertEqual('ImageFit.Auto')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan8'); strJson = getInspectorByKey('ImageText_ImageSpan8');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Fill') expect(obj.$attrs.objectFit).assertEqual('ImageFit.Fill')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan9'); strJson = getInspectorByKey('ImageText_ImageSpan9');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.ScaleDown') expect(obj.$attrs.objectFit).assertEqual('ImageFit.ScaleDown')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan10'); strJson = getInspectorByKey('ImageText_ImageSpan10');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.None') expect(obj.$attrs.objectFit).assertEqual('ImageFit.None')
...@@ -114,11 +114,11 @@ export default function SR000HR4C4Test() { ...@@ -114,11 +114,11 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0300' let CASE = 'ArkUI_Image_Text_0300'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_Text1'); let strJson = getInspectorByKey('ImageText_Text1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.textIndent).assertEqual(undefined) expect(obj.$attrs.textIndent).assertEqual(undefined)
if ( sendEventByKey('SR000HR4C4_Button1', 10, null) ) { if ( sendEventByKey('ImageText_Button1', 10, null) ) {
let strJson = getInspectorByKey('SR000HR4C4_Text1'); let strJson = getInspectorByKey('ImageText_Text1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.textIndent).assertEqual(undefined) expect(obj.$attrs.textIndent).assertEqual(undefined)
} }
...@@ -135,15 +135,15 @@ export default function SR000HR4C4Test() { ...@@ -135,15 +135,15 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0400' let CASE = 'ArkUI_Image_Text_0400'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan12'); let strJson = getInspectorByKey('ImageText_ImageSpan12');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan13'); strJson = getInspectorByKey('ImageText_ImageSpan13');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan14'); strJson = getInspectorByKey('ImageText_ImageSpan14');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
...@@ -161,11 +161,11 @@ export default function SR000HR4C4Test() { ...@@ -161,11 +161,11 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0500' let CASE = 'ArkUI_Image_Text_0500'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan15'); let strJson = getInspectorByKey('ImageText_ImageSpan15');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan16'); strJson = getInspectorByKey('ImageText_ImageSpan16');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
...@@ -183,11 +183,11 @@ export default function SR000HR4C4Test() { ...@@ -183,11 +183,11 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0600' let CASE = 'ArkUI_Image_Text_0600'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan17'); let strJson = getInspectorByKey('ImageText_ImageSpan17');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan18'); strJson = getInspectorByKey('ImageText_ImageSpan18');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
...@@ -205,11 +205,11 @@ export default function SR000HR4C4Test() { ...@@ -205,11 +205,11 @@ export default function SR000HR4C4Test() {
let CASE = 'ArkUI_Image_Text_0700' let CASE = 'ArkUI_Image_Text_0700'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
let strJson = getInspectorByKey('SR000HR4C4_ImageSpan19'); let strJson = getInspectorByKey('ImageText_ImageSpan19');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
strJson = getInspectorByKey('SR000HR4C4_ImageSpan20'); strJson = getInspectorByKey('ImageText_ImageSpan20');
obj = JSON.parse(strJson); obj = JSON.parse(strJson);
expect(obj.$attrs.height).assertEqual('183.00px') expect(obj.$attrs.height).assertEqual('183.00px')
expect(obj.$attrs.width).assertEqual('276.00px') expect(obj.$attrs.width).assertEqual('276.00px')
......
...@@ -12,30 +12,30 @@ ...@@ -12,30 +12,30 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import SR000HTP23Test from './SR000HTP23.test' import ListDeleteTest from './ListDelete.test'
import SR000HTP2CTest from './SR000HTP2C.test' import ListReboundTest from './ListRebound.test'
import SR000HTP2GTest from './SR000HTP2G.test' import TextAreaCallbackTest from './TextAreaCallback.test'
import SR000HTP2KTest from './SR000HTP2K.test' import BindMenuTest from './BindMenu.test'
import SR000HTP2OTest from './SR000HTP2O.test' import NavigationParamTest from './NavigationParam.test'
import SR000HR4C4Test from './SR000HR4C4.test' import ImageTextTest from './ImageText.test'
import SR000HUES3Test from './SR000HUES3.test' import CanvasColorTest from './CanvasColor.test'
import SR000HUESCTest from './SR000HUESC.test' import OffScreenCanvasTest from './OffScreenCanvas.test'
import SR000HUESLTest from './SR000HUESL.test' import CanvasAPIUnitTest from './CanvasAPIUnit.test'
import SR000HUET2Test from './SR000HUET2.test' import CanvasAPICanvasRenderTest from './CanvasAPICanvasRender.test'
import SR000HUESG_SITest from './SR000HUESG_SI.test' import CanvasAPITest from './CanvasAPI.test'
import SR000HUES7Test from './SR000HUES7.test' import CanvasShaderTest from './CanvasShader.test'
export default function testsuite() { export default function testsuite() {
SR000HTP23Test() ListDeleteTest()
SR000HTP2CTest() ListReboundTest()
SR000HTP2GTest() TextAreaCallbackTest()
SR000HTP2KTest() BindMenuTest()
SR000HTP2OTest() NavigationParamTest()
SR000HR4C4Test() ImageTextTest()
SR000HUES3Test() CanvasColorTest()
SR000HUESCTest() OffScreenCanvasTest()
SR000HUESLTest() CanvasAPIUnitTest()
SR000HUET2Test() CanvasAPICanvasRenderTest()
SR000HUESG_SITest() CanvasAPITest()
SR000HUES7Test() CanvasShaderTest()
} }
\ No newline at end of file
...@@ -17,9 +17,9 @@ import router from '@ohos.router' ...@@ -17,9 +17,9 @@ import router from '@ohos.router'
import {Driver, Component, ON} from '@ohos.UiTest' import {Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP23Test() { export default function ListDeleteTest() {
const SUITE = 'SR000HTP23' const SUITE = 'ListDelete'
function getRectCenter(rect: string) { function getRectCenter(rect: string) {
let rtn = rect.replace(/\[/g, '').replace(/\]/g, ',').split(',') let rtn = rect.replace(/\[/g, '').replace(/\]/g, ',').split(',')
return [ return [
...@@ -35,16 +35,16 @@ export default function SR000HTP23Test() { ...@@ -35,16 +35,16 @@ export default function SR000HTP23Test() {
] ]
} }
describe('SR000HTP23Test', function () { describe('ListDeleteTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP23", url: "TestAbility/pages/ListDelete",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP23" == pages.name)) { if (pages == null || !("ListDelete" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {Driver, Component, ON} from '@ohos.UiTest' import {Driver, Component, ON} from '@ohos.UiTest'
export default function SR000HTP2CTest() { export default function ListReboundTest() {
const SUITE = 'SR000HTP2C' const SUITE = 'ListRebound'
function getRectCenter(rect: string) { function getRectCenter(rect: string) {
let rtn = rect.replace(/\[/g, '').replace(/\]/g, ',').split(',') let rtn = rect.replace(/\[/g, '').replace(/\]/g, ',').split(',')
return [ return [
...@@ -25,16 +25,16 @@ export default function SR000HTP2CTest() { ...@@ -25,16 +25,16 @@ export default function SR000HTP2CTest() {
px2vp(parseFloat(rtn[1].trim()) + (parseFloat(rtn[3].trim()) - parseFloat(rtn[1].trim())) / 2), px2vp(parseFloat(rtn[1].trim()) + (parseFloat(rtn[3].trim()) - parseFloat(rtn[1].trim())) / 2),
] ]
} }
describe('SR000HTP2CTest', function () { describe('ListReboundTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP2C", url: "TestAbility/pages/ListRebound",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP2C" == pages.name)) { if (pages == null || !("ListRebound" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
......
...@@ -16,9 +16,9 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,9 +16,9 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP2OTest() { export default function NavigationParamTest() {
const SUITE = 'SR000HTP2O' const SUITE = 'NavigationParam'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
function sleep(time) { function sleep(time) {
let date = new Date() let date = new Date()
...@@ -30,16 +30,16 @@ export default function SR000HTP2OTest() { ...@@ -30,16 +30,16 @@ export default function SR000HTP2OTest() {
} }
} }
describe('SR000HTP2OTest', function () { describe('NavigationParamTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP2O", url: "TestAbility/pages/NavigationParam",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP2O" == pages.name)) { if (pages == null || !("NavigationParam" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -60,7 +60,7 @@ export default function SR000HTP2OTest() { ...@@ -60,7 +60,7 @@ export default function SR000HTP2OTest() {
it('ArkUI_Navigation_0100', 0, async function (done) { it('ArkUI_Navigation_0100', 0, async function (done) {
let CASE = 'ArkUI_Navigation_0100' let CASE = 'ArkUI_Navigation_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HTP2O_Navigation1') let strJson = getInspectorByKey('NavigationParam_Navigation1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Navigation') expect(obj.$type).assertEqual('Navigation')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
...@@ -75,7 +75,7 @@ export default function SR000HTP2OTest() { ...@@ -75,7 +75,7 @@ export default function SR000HTP2OTest() {
it('ArkUI_Navigation_0200', 0, async function (done) { it('ArkUI_Navigation_0200', 0, async function (done) {
let CASE = 'ArkUI_Navigation_0200' let CASE = 'ArkUI_Navigation_0200'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HTP2O_Navigation2') let strJson = getInspectorByKey('NavigationParam_Navigation2')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.title).assertEqual('test_string_title') expect(obj.$attrs.title).assertEqual('test_string_title')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,19 +16,19 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HUESCTest() { export default function OffScreenCanvasTest() {
const SUITE = 'SR000HUESC' const SUITE = 'OffScreenCanvas'
describe('SR000HUESCTest', function () { describe('OffScreenCanvasTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HUESC", url: "TestAbility/pages/OffScreenCanvas",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HUESC" == pages.name)) { if (pages == null || !("OffScreenCanvas" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -49,7 +49,7 @@ export default function SR000HUESCTest() { ...@@ -49,7 +49,7 @@ export default function SR000HUESCTest() {
it('ArkUI_Canvas_API_OffScreenCanvas_0100', 0, async function (done) { it('ArkUI_Canvas_API_OffScreenCanvas_0100', 0, async function (done) {
let CASE = 'ArkUI_Canvas_API_OffScreenCanvas_0100' let CASE = 'ArkUI_Canvas_API_OffScreenCanvas_0100'
console.info(`${SUITE} ${CASE} START`) console.info(`${SUITE} ${CASE} START`)
let strJson = getInspectorByKey('SR000HUESC_Canvas1') let strJson = getInspectorByKey('OffScreenCanvas_Canvas1')
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Canvas') expect(obj.$type).assertEqual('Canvas')
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
......
...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP2GTest() { export default function TextAreaCallbackTest() {
const SUITE = 'SR000HTP2G' const SUITE = 'TextAreaCallback'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
describe('SR000HTP2GTest', function () { describe('TextAreaCallbackTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP2G", url: "TestAbility/pages/TextAreaCallback",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP2G" == pages.name)) { if (pages == null || !("TextAreaCallback" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -64,7 +64,7 @@ export default function SR000HTP2GTest() { ...@@ -64,7 +64,7 @@ export default function SR000HTP2GTest() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP2G_TextArea2', 10, "") sendEventByKey('TextAreaCallback_TextArea2', 10, "")
} }
let callback = (event) => { let callback = (event) => {
...@@ -78,7 +78,7 @@ export default function SR000HTP2GTest() { ...@@ -78,7 +78,7 @@ export default function SR000HTP2GTest() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP2G_TextArea1', 10, "") sendEventByKey('TextAreaCallback_TextArea1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
}); });
......
{ {
"src": [ "src": [
"TestAbility/pages/Index", "TestAbility/pages/Index",
"TestAbility/pages/SR000HTP23", "TestAbility/pages/ListDelete",
"TestAbility/pages/SR000HTP2C", "TestAbility/pages/ListRebound",
"TestAbility/pages/SR000HTP2G", "TestAbility/pages/TextAreaCallback",
"TestAbility/pages/SR000HTP2K", "TestAbility/pages/BindMenu",
"TestAbility/pages/SR000HTP2O", "TestAbility/pages/NavigationParam",
"TestAbility/pages/SR000HR4C4", "TestAbility/pages/ImageText",
"TestAbility/pages/SR000HUES3", "TestAbility/pages/CanvasColor",
"TestAbility/pages/SR000HUESC", "TestAbility/pages/OffScreenCanvas",
"TestAbility/pages/SR000HUESL", "TestAbility/pages/CanvasAPIUnit",
"TestAbility/pages/SR000HUET2", "TestAbility/pages/CanvasAPICanvasRender",
"TestAbility/pages/SR000HUESG_SI", "TestAbility/pages/CanvasAPI",
"TestAbility/pages/SR000HUES7" "TestAbility/pages/CanvasShader"
] ]
} }
...@@ -24,14 +24,14 @@ struct UserDialog0100 { ...@@ -24,14 +24,14 @@ struct UserDialog0100 {
this.controller.close() this.controller.close()
this.action() this.action()
}) })
.key('SR000HRF74_Button_Close_1') .key('CustomDialogMask_Button_Close_1')
}.padding(20) }.padding(20)
} }
} }
@Entry @Entry
@Component @Component
struct SR000HRF74 { struct CustomDialogMask {
dialogController: CustomDialogController = new CustomDialogController({ dialogController: CustomDialogController = new CustomDialogController({
builder: UserDialog0100({ action: this.afterClose }), builder: UserDialog0100({ action: this.afterClose }),
cancel: this.onCancel cancel: this.onCancel
...@@ -74,7 +74,7 @@ struct SR000HRF74 { ...@@ -74,7 +74,7 @@ struct SR000HRF74 {
.onClick(() => { .onClick(() => {
this.dialogController.open() this.dialogController.open()
}) })
.key('SR000HRF74_Button_Open_1') .key('CustomDialogMask_Button_Open_1')
Button('maskColor set by Color') Button('maskColor set by Color')
.margin(10) .margin(10)
.width('90%') .width('90%')
...@@ -86,7 +86,7 @@ struct SR000HRF74 { ...@@ -86,7 +86,7 @@ struct SR000HRF74 {
.onClick(() => { .onClick(() => {
this.dialogController2.open() this.dialogController2.open()
}) })
.key('SR000HRF74_Button_Open_2') .key('CustomDialogMask_Button_Open_2')
Button('maskColor set by string') Button('maskColor set by string')
.margin(10) .margin(10)
.width('90%') .width('90%')
...@@ -98,7 +98,7 @@ struct SR000HRF74 { ...@@ -98,7 +98,7 @@ struct SR000HRF74 {
.onClick(() => { .onClick(() => {
this.dialogController3.open() this.dialogController3.open()
}) })
.key('SR000HRF74_Button_Open_3') .key('CustomDialogMask_Button_Open_3')
Button('maskColor set by Resource') Button('maskColor set by Resource')
.margin(10) .margin(10)
.width('90%') .width('90%')
...@@ -110,7 +110,7 @@ struct SR000HRF74 { ...@@ -110,7 +110,7 @@ struct SR000HRF74 {
.onClick(() => { .onClick(() => {
this.dialogController4.open() this.dialogController4.open()
}) })
.key('SR000HRF74_Button_Open_4') .key('CustomDialogMask_Button_Open_4')
Button('maskColor set by number') Button('maskColor set by number')
.margin(10) .margin(10)
.width('90%') .width('90%')
...@@ -122,7 +122,7 @@ struct SR000HRF74 { ...@@ -122,7 +122,7 @@ struct SR000HRF74 {
.onClick(() => { .onClick(() => {
this.dialogController5.open() this.dialogController5.open()
}) })
.key('SR000HRF74_Button_Open_5') .key('CustomDialogMask_Button_Open_5')
} }
} }
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter'; ...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter';
@Entry @Entry
@Component @Component
struct SR000HV334 { struct ListScroll {
@State listPosition: number = 0; @State listPosition: number = 0;
private arr: number[] = Array.apply(this, {length: 60}).map((item, i) => i) private arr: number[] = Array.apply(this, {length: 60}).map((item, i) => i)
private scrollerForList: Scroller = new Scroller() private scrollerForList: Scroller = new Scroller()
...@@ -28,24 +28,24 @@ struct SR000HV334 { ...@@ -28,24 +28,24 @@ struct SR000HV334 {
.onClick(() => { .onClick(() => {
this.scrollerForList.scrollToIndex(14, false) this.scrollerForList.scrollToIndex(14, false)
}).height(45) }).height(45)
.key('SR000HV334_Button_To_14') .key('ListScroll_Button_To_14')
Button("To(15)") Button("To(15)")
.onClick(() => { .onClick(() => {
this.scrollerForList.scrollToIndex(15, true) this.scrollerForList.scrollToIndex(15, true)
}).height(45) }).height(45)
.key('SR000HV334_Button_To_15') .key('ListScroll_Button_To_15')
}.margin({top: 10}) }.margin({top: 10})
Row() { Row() {
Button("To(0)") Button("To(0)")
.onClick(() => { .onClick(() => {
this.scrollerForList.scrollToIndex(0, false) this.scrollerForList.scrollToIndex(0, false)
}).height(45) }).height(45)
.key('SR000HV334_Button_To_0') .key('ListScroll_Button_To_0')
Button("To(max)") Button("To(max)")
.onClick(() => { .onClick(() => {
this.scrollerForList.scrollToIndex(this.arr.length - 1, true) this.scrollerForList.scrollToIndex(this.arr.length - 1, true)
}).height(45) }).height(45)
.key('SR000HV334_Button_To_max') .key('ListScroll_Button_To_max')
}.margin({top: 10}) }.margin({top: 10})
List({ space: 5,initialIndex:23, scroller: this.scrollerForList }) { List({ space: 5,initialIndex:23, scroller: this.scrollerForList }) {
...@@ -92,7 +92,7 @@ struct SR000HV334 { ...@@ -92,7 +92,7 @@ struct SR000HV334 {
events_emitter.emit(event, eventData) events_emitter.emit(event, eventData)
} }
}) })
.key('SR000HV334_List1') .key('ListScroll_List1')
}.width('100%').height('100%') }.width('100%').height('100%')
} }
} }
\ No newline at end of file
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
export default function SR000HRF74Test() { export default function CustomDialogMaskTest() {
const SUITE = 'SR000HRF74' const SUITE = 'CustomDialogMask'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
function sleep(time) { function sleep(time) {
let date = new Date() let date = new Date()
...@@ -29,16 +29,16 @@ export default function SR000HRF74Test() { ...@@ -29,16 +29,16 @@ export default function SR000HRF74Test() {
} }
} }
describe('SR000HRF74Test', function () { describe('CustomDialogMaskTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HRF74", url: "TestAbility/pages/CustomDialogMask",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HRF74" == pages.name)) { if (pages == null || !("CustomDialogMask" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -63,12 +63,12 @@ export default function SR000HRF74Test() { ...@@ -63,12 +63,12 @@ export default function SR000HRF74Test() {
sleep(2) sleep(2)
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HRF74_Button_Open_1', 10, "") sendEventByKey('CustomDialogMask_Button_Open_1', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strObj = getInspectorByKey('SR000HRF74_Button_Close_1'); let strObj = getInspectorByKey('CustomDialogMask_Button_Close_1');
let obj = JSON.parse(strObj); let obj = JSON.parse(strObj);
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj.$attrs.visibility).assertEqual("Visibility.Visible");
sendEventByKey('SR000HRF74_Button_Close_1', 10, "") sendEventByKey('CustomDialogMask_Button_Close_1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
sleep(1) sleep(1)
...@@ -87,13 +87,13 @@ export default function SR000HRF74Test() { ...@@ -87,13 +87,13 @@ export default function SR000HRF74Test() {
sleep(1) sleep(1)
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HRF74_Button_Open_2', 10, "") sendEventByKey('CustomDialogMask_Button_Open_2', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strObj = getInspectorByKey('SR000HRF74_Button_Close_1'); let strObj = getInspectorByKey('CustomDialogMask_Button_Close_1');
let obj = JSON.parse(strObj); let obj = JSON.parse(strObj);
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj.$attrs.visibility).assertEqual("Visibility.Visible");
sendEventByKey('SR000HRF74_Button_Close_1', 10, "") sendEventByKey('CustomDialogMask_Button_Close_1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
sleep(1) sleep(1)
...@@ -111,13 +111,13 @@ export default function SR000HRF74Test() { ...@@ -111,13 +111,13 @@ export default function SR000HRF74Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HRF74_Button_Open_3', 10, "") sendEventByKey('CustomDialogMask_Button_Open_3', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strObj = getInspectorByKey('SR000HRF74_Button_Close_1'); let strObj = getInspectorByKey('CustomDialogMask_Button_Close_1');
let obj = JSON.parse(strObj); let obj = JSON.parse(strObj);
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj.$attrs.visibility).assertEqual("Visibility.Visible");
sendEventByKey('SR000HRF74_Button_Close_1', 10, "") sendEventByKey('CustomDialogMask_Button_Close_1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
sleep(1) sleep(1)
...@@ -135,13 +135,13 @@ export default function SR000HRF74Test() { ...@@ -135,13 +135,13 @@ export default function SR000HRF74Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HRF74_Button_Open_4', 10, "") sendEventByKey('CustomDialogMask_Button_Open_4', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strObj = getInspectorByKey('SR000HRF74_Button_Close_1'); let strObj = getInspectorByKey('CustomDialogMask_Button_Close_1');
let obj = JSON.parse(strObj); let obj = JSON.parse(strObj);
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj.$attrs.visibility).assertEqual("Visibility.Visible");
sendEventByKey('SR000HRF74_Button_Close_1', 10, "") sendEventByKey('CustomDialogMask_Button_Close_1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
sleep(1) sleep(1)
...@@ -159,13 +159,13 @@ export default function SR000HRF74Test() { ...@@ -159,13 +159,13 @@ export default function SR000HRF74Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HRF74_Button_Open_5', 10, "") sendEventByKey('CustomDialogMask_Button_Open_5', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strObj = getInspectorByKey('SR000HRF74_Button_Close_1'); let strObj = getInspectorByKey('CustomDialogMask_Button_Close_1');
let obj = JSON.parse(strObj); let obj = JSON.parse(strObj);
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible"); expect(obj.$attrs.visibility).assertEqual("Visibility.Visible");
sendEventByKey('SR000HRF74_Button_Close_1', 10, "") sendEventByKey('CustomDialogMask_Button_Close_1', 10, "")
console.info(`${SUITE} ${CASE} END`); console.info(`${SUITE} ${CASE} END`);
sleep(1) sleep(1)
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import SR000HV334Test from './SR000HV334.test' import ListScrollTest from './ListScroll.test'
import SR000HRF74Test from './SR000HRF74.test' import CustomDialogMaskTest from './CustomDialogMask.test'
export default function testsuite() { export default function testsuite() {
SR000HRF74Test() CustomDialogMaskTest()
SR000HV334Test() ListScrollTest()
} }
\ No newline at end of file
...@@ -16,20 +16,20 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,20 +16,20 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HV334Test() { export default function ListScrollTest() {
const SUITE = 'SR000HV334' const SUITE = 'ListScroll'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
describe('SR000HV334Test', function () { describe('ListScrollTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HV334", url: "TestAbility/pages/ListScroll",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HV334" == pages.name)) { if (pages == null || !("ListScroll" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -61,7 +61,7 @@ export default function SR000HV334Test() { ...@@ -61,7 +61,7 @@ export default function SR000HV334Test() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HV334_Button_To_14', 10, "") sendEventByKey('ListScroll_Button_To_14', 10, "")
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
}); });
...@@ -85,7 +85,7 @@ export default function SR000HV334Test() { ...@@ -85,7 +85,7 @@ export default function SR000HV334Test() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HV334_Button_To_15', 10, "") sendEventByKey('ListScroll_Button_To_15', 10, "")
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
}); });
...@@ -109,7 +109,7 @@ export default function SR000HV334Test() { ...@@ -109,7 +109,7 @@ export default function SR000HV334Test() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HV334_Button_To_0', 10, "") sendEventByKey('ListScroll_Button_To_0', 10, "")
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
}); });
...@@ -133,7 +133,7 @@ export default function SR000HV334Test() { ...@@ -133,7 +133,7 @@ export default function SR000HV334Test() {
events_emitter.on(event, callback); events_emitter.on(event, callback);
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HV334_Button_To_max', 10, "") sendEventByKey('ListScroll_Button_To_max', 10, "")
console.info(`${SUITE} ${CASE} END`) console.info(`${SUITE} ${CASE} END`)
}); });
......
{ {
"src": [ "src": [
"TestAbility/pages/Index", "TestAbility/pages/Index",
"TestAbility/pages/SR000HV334", "TestAbility/pages/ListScroll",
"TestAbility/pages/SR000HRF74" "TestAbility/pages/CustomDialogMask"
] ]
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HTP1U { struct CounterEnable {
@State value: number = 0 @State value: number = 0
@State enable_inc: boolean = false @State enable_inc: boolean = false
@State enable_dec: boolean = false @State enable_dec: boolean = false
...@@ -33,17 +33,17 @@ struct SR000HTP1U { ...@@ -33,17 +33,17 @@ struct SR000HTP1U {
}) })
.enableInc(this.enable_inc) .enableInc(this.enable_inc)
.enableDec(this.enable_dec) .enableDec(this.enable_dec)
.key('SR000HTP1U_Counter_1') .key('CounterEnable_Counter_1')
Button("enable_inc_true") Button("enable_inc_true")
.onClick(() => { .onClick(() => {
this.enable_inc = true; this.enable_inc = true;
}).height(45) }).height(45)
.key('SR000HTP1U_Button_1') .key('CounterEnable_Button_1')
Button("enable_dec_true") Button("enable_dec_true")
.onClick(() => { .onClick(() => {
this.enable_dec = true; this.enable_dec = true;
}).height(45) }).height(45)
.key('SR000HTP1U_Button_2') .key('CounterEnable_Button_2')
}.width("100%") }.width("100%")
} }
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
@Entry @Entry
@Component @Component
struct SR000HTP21 { struct TextAreaSelect {
controller: TextAreaController = new TextAreaController() controller: TextAreaController = new TextAreaController()
controller2: TextAreaController = new TextAreaController() controller2: TextAreaController = new TextAreaController()
controller3: TextAreaController = new TextAreaController() controller3: TextAreaController = new TextAreaController()
...@@ -33,79 +33,79 @@ struct SR000HTP21 { ...@@ -33,79 +33,79 @@ struct SR000HTP21 {
.fontStyle(FontStyle.Normal) .fontStyle(FontStyle.Normal)
.fontColor(Color.Red) .fontColor(Color.Red)
.tabIndex(1) .tabIndex(1)
.key('SR000HTP21_TextArea_1') .key('TextAreaSelect_TextArea_1')
Button("Show selected (-2,-1)") Button("Show selected (-2,-1)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(-2,-1) this.controller.setTextSelection(-2,-1)
}) })
.key('SR000HTP21_Button_1') .key('TextAreaSelect_Button_1')
Button("Show selected (-1,0)") Button("Show selected (-1,0)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(-1,0) this.controller.setTextSelection(-1,0)
}) })
.key('SR000HTP21_Button_2') .key('TextAreaSelect_Button_2')
Button("Show selected (0,3)") Button("Show selected (0,3)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(0,3) this.controller.setTextSelection(0,3)
}) })
.key('SR000HTP21_Button_3') .key('TextAreaSelect_Button_3')
Button("Show selected (1,3)") Button("Show selected (1,3)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(1,3) this.controller.setTextSelection(1,3)
}) })
.key('SR000HTP21_Button_4') .key('TextAreaSelect_Button_4')
Button("Show selected (-1,6)") Button("Show selected (-1,6)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(-1,6) this.controller.setTextSelection(-1,6)
}) })
.key('SR000HTP21_Button_5') .key('TextAreaSelect_Button_5')
Button("Show selected (0,6)") Button("Show selected (0,6)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(0,6) this.controller.setTextSelection(0,6)
}) })
.key('SR000HTP21_Button_6') .key('TextAreaSelect_Button_6')
Button("Show selected (-1,8)") Button("Show selected (-1,8)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(-1,8) this.controller.setTextSelection(-1,8)
}) })
.key('SR000HTP21_Button_7') .key('TextAreaSelect_Button_7')
Button("Show selected (0,8)") Button("Show selected (0,8)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(0,8) this.controller.setTextSelection(0,8)
}) })
.key('SR000HTP21_Button_8') .key('TextAreaSelect_Button_8')
Button("Show selected (null,null)") Button("Show selected (null,null)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(null,null) this.controller.setTextSelection(null,null)
}) })
.key('SR000HTP21_Button_9') .key('TextAreaSelect_Button_9')
Button("Show selected (null,undefined)") Button("Show selected (null,undefined)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(null,undefined) this.controller.setTextSelection(null,undefined)
}) })
.key('SR000HTP21_Button_10') .key('TextAreaSelect_Button_10')
Button("Show selected (undefined,null)") Button("Show selected (undefined,null)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(undefined,null) this.controller.setTextSelection(undefined,null)
}) })
.key('SR000HTP21_Button_11') .key('TextAreaSelect_Button_11')
Button("Show selected (undefined,undefined)") Button("Show selected (undefined,undefined)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller.setTextSelection(undefined,undefined) this.controller.setTextSelection(undefined,undefined)
}) })
.key('SR000HTP21_Button_12') .key('TextAreaSelect_Button_12')
TextArea({ text: '', placeholder: 'input your word', controller: this.controller2 }) TextArea({ text: '', placeholder: 'input your word', controller: this.controller2 })
.placeholderColor("rgb(0,0,225)") .placeholderColor("rgb(0,0,225)")
.placeholderFont({ size: 20, weight: 100, family: 'cursive', style: FontStyle.Italic }) .placeholderFont({ size: 20, weight: 100, family: 'cursive', style: FontStyle.Italic })
...@@ -117,13 +117,13 @@ struct SR000HTP21 { ...@@ -117,13 +117,13 @@ struct SR000HTP21 {
.fontStyle(FontStyle.Normal) .fontStyle(FontStyle.Normal)
.fontColor(Color.Red) .fontColor(Color.Red)
.tabIndex(2) .tabIndex(2)
.key('SR000HTP21_TextArea_2') .key('TextAreaSelect_TextArea_2')
Button("Show selected (1,3)") Button("Show selected (1,3)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller2.setTextSelection(1,3) this.controller2.setTextSelection(1,3)
}) })
.key('SR000HTP21_Button_13') .key('TextAreaSelect_Button_13')
TextArea({ text: '北京aaaaa上海tianjin深圳', placeholder: 'input your word', controller: this.controller3 }) TextArea({ text: '北京aaaaa上海tianjin深圳', placeholder: 'input your word', controller: this.controller3 })
.width(200) .width(200)
.height(50) .height(50)
...@@ -137,13 +137,13 @@ struct SR000HTP21 { ...@@ -137,13 +137,13 @@ struct SR000HTP21 {
.fontStyle(FontStyle.Normal) .fontStyle(FontStyle.Normal)
.fontColor(Color.Red) .fontColor(Color.Red)
.tabIndex(3) .tabIndex(3)
.key('SR000HTP21_TextArea_3') .key('TextAreaSelect_TextArea_3')
Button("Show selected (6,10)") Button("Show selected (6,10)")
.margin(30) .margin(30)
.onClick(() => { .onClick(() => {
this.controller3.setTextSelection(6,10) this.controller3.setTextSelection(6,10)
}) })
.key('SR000HTP21_Button_14') .key('TextAreaSelect_Button_14')
} }
} }
} }
\ No newline at end of file
...@@ -16,9 +16,9 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,9 +16,9 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP1UTest() { export default function CounterEnableTest() {
const SUITE = 'SR000HTP1U' const SUITE = 'CounterEnable'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
function sleep(time) { function sleep(time) {
let date = new Date() let date = new Date()
...@@ -30,16 +30,16 @@ export default function SR000HTP1UTest() { ...@@ -30,16 +30,16 @@ export default function SR000HTP1UTest() {
} }
} }
describe('SR000HTP1UTest', function () { describe('CounterEnableTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP1U", url: "TestAbility/pages/CounterEnable",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP1U" == pages.name)) { if (pages == null || !("CounterEnable" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -61,8 +61,8 @@ export default function SR000HTP1UTest() { ...@@ -61,8 +61,8 @@ export default function SR000HTP1UTest() {
let CASE = 'ArkUI_Counter_0100' let CASE = 'ArkUI_Counter_0100'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
sendEventByKey('SR000HTP1U_Button_1', 10, "") sendEventByKey('CounterEnable_Button_1', 10, "")
let strJson = getInspectorByKey('SR000HTP1U_Counter_1'); let strJson = getInspectorByKey('CounterEnable_Counter_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual("Counter"); expect(obj.$type).assertEqual("Counter");
...@@ -78,8 +78,8 @@ export default function SR000HTP1UTest() { ...@@ -78,8 +78,8 @@ export default function SR000HTP1UTest() {
it('ArkUI_Counter_0200', 0, async function (done) { it('ArkUI_Counter_0200', 0, async function (done) {
let CASE = 'ArkUI_Counter_0200' let CASE = 'ArkUI_Counter_0200'
console.info(`${SUITE} ${CASE} START`); console.info(`${SUITE} ${CASE} START`);
sendEventByKey('SR000HTP1U_Button_2', 10, "") sendEventByKey('CounterEnable_Button_2', 10, "")
let strJson = getInspectorByKey('SR000HTP1U_Counter_1'); let strJson = getInspectorByKey('CounterEnable_Counter_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual("Counter"); expect(obj.$type).assertEqual("Counter");
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import SR000HTP1UTest from './SR000HTP1U.test' import CounterEnableTest from './CounterEnable.test'
import SR000HTP21Test from './SR000HTP21.test' import TextAreaSelectTest from './TextAreaSelect.test'
export default function testsuite() { export default function testsuite() {
SR000HTP1UTest() CounterEnableTest()
SR000HTP21Test() TextAreaSelectTest()
} }
\ No newline at end of file
...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' ...@@ -16,21 +16,21 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium'
import router from '@ohos.router' import router from '@ohos.router'
import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function SR000HTP21Test() { export default function TextAreaSelectTest() {
const SUITE = 'SR000HTP21' const SUITE = 'TextAreaSelect'
const waitUiReadyMs = 500; const waitUiReadyMs = 500;
describe('SR000HTP21Test', function () { describe('TextAreaSelectTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HTP21", url: "TestAbility/pages/TextAreaSelect",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HTP21" == pages.name)) { if (pages == null || !("TextAreaSelect" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
...@@ -54,9 +54,9 @@ export default function SR000HTP21Test() { ...@@ -54,9 +54,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_1', 10, "") sendEventByKey('TextAreaSelect_Button_1', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
...@@ -75,9 +75,9 @@ export default function SR000HTP21Test() { ...@@ -75,9 +75,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_2', 10, "") sendEventByKey('TextAreaSelect_Button_2', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -97,9 +97,9 @@ export default function SR000HTP21Test() { ...@@ -97,9 +97,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_3', 10, "") sendEventByKey('TextAreaSelect_Button_3', 10, "")
await driver.delayMs(waitUiReadyMs*5) await driver.delayMs(waitUiReadyMs*5)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("3"); expect(obj.$attrs.caretPosition).assertEqual("3");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -119,9 +119,9 @@ export default function SR000HTP21Test() { ...@@ -119,9 +119,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_4', 10, "") sendEventByKey('TextAreaSelect_Button_4', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("3"); expect(obj.$attrs.caretPosition).assertEqual("3");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -141,9 +141,9 @@ export default function SR000HTP21Test() { ...@@ -141,9 +141,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_5', 10, "") sendEventByKey('TextAreaSelect_Button_5', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("6"); expect(obj.$attrs.caretPosition).assertEqual("6");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -163,9 +163,9 @@ export default function SR000HTP21Test() { ...@@ -163,9 +163,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_6', 10, "") sendEventByKey('TextAreaSelect_Button_6', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("6"); expect(obj.$attrs.caretPosition).assertEqual("6");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -185,9 +185,9 @@ export default function SR000HTP21Test() { ...@@ -185,9 +185,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_7', 10, "") sendEventByKey('TextAreaSelect_Button_7', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("6"); expect(obj.$attrs.caretPosition).assertEqual("6");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -207,9 +207,9 @@ export default function SR000HTP21Test() { ...@@ -207,9 +207,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_8', 10, "") sendEventByKey('TextAreaSelect_Button_8', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("6"); expect(obj.$attrs.caretPosition).assertEqual("6");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -229,9 +229,9 @@ export default function SR000HTP21Test() { ...@@ -229,9 +229,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_9', 10, "") sendEventByKey('TextAreaSelect_Button_9', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -251,9 +251,9 @@ export default function SR000HTP21Test() { ...@@ -251,9 +251,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_10', 10, "") sendEventByKey('TextAreaSelect_Button_10', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -273,9 +273,9 @@ export default function SR000HTP21Test() { ...@@ -273,9 +273,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_11', 10, "") sendEventByKey('TextAreaSelect_Button_11', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -295,9 +295,9 @@ export default function SR000HTP21Test() { ...@@ -295,9 +295,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_12', 10, "") sendEventByKey('TextAreaSelect_Button_12', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_1'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -317,9 +317,9 @@ export default function SR000HTP21Test() { ...@@ -317,9 +317,9 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_13', 10, "") sendEventByKey('TextAreaSelect_Button_13', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_2'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_2');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("0"); expect(obj.$attrs.caretPosition).assertEqual("0");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
...@@ -339,11 +339,11 @@ export default function SR000HTP21Test() { ...@@ -339,11 +339,11 @@ export default function SR000HTP21Test() {
let driver = Driver.create() let driver = Driver.create()
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_TextArea_3', 10, "") sendEventByKey('TextAreaSelect_TextArea_3', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
sendEventByKey('SR000HTP21_Button_14', 10, "") sendEventByKey('TextAreaSelect_Button_14', 10, "")
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
let strJson = getInspectorByKey('SR000HTP21_TextArea_3'); let strJson = getInspectorByKey('TextAreaSelect_TextArea_3');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.caretPosition).assertEqual("10"); expect(obj.$attrs.caretPosition).assertEqual("10");
await driver.delayMs(waitUiReadyMs) await driver.delayMs(waitUiReadyMs)
......
{ {
"src": [ "src": [
"TestAbility/pages/Index", "TestAbility/pages/Index",
"TestAbility/pages/SR000HTP1U", "TestAbility/pages/CounterEnable",
"TestAbility/pages/SR000HTP21" "TestAbility/pages/TextAreaSelect"
] ]
} }
...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter'; ...@@ -16,7 +16,7 @@ import events_emitter from '@ohos.events.emitter';
@Entry @Entry
@Component @Component
struct SR000HQURK { struct ShortcutKey {
private arr: string[] = ['0', '1','2', '3', '4', '5', '6', '7', '8', '9', private arr: string[] = ['0', '1','2', '3', '4', '5', '6', '7', '8', '9',
'-', '=', '`', '[', ']', ';', '\'', ',', '.', '/', ' ', '*', '+', '-', '=', '`', '[', ']', ';', '\'', ',', '.', '/', ' ', '*', '+',
'B','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W'] 'B','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W']
...@@ -48,7 +48,7 @@ struct SR000HQURK { ...@@ -48,7 +48,7 @@ struct SR000HQURK {
.onClick(() => { .onClick(() => {
this.sendEvent('Ctrl_' + item, this.baseEvent + index) this.sendEvent('Ctrl_' + item, this.baseEvent + index)
}) })
.key('SR000HQURK_Button_' + index) .key('ShortcutKey_Button_' + index)
}, item => item) }, item => item)
ForEach(this.functionKey, (item, index) => { ForEach(this.functionKey, (item, index) => {
...@@ -58,7 +58,7 @@ struct SR000HQURK { ...@@ -58,7 +58,7 @@ struct SR000HQURK {
this.sendEvent('Ctrl_' + item, this.baseEvent2 + index) this.sendEvent('Ctrl_' + item, this.baseEvent2 + index)
}) })
.width("80%") .width("80%")
.key('SR000HQURK2_Ctrl_' + item) .key('ShortcutKey2_Ctrl_' + item)
}, item => item) }, item => item)
Button("Shift+1") Button("Shift+1")
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import SR000HQURKTest from './SR000HQURK.test' import ShortcutKeyTest from './ShortcutKey.test'
export default function testsuite() { export default function testsuite() {
SR000HQURKTest() ShortcutKeyTest()
} }
\ No newline at end of file
...@@ -18,9 +18,9 @@ import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest' ...@@ -18,9 +18,9 @@ import {UiDriver, UiComponent, BY, Driver, Component, ON} from '@ohos.UiTest'
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
import input from '@ohos.multimodalInput.keyCode'; import input from '@ohos.multimodalInput.keyCode';
export default function SR000HQURKTest() { export default function ShortcutKeyTest() {
const SUITE = 'SR000HQURK' const SUITE = 'ShortcutKey'
function sleep(time) { function sleep(time) {
let date = new Date() let date = new Date()
let start = date.getSeconds() let start = date.getSeconds()
...@@ -99,16 +99,16 @@ export default function SR000HQURKTest() { ...@@ -99,16 +99,16 @@ export default function SR000HQURKTest() {
const baseEvent = 62000 const baseEvent = 62000
const baseEvent2 = 73000 const baseEvent2 = 73000
describe('SR000HQURKTest', function () { describe('ShortcutKeyTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
let options = { let options = {
url: "TestAbility/pages/SR000HQURK", url: "TestAbility/pages/ShortcutKey",
} }
try { try {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
if (pages == null || !("SR000HQURK" == pages.name)) { if (pages == null || !("ShortcutKey" == pages.name)) {
await router.pushUrl(options).then(()=>{ await router.pushUrl(options).then(()=>{
console.info(`${SUITE} router.pushUrl success`); console.info(`${SUITE} router.pushUrl success`);
}).catch(err => { }).catch(err => {
......
{ {
"src": [ "src": [
"TestAbility/pages/Index", "TestAbility/pages/Index",
"TestAbility/pages/SR000HQURK" "TestAbility/pages/ShortcutKey"
] ]
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册