diff --git a/README.md b/README.md index a9c1bcb06b70d826e78812103e90895fd7541f04..0841d63d399ebddc60de3b0e40a55cbc3d70c6db 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ │   └── arkts //模块 |      └── benchmark //用例内容 │   └── arkui //模块 -|      └── benchmark //用例内容 +|      └── benchMark_Component //组件BenchMark用例 ├── scenario //用户场景测试应用 │   └── arkui //模块 │      └── myshopping //测试hap diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets index a313d3a72add7fc74f33279a861c56d9943f2bd1..ac0e66acf74568e4472f71465c7dc2a9332baed0 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets @@ -19,7 +19,7 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component struct ColumnAlignSample { - timeHelper: TimeHelper = new TimeHelper('TextAlignSample'); + timeHelper: TimeHelper = new TimeHelper('ColumnAlignSample'); @State columnAlign: HorizontalAlign = HorizontalAlign.Center; build() { diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets index 7d81ae7682f476ed12fd44058186d64e4d11089f..0e7c4d92b3f42ffa9ac270ad907065c5b68bdba6 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets @@ -18,8 +18,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct columnSpaceMarginSample { - timeHelper: TimeHelper = new TimeHelper('columnSpaceMarginSample'); +struct ColumnSpaceMarginSample { + timeHelper: TimeHelper = new TimeHelper('ColumnSpaceMarginSample'); @State columnSpace: number = 20; @State columnMargin: number = 20; diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets index 01bf70bf1e556d5aa3cfdceb1059c66c9c878383..38ebd0d59d3c62d32495be1c1ec1ef45493c538d 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollDragSample { + timeHelper: TimeHelper = new TimeHelper('ScrollDragSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets index b09eb18210712596a57d059901c1ea5abb794ea8..b488ffdc72533f44278f71b06b23c624d4ef22ac 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets @@ -19,42 +19,53 @@ import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollEdgeEffectSample { + timeHelper: TimeHelper = new TimeHelper('ScrollEdgeEffectSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); - edgeEffect: EdgeEffect = EdgeEffect.Spring; - @State initEdgeEffect: EdgeEffect = EdgeEffect.Spring; + edgeEffect: EdgeEffect = EdgeEffect.None; + @State initEdgeEffect: EdgeEffect = EdgeEffect.None; isToEnd: boolean = false; aboutToAppear() { this.buttonName = (router.getParams() as Record)['buttonName']; this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); - this.edgeEffect = Number((router.getParams() as Record)['text']); - this.initEdgeEffect = Number((router.getParams() as Record)['text']) + 1; - if (this.initEdgeEffect == 3) { - this.initEdgeEffect = 0; - } } build() { Scroll() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { - Row() { - Button('Scroll EdgeEffect') - .id(this.buttonName) + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('ScrollEdgeEffectSpring') + .id('ScrollEdgeEffectSpring') .margin('5vp') .onClick(() => { - this.initEdgeEffect = this.edgeEffect + this.edgeEffect = EdgeEffect.Fade + this.initEdgeEffect = EdgeEffect.Spring + this.scroller.scrollEdge(Edge.End) + }) + Button('ScrollEdgeEffectFade') + .id('ScrollEdgeEffectFade') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.None + this.initEdgeEffect = EdgeEffect.Fade + this.scroller.scrollEdge(Edge.Top) + }) + Button('ScrollEdgeEffectNone') + .id('ScrollEdgeEffectNone') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.Spring + this.initEdgeEffect = EdgeEffect.None this.scroller.scrollEdge(Edge.End) }) }.width('100%') - Scroll(this.scroller) { Column() { ForEach(ArrEntity.arr, (index: number) => { - if (this.edgeEffect === this.initEdgeEffect && this.timeHelper.printTime(true, 1)) { + if (this.edgeEffect != this.initEdgeEffect && this.timeHelper.printTime(true, 1)) { } Column() .width('100%') @@ -156,7 +167,7 @@ struct Sample { .height(20) .margin(5) .backgroundColor(Color.Blue) - if (this.edgeEffect === this.initEdgeEffect && this.timeHelper.printTime(false, 1)) { + if (this.edgeEffect != this.initEdgeEffect && this.timeHelper.printTime(false, 1)) { } }, (item: number) => JSON.stringify(item)) @@ -166,7 +177,7 @@ struct Sample { .width('100%') .height('100%') .backgroundColor(Color.Red) - .edgeEffect(this.initEdgeEffect) + .edgeEffect(this.edgeEffect) } .width('100%') diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets index 5cbddebfe696db45e6d71729af476f26aa18fd4c..cad1221e2df894741593917a952bf5b4ed42d40e 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollEnableScrollInteractionSample { + timeHelper: TimeHelper = new TimeHelper('ScrollEnableScrollInteractionSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); @State changeValue: boolean = false; @@ -36,146 +36,152 @@ struct Sample { build() { Scroll() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { - Row() { - Button('change enableScrollInteraction:' + this.changeValue) - .id(this.buttonName) + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('false to true') + .id('ScrollEnableScrollInteractionFalseToTrue') .margin('5vp') .onClick(() => { - this.changeValue = !this.changeValue; + this.initBoolean = false; + this.changeValue = true; + this.scroller.scrollBy(200, 200); + }) + Button('true to false') + .id('ScrollEnableScrollInteractionTrueToFalse') + .margin('5vp') + .onClick(() => { + this.initBoolean = true; + this.changeValue = false; this.scroller.scrollBy(200, 200); }) }.width('100%') - Scroll(this.scroller) { - Column() { - ForEach(ArrEntity.arr, (index: number) => { - if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(true, 1)) { - } - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - - Column() - .width('100%') - .height(20) - .margin(5) - .backgroundColor(Color.Blue) - if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(false, 1)) { - } - }, (item: number) => JSON.stringify(item)) - } + ForEach(ArrEntity.arr, (index: number) => { + if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(true, 1)) { + } + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(false, 1)) { + } + }, (item: number) => JSON.stringify(item)) } .scrollable(ScrollDirection.Vertical) .width('100%') diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets index ed4936123a5363f9cc53ec96a40e1defab932b64..9c228151c53996f5574c4ab26b153ada1c0da026 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollHeightSample { + timeHelper: TimeHelper = new TimeHelper('ScrollHeightSample'); buttonName: string = ''; @State changeValue: number = 300; diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets index 1129d1bdbf984ed77cc866997bee0a39368b2bad..89556219737bbce17c579ac95a59648df05f2b21 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollMarginSample { + timeHelper: TimeHelper = new TimeHelper('ScrollMarginSample'); buttonName: string = ''; @State changeValue: number = 20; diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets index 707d09f82d473716029a569ea5964b5d0cde7504..b4eaeff431e74dbef444fbf11b24454a67ff44ea 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ScrollPaddingSample'); buttonName: string = ''; @State changeValue: number = 20; diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets index 5c68d8b5b5ff7313ff7b6d846151ddb854682d8b..b4e0ee7e697ee4c9f644d9918499d7564cc7835e 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollScrollBySample { + timeHelper: TimeHelper = new TimeHelper('ScrollScrollBySample'); buttonName: string = ''; scroller: Scroller = new Scroller(); diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets index faad55c7fbdd812a22d6769a7f220a2aeb8426ea..234e4358c707a60173ad926376bcbbf3bce2439f 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollScrollEdgeSample { + timeHelper: TimeHelper = new TimeHelper('ScrollScrollEdgeSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets index 3a42a644d8dda37a5337fccbbadcb629fbb82d3b..b786cfd4a6cee8524bf4f668eefce75f5ece5eba 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollScrollToSample { + timeHelper: TimeHelper = new TimeHelper('ScrollScrollToSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets index 557041cf5d916951386cd6c27c258bd3423b9d4f..6319317443107f5e586a6162dc0671bb5723e3d4 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollSlippageSample { + timeHelper: TimeHelper = new TimeHelper('ScrollSlippageSample'); buttonName: string = ''; scroller: Scroller = new Scroller(); diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets index 3ea3e168a3e9c92a8035d7ac50e419363104799d..c72877e53fb6abc7ef7945b5ca20fb8fe0347f54 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets @@ -19,8 +19,8 @@ import { TimeHelper } from '../../../util/TimeHelper' @Entry @Component -struct Sample { - timeHelper: TimeHelper = new TimeHelper('Sample'); +struct ScrollWidthSample { + timeHelper: TimeHelper = new TimeHelper('ScrollWidthSample'); buttonName: string = ''; @State changeValue: string = '80%'; diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets index fa010dd97a83f13a6ec5698f23bac3b0fe973217..937f0b6439736c5ba95c8ca65a62e654f3d7e3bb 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets @@ -17,13 +17,13 @@ * SwiperController控制页面滑动布局 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperControllerShowNextSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperControllerShowNextSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperControllerShowNextSample'); private swiperController: SwiperController = new SwiperController(); build() { @@ -38,12 +38,10 @@ struct SwiperControllerShowNextSample { }) }.width('100%') - // if (this.timeHelper.printTime(true)) { - // } - Swiper(this.swiperController) { ForEach(ArrEntity.arr, (index: number) => { - + if (this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') @@ -64,13 +62,10 @@ struct SwiperControllerShowNextSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') - + if (this.timeHelper.printTime(false)) { + } }) } - - // if (this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets index 5cac20b6b9e87372114ea7d49ac9885ee61f6cf5..680acf077998f3308fd5551f810d7b60830f978c 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets @@ -17,13 +17,13 @@ * Swiper组件curve属性更新,滑动布局耗时 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperCurveSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperCurveSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperCurveSample'); @State curve: Curve = Curve.Friction; build() { @@ -32,88 +32,99 @@ struct SwiperCurveSample { Button('change curve to Linear') .id('change curve to Linear') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Linear; }) Button('change curve to Ease') .id('change curve to Ease') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Ease; }) Button('change curve to EaseIn') .id('change curve to EaseIn') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.EaseIn; }) Button('change curve to EaseOut') .id('change curve to EaseOut') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.EaseOut; }) Button('change curve to EaseInOut') .id('change curve to EaseInOut') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.EaseInOut; }) Button('change curve to FastOutSlowIn') .id('change curve to FastOutSlowIn') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.FastOutSlowIn; }) Button('change curve to LinearOutSlowIn') .id('change curve to LinearOutSlowIn') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.LinearOutSlowIn; }) Button('change curve to FastOutLinearIn') .id('change curve to FastOutLinearIn') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.FastOutLinearIn; }) Button('change curve to ExtremeDeceleration') .id('change curve to ExtremeDeceleration') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.ExtremeDeceleration; }) Button('change curve to Sharp') .id('change curve to Sharp') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Sharp; }) Button('change curve to Rhythm') .id('change curve to Rhythm') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Rhythm; }) Button('change curve to Smooth') .id('change curve to Smooth') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Smooth; }) Button('change curve to Friction') .id('change curve to Friction') .margin('5vp') + .fontSize(px2fp(16)) .onClick(() => { this.curve = Curve.Friction; }) - // if (this.curve != null && this.timeHelper.printTime(true)) { - // } - Swiper() { ForEach(ArrEntity.arr, (index: number) => { - + if (this.curve != null && this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('30%') Text("" + index).width('100%').height('30%') Text("" + index).width('100%').height('30%') @@ -134,13 +145,11 @@ struct SwiperCurveSample { Text("" + index).width('100%').height('30%') Text("" + index).width('100%').height('30%') Text("" + index).width('100%').height('30%') - + if (this.curve != null && this.timeHelper.printTime(false)) { + } }) }.curve(this.curve) - // if (this.curve != null && this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets index 88107ad54003ae76b20d70caeee909f68b381396..a980a1df49294d21131682f0187badfb28b02e5c 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets @@ -17,13 +17,13 @@ * Swiper组件duration属性更新滑动布局耗时 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperDurationSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperDurationSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperDurationSample'); @State duration: number = 200; build() { @@ -38,11 +38,10 @@ struct SwiperDurationSample { }) }.width('100%') - // if (this.duration != null && this.timeHelper.printTime(true)) { - // } - Swiper() { ForEach(ArrEntity.arr, (index: number) => { + if (this.duration != null && this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') @@ -63,12 +62,10 @@ struct SwiperDurationSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') + if (this.duration != null && this.timeHelper.printTime(false)) { + } }) }.duration(this.duration) - - // if (this.duration != null && this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets index 83c7083285ff6b5f9f8fbf04a3339fbf276fe8fc..e594a2ad9bcf712ab2b057153ec5ea1791086aeb 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets @@ -17,13 +17,13 @@ * Swiper组件边缘滑动页面布局 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperEffectModeSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperEffectModeSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperEffectModeSample'); @State effectMode: EdgeEffect = EdgeEffect.None; build() { @@ -50,11 +50,10 @@ struct SwiperEffectModeSample { }) }.width('100%') - // if (this.effectMode != null && this.timeHelper.printTime(true)) { - // } - Swiper() { ForEach(ArrEntity.arr, (index: number) => { + if (this.effectMode != null && this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') @@ -75,15 +74,12 @@ struct SwiperEffectModeSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') + if (this.effectMode != null && this.timeHelper.printTime(false)) { + } }) } .loop(false) .effectMode(this.effectMode) - - - // if (this.effectMode != null && this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets index 93f9ee26de7dddd398ab29b74e58cf521253bed4..4e72a1241d20aa9ddebafa2ba9082799f2338512 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets @@ -17,13 +17,13 @@ * Swiper组件自动轮播页面滑动布局 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperLoopSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperLoopSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperLoopSample'); @State loop: boolean = false; build() { @@ -38,11 +38,10 @@ struct SwiperLoopSample { }) }.width('100%') - // if (this.loop != null && this.timeHelper.printTime(true)) { - // } - Swiper() { ForEach(ArrEntity.arr, (index: number) => { + if (this.loop != null && this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') @@ -63,12 +62,10 @@ struct SwiperLoopSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') + if (this.loop != null && this.timeHelper.printTime(false)) { + } }) }.loop(this.loop) - - // if (this.loop != null && this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets index 7d3f7a161d487c206a876b8d4a36eb26ac7cb824..84f78223c8e297c9b5dd26940f4886929ac21e3e 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets @@ -17,23 +17,21 @@ * 手指滑动页面布局耗时 */ -import { ArrEntity } from '../../../entity/ArrEntity' -import { TimeHelper } from '../../../util/TimeHelper' +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; @Entry @Component struct SwiperManualSlidingSample { - // timeHelper: TimeHelper = new TimeHelper('SwiperManualSlidingSample'); + timeHelper: TimeHelper = new TimeHelper('SwiperManualSlidingSample'); build() { Scroll() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { - - // if (this.timeHelper.printTime(true)) { - // } - Swiper() { ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') @@ -54,12 +52,10 @@ struct SwiperManualSlidingSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') + if (this.timeHelper.printTime(false)) { + } }) } - - // if (this.timeHelper.printTime(false)) { - // } - } .width('100%') }.margin({ bottom: 60 }) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets index f77a2c32ae5ef15e9460f26c396a8a7de772bf4f..2d4071dba020b2f586e95b37ea35e775fe726165 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets @@ -64,7 +64,7 @@ struct SwiperVerticalSample { Text("" + index).width('100%').height('80%') Text("" + index).width('100%').height('80%') - if (this.swiperVertical != null && this.timeHelper.printTime(false)) { + if (this.swiperVertical && this.timeHelper.printTime(false)) { } }) }.vertical(this.swiperVertical) diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets index f9b94d8a9cf9096b7573afc8268bccfde090ee3e..0f97fa25231d577a81279eb68b24882eaf37c0a4 100644 --- a/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets @@ -31,14 +31,11 @@ export let ScrollUrlClass: UrlClass[] = [ new UrlClass('ScrollHeight', 'pages/container/scroll/ScrollHeightSample', ''), new UrlClass('ScrollPadding', 'pages/container/scroll/ScrollPaddingSample', ''), new UrlClass('ScrollMargin', 'pages/container/scroll/ScrollMarginSample', ''), - new UrlClass('ScrollEnableScrollInteractionTrueToFalse', 'pages/container/scroll/ScrollEnableScrollInteractionSample', 'true'), - new UrlClass('ScrollEnableScrollInteractionFalseToTrue', 'pages/container/scroll/ScrollEnableScrollInteractionSample', 'false'), + new UrlClass('ScrollEnableScrollInteraction', 'pages/container/scroll/ScrollEnableScrollInteractionSample', 'false'), new UrlClass('ScrollDrag', 'pages/container/scroll/ScrollDragSample', ''), new UrlClass('ScrollSlippage', 'pages/container/scroll/ScrollSlippageSample', ''), new UrlClass('ScrollScrollTo', 'pages/container/scroll/ScrollScrollToSample', ''), new UrlClass('ScrollScrollEdge', 'pages/container/scroll/ScrollScrollEdgeSample', ''), - new UrlClass('ScrollEdgeEffectSpring', 'pages/container/scroll/ScrollEdgeEffectSample', '0'), - new UrlClass('ScrollEdgeEffectFade', 'pages/container/scroll/ScrollEdgeEffectSample', '1'), - new UrlClass('ScrollEdgeEffectNone', 'pages/container/scroll/ScrollEdgeEffectSample', '2'), + new UrlClass('ScrollEdgeEffect', 'pages/container/scroll/ScrollEdgeEffectSample', ''), new UrlClass('ScrollScrollBy', 'pages/container/scroll/ScrollScrollBySample', ''), ] \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Ability.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Ability.test.ets index 5ebeaa432e5526066d2e18d8b65276d286383efe..6b12bdd8cb294727a56a2cca230ec4b7947c8c07 100644 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Ability.test.ets @@ -17,13 +17,12 @@ import hilog from '@ohos.hilog'; import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import { Driver, ON } from '@ohos.UiTest'; -import { KeyCode } from '@ohos.multimodalInput.keyCode'; const driver = Driver.create(); let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); //通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { +async function checkButtonAndClickWithID(text: string, delayTime: number = 3000) { let idName = text; await driver.assertComponentExist(ON.id(idName)); let button = await driver.findComponent(ON.id(idName)); @@ -35,7 +34,7 @@ async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) async function pressBack() { await driver.pressBack(); - await driver.delayMs(1000); + await driver.delayMs(3000); } export default function abilityTest() { @@ -69,11 +68,9 @@ export default function abilityTest() { hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); }) - /** - * 点击首页Text - */ + //点击首页Text it(`TextBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Text'); //创建Text组件 await checkButtonAndClickWithID('TextCreate10Char'); @@ -82,236 +79,236 @@ export default function abilityTest() { // await checkButtonAndClickWithID('TextCreate100Char'); // await driver.delayMs(1000); // await pressBack(); - // //改变Align - // await checkButtonAndClickWithID('TextAlign10char'); - // await checkButtonAndClickWithID('TextAlign.Start'); - // await checkButtonAndClickWithID('TextAlign.Center'); - // await checkButtonAndClickWithID('TextAlign.End'); - // await pressBack(); + //改变Align + await checkButtonAndClickWithID('TextAlign10char'); + await checkButtonAndClickWithID('TextAlign.Start'); + await checkButtonAndClickWithID('TextAlign.Center'); + await checkButtonAndClickWithID('TextAlign.End'); + await pressBack(); // await checkButtonAndClickWithID('TextAlign100Char'); // await checkButtonAndClickWithID('TextAlign.Start'); // await checkButtonAndClickWithID('TextAlign.Center'); // await checkButtonAndClickWithID('TextAlign.End'); // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('TextWidth10Char'); - // await checkButtonAndClickWithID('TextChangeWidth'); - // await pressBack(); + //改变width + await checkButtonAndClickWithID('TextWidth10Char'); + await checkButtonAndClickWithID('TextChangeWidth'); + await pressBack(); // await checkButtonAndClickWithID('TextWidth100Char'); // await checkButtonAndClickWithID('TextChangeWidth'); // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('TextHeight10Char'); - // await checkButtonAndClickWithID('TextChangeHeight'); - // await pressBack(); + //改变height + await checkButtonAndClickWithID('TextHeight10Char'); + await checkButtonAndClickWithID('TextChangeHeight'); + await pressBack(); // await checkButtonAndClickWithID('TextHeight100Char'); // await checkButtonAndClickWithID('TextChangeHeight'); // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('TextPadding10Char'); - // await checkButtonAndClickWithID('TextChangePadding'); - // await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextPadding10Char'); + await checkButtonAndClickWithID('TextChangePadding'); + await pressBack(); // await checkButtonAndClickWithID('TextPadding100Char'); // await checkButtonAndClickWithID('TextChangePadding'); // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('TextMargin10Char'); - // await checkButtonAndClickWithID('TextChangeMargin'); - // await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TextMargin10Char'); + await checkButtonAndClickWithID('TextChangeMargin'); + await pressBack(); // await checkButtonAndClickWithID('TextMargin100Char'); // await checkButtonAndClickWithID('TextChangeMargin'); // await pressBack(); - // //改变Font - // await checkButtonAndClickWithID('TextFont10Char'); - // await checkButtonAndClickWithID('TextChangeFont'); - // await pressBack(); + //改变Font + await checkButtonAndClickWithID('TextFont10Char'); + await checkButtonAndClickWithID('TextChangeFont'); + await pressBack(); // await checkButtonAndClickWithID('TextFont100Char'); // await checkButtonAndClickWithID('TextChangeFont'); // await pressBack(); - // //改变Text文本长度 - // await checkButtonAndClickWithID('TextContent10Char'); - // await checkButtonAndClickWithID('TextChangeContent'); - // await pressBack(); + //改变Text文本长度 + await checkButtonAndClickWithID('TextContent10Char'); + await checkButtonAndClickWithID('TextChangeContent'); + await pressBack(); // await checkButtonAndClickWithID('TextContent100Char'); // await checkButtonAndClickWithID('TextChangeContent'); // await pressBack(); - // //改变TextIndent - // await checkButtonAndClickWithID('TextTextIndent10Char'); - // await checkButtonAndClickWithID('TextChangeTextIndent'); - // await pressBack(); + //改变TextIndent + await checkButtonAndClickWithID('TextTextIndent10Char'); + await checkButtonAndClickWithID('TextChangeTextIndent'); + await pressBack(); // await checkButtonAndClickWithID('TextTextIndent100Char'); // await checkButtonAndClickWithID('TextChangeTextIndent'); // await pressBack(); - // //改变TextCase - // await checkButtonAndClickWithID('TextTextCase10Char'); - // await checkButtonAndClickWithID('TextChangeTextCase'); - // await pressBack(); + //改变TextCase + await checkButtonAndClickWithID('TextTextCase10Char'); + await checkButtonAndClickWithID('TextChangeTextCase'); + await pressBack(); // await checkButtonAndClickWithID('TextTextCase100Char'); // await checkButtonAndClickWithID('TextChangeTextCase'); // await pressBack(); - // //改变LetterSpacing - // await checkButtonAndClickWithID('TextLetterSpacing10Char'); - // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); - // await pressBack(); + //改变LetterSpacing + await checkButtonAndClickWithID('TextLetterSpacing10Char'); + await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); + await pressBack(); // await checkButtonAndClickWithID('TextLetterSpacing100Char'); // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); // await pressBack(); - // //改变BaselineOffset - // await checkButtonAndClickWithID('TextBaselineOffset10Char'); - // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - // await pressBack(); + //改变BaselineOffset + await checkButtonAndClickWithID('TextBaselineOffset10Char'); + await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + await pressBack(); // await checkButtonAndClickWithID('TextBaselineOffset100Char'); // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); // await pressBack(); - // // 改变TextBaselineOffset - // await checkButtonAndClickWithID('TextLineHeight10Char'); - // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - // await pressBack(); + await driver.swipe(360, 1100, 360, 300, 40000) + // 改变TextBaselineOffset + await checkButtonAndClickWithID('TextLineHeight10Char'); + await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + await pressBack(); // await checkButtonAndClickWithID('TextLineHeight100Char'); // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); // await pressBack(); // await driver.swipe(360, 1100, 360, 500, 200) - // //改变TextChangeMaxLines - // await checkButtonAndClickWithID('TextMaxLines10Char'); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextChangeMaxLines'); - // await driver.delayMs(1000); - // await pressBack(); + //改变TextChangeMaxLines + await checkButtonAndClickWithID('TextMaxLines10Char'); + await checkButtonAndClickWithID('TextChangeMaxLines'); + await pressBack(); // await checkButtonAndClickWithID('TextMaxLines100Char'); // await checkButtonAndClickWithID('TextChangeMaxLines'); // await pressBack(); - // //改变Overflow - // await checkButtonAndClickWithID('TextOverflow10Char'); - // await checkButtonAndClickWithID('TextChangeOverflow'); - // await pressBack(); + //改变Overflow + await checkButtonAndClickWithID('TextOverflow10Char'); + await checkButtonAndClickWithID('TextChangeOverflow'); + await pressBack(); // await checkButtonAndClickWithID('TextOverflow100Char'); // await checkButtonAndClickWithID('TextChangeOverflow'); // await pressBack(); - // //改变heightAdaptivePolicy maxLine - // await checkButtonAndClickWithID('heightAdaptivePolicyOne10Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); - // await pressBack(); + //改变heightAdaptivePolicy maxLine + await checkButtonAndClickWithID('heightAdaptivePolicyOne10Char'); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); + await pressBack(); // await checkButtonAndClickWithID('heightAdaptivePolicyOne100Char'); // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); // await pressBack(); - // //改变heightAdaptivePolicy minfontSize - // await checkButtonAndClickWithID('heightAdaptivePolicyTwo10Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); - // await pressBack(); + //改变heightAdaptivePolicy minfontSize + await driver.delayMs(1000); + await checkButtonAndClickWithID('heightAdaptivePolicyTwo10Char'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); + await driver.delayMs(1000); + await pressBack(); // await checkButtonAndClickWithID('heightAdaptivePolicyTwo100Char'); // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); // await pressBack(); - // //改变heightAdaptivePolicy content - // await checkButtonAndClickWithID('heightAdaptivePolicyThree10Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); - // await pressBack(); + //改变heightAdaptivePolicy content + await driver.delayMs(1000); + await checkButtonAndClickWithID('heightAdaptivePolicyThree10Char'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); + await driver.delayMs(3000); + await pressBack(); // await checkButtonAndClickWithID('heightAdaptivePolicyThree100Char'); // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); // await pressBack(); + await driver.delayMs(3000); await pressBack(); //返回首页 }) - /** - * 点击首页GridRow - */ + //点击首页GridRow it(`GridRowBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('GridRow'); await checkButtonAndClickWithID('GridRowCreate'); await pressBack(); - // await checkButtonAndClickWithID('GridRowWidth'); - // await checkButtonAndClickWithID('GridRowWidth'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowHeight'); - // await checkButtonAndClickWithID('GridRowHeight'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowPadding'); - // await checkButtonAndClickWithID('GridRowPadding'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowMargin'); - // await checkButtonAndClickWithID('GridRowMargin'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowColumns'); - // await checkButtonAndClickWithID('GridRowColumns'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowGutter'); - // await checkButtonAndClickWithID('GridRowGutter'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowDirection'); - // await checkButtonAndClickWithID('GridRowDirection'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridRowBreakpoints'); - // await checkButtonAndClickWithID('GridRowBreakpoints'); - // await pressBack(); + await checkButtonAndClickWithID('GridRowWidth'); + await checkButtonAndClickWithID('GridRowWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowHeight'); + await checkButtonAndClickWithID('GridRowHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowPadding'); + await checkButtonAndClickWithID('GridRowPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowMargin'); + await checkButtonAndClickWithID('GridRowMargin'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowColumns'); + await checkButtonAndClickWithID('GridRowColumns'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowGutter'); + await checkButtonAndClickWithID('GridRowGutter'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowDirection'); + await checkButtonAndClickWithID('GridRowDirection'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowBreakpoints'); + await checkButtonAndClickWithID('GridRowBreakpoints'); + await pressBack(); await pressBack(); }) - /** - * 点击首页GridCol - */ + //点击首页GridCol it(`GridColBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('GridCol'); await checkButtonAndClickWithID('GridColCreate'); await pressBack(); - // await checkButtonAndClickWithID('GridColOptionSpan'); - // await checkButtonAndClickWithID('GridColOptionSpan'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColOptionOffset'); - // await checkButtonAndClickWithID('GridColOptionOffset'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColOptionOrder'); - // await checkButtonAndClickWithID('GridColOptionOrder'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColSpan'); - // await checkButtonAndClickWithID('GridColSpan'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColOffset'); - // await checkButtonAndClickWithID('GridColOffset'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColOrder'); - // await checkButtonAndClickWithID('GridColOrder'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColWidth'); - // await checkButtonAndClickWithID('GridColWidth'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColHeight'); - // await checkButtonAndClickWithID('GridColHeight'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColPadding'); - // await checkButtonAndClickWithID('GridColPadding'); - // await pressBack(); - // - // await checkButtonAndClickWithID('GridColMargin'); - // await checkButtonAndClickWithID('GridColMargin'); - // await pressBack(); + await checkButtonAndClickWithID('GridColOptionSpan'); + await checkButtonAndClickWithID('GridColOptionSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOffset'); + await checkButtonAndClickWithID('GridColOptionOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOrder'); + await checkButtonAndClickWithID('GridColOptionOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColSpan'); + await checkButtonAndClickWithID('GridColSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOffset'); + await checkButtonAndClickWithID('GridColOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOrder'); + await checkButtonAndClickWithID('GridColOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColWidth'); + await checkButtonAndClickWithID('GridColWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridColHeight'); + await checkButtonAndClickWithID('GridColHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridColPadding'); + await checkButtonAndClickWithID('GridColPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridColMargin'); + await checkButtonAndClickWithID('GridColMargin'); + await pressBack(); await pressBack(); }) - /** - * 点击首页TextInput - */ + //点击首页TextInput it(`TextInputBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('TextInput'); //创建TextInput组件 await checkButtonAndClickWithID('TextInputCreate10Char'); @@ -321,58 +318,58 @@ export default function abilityTest() { // await checkButtonAndClickWithID('TextInputCreate100Char'); // await driver.delayMs(1000); // await pressBack(); - // - // //改变width - // await checkButtonAndClickWithID('TextInputWidth10Char'); - // await checkButtonAndClickWithID('TextInputChangeWidth'); - // await pressBack(); + + //改变width + await checkButtonAndClickWithID('TextInputWidth10Char'); + await checkButtonAndClickWithID('TextInputChangeWidth'); + await pressBack(); // await checkButtonAndClickWithID('TextInputWidth100Char'); // await checkButtonAndClickWithID('TextInputChangeWidth'); // await pressBack(); - // - // //改变height - // await checkButtonAndClickWithID('TextInputHeight10Char'); - // await checkButtonAndClickWithID('TextInputChangeHeight'); - // await pressBack(); + + //改变height + await checkButtonAndClickWithID('TextInputHeight10Char'); + await checkButtonAndClickWithID('TextInputChangeHeight'); + await pressBack(); // await checkButtonAndClickWithID('TextInputHeight100Char'); // await checkButtonAndClickWithID('TextInputChangeHeight'); // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('TextInputPadding10Char'); - // await checkButtonAndClickWithID('TextInputChangePadding'); - // await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextInputPadding10Char'); + await checkButtonAndClickWithID('TextInputChangePadding'); + await pressBack(); // await checkButtonAndClickWithID('TextInputPadding100Char'); // await checkButtonAndClickWithID('TextInputChangePadding'); // await pressBack(); - // - // //改变Margin - // await checkButtonAndClickWithID('TextInputMargin10Char'); - // await checkButtonAndClickWithID('TextInputChangeMargin'); - // await pressBack(); + + //改变Margin + await checkButtonAndClickWithID('TextInputMargin10Char'); + await checkButtonAndClickWithID('TextInputChangeMargin'); + await pressBack(); // await checkButtonAndClickWithID('TextInputMargin100Char'); // await checkButtonAndClickWithID('TextInputChangeMargin'); // await pressBack(); - // - // //改变Align - // await checkButtonAndClickWithID('TextInputAlign10Char'); - // await checkButtonAndClickWithID('TextInputAlign.Start'); - // await checkButtonAndClickWithID('TextInputAlign.Center'); - // await checkButtonAndClickWithID('TextInputAlign.End'); - // await pressBack(); + + //改变Align + await checkButtonAndClickWithID('TextInputAlign10Char'); + await checkButtonAndClickWithID('TextInputAlign.Start'); + await checkButtonAndClickWithID('TextInputAlign.Center'); + await checkButtonAndClickWithID('TextInputAlign.End'); + await pressBack(); // await checkButtonAndClickWithID('TextInputAlign100Char'); // await checkButtonAndClickWithID('TextInputAlign.Start'); // await checkButtonAndClickWithID('TextInputAlign.Center'); // await checkButtonAndClickWithID('TextInputAlign.End'); // await pressBack(); - // - // //改变InputType - // await checkButtonAndClickWithID('TextInputType10Char'); - // await checkButtonAndClickWithID('TextInputType.Norma'); - // await checkButtonAndClickWithID('TextInputType.Password'); - // await checkButtonAndClickWithID('TextInputType.Email'); - // await checkButtonAndClickWithID('TextInputType.Number'); - // await checkButtonAndClickWithID('TextInputType.PhoneNumber'); - // await pressBack(); + + //改变InputType + await checkButtonAndClickWithID('TextInputType10Char'); + await checkButtonAndClickWithID('TextInputType.Norma'); + await checkButtonAndClickWithID('TextInputType.Password'); + await checkButtonAndClickWithID('TextInputType.Email'); + await checkButtonAndClickWithID('TextInputType.Number'); + await checkButtonAndClickWithID('TextInputType.PhoneNumber'); + await pressBack(); // await checkButtonAndClickWithID('TextInputType100Char'); // await checkButtonAndClickWithID('TextInputType.Norma'); // await checkButtonAndClickWithID('TextInputType.Password'); @@ -384,119 +381,103 @@ export default function abilityTest() { await pressBack(); //返回首页 }) - /** - * 点击首页Image - */ + //点击首页Image it(`ImageBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Image'); - await checkButtonAndClickWithID('ImageCreate'); await pressBack(); - - // await checkButtonAndClickWithID('ImageWidth'); - // await checkButtonAndClickWithID('ImageWidth'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageHeight'); - // await checkButtonAndClickWithID('ImageHeight'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImagePadding'); - // await checkButtonAndClickWithID('ImagePadding'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageMargin'); - // await checkButtonAndClickWithID('ImageMargin'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageObjectFit'); - // await checkButtonAndClickWithID('ImageObjectFit_Contain'); - // await checkButtonAndClickWithID('ImageObjectFit_Cover'); - // await checkButtonAndClickWithID('ImageObjectFit_Auto'); - // await checkButtonAndClickWithID('ImageObjectFit_Fill'); - // await checkButtonAndClickWithID('ImageObjectFit_ScaleDown'); - // await checkButtonAndClickWithID('ImageObjectFit_None'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageObjectRepeat'); - // await checkButtonAndClickWithID('ImageObjectRepeat_X'); - // await checkButtonAndClickWithID('ImageObjectRepeat_Y'); - // await checkButtonAndClickWithID('ImageObjectRepeat_XY'); - // await checkButtonAndClickWithID('ImageObjectRepeat_NoRepeat'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageAutoResize'); - // await checkButtonAndClickWithID('ImageAutoResize'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageInterpolation'); - // await checkButtonAndClickWithID('ImageInterpolation_None'); - // await checkButtonAndClickWithID('ImageInterpolation_High'); - // await checkButtonAndClickWithID('ImageInterpolation_Medium'); - // await checkButtonAndClickWithID('ImageInterpolation_Low'); - // await pressBack(); - // - // await checkButtonAndClickWithID('ImageFitOriginalSize'); - // await checkButtonAndClickWithID('ImageFitOriginalSize'); - // await pressBack(); + await checkButtonAndClickWithID('ImageWidth'); + await checkButtonAndClickWithID('ImageWidth'); + await pressBack(); + await checkButtonAndClickWithID('ImageHeight'); + await checkButtonAndClickWithID('ImageHeight'); + await pressBack(); + await checkButtonAndClickWithID('ImagePadding'); + await checkButtonAndClickWithID('ImagePadding'); + await pressBack(); + await checkButtonAndClickWithID('ImageMargin'); + await checkButtonAndClickWithID('ImageMargin'); + await pressBack(); + await checkButtonAndClickWithID('ImageObjectFit'); + await checkButtonAndClickWithID('ImageObjectFit_Contain'); + await checkButtonAndClickWithID('ImageObjectFit_Cover'); + await checkButtonAndClickWithID('ImageObjectFit_Auto'); + await checkButtonAndClickWithID('ImageObjectFit_Fill'); + await checkButtonAndClickWithID('ImageObjectFit_ScaleDown'); + await checkButtonAndClickWithID('ImageObjectFit_None'); + await pressBack(); + await checkButtonAndClickWithID('ImageObjectRepeat'); + await checkButtonAndClickWithID('ImageObjectRepeat_X'); + await checkButtonAndClickWithID('ImageObjectRepeat_Y'); + await checkButtonAndClickWithID('ImageObjectRepeat_XY'); + await checkButtonAndClickWithID('ImageObjectRepeat_NoRepeat'); + await pressBack(); + await checkButtonAndClickWithID('ImageAutoResize'); + await checkButtonAndClickWithID('ImageAutoResize'); + await pressBack(); + await checkButtonAndClickWithID('ImageInterpolation'); + await checkButtonAndClickWithID('ImageInterpolation_None'); + await checkButtonAndClickWithID('ImageInterpolation_High'); + await checkButtonAndClickWithID('ImageInterpolation_Medium'); + await checkButtonAndClickWithID('ImageInterpolation_Low'); + await pressBack(); + await checkButtonAndClickWithID('ImageFitOriginalSize'); + await checkButtonAndClickWithID('ImageFitOriginalSize'); + await pressBack(); await pressBack(); }) - /** - * 点击首页Row - */ + //点击首页Row it(`RowBenchMarkTest`, 0, async () => { await driver.delayMs(1000); await checkButtonAndClickWithID('Row'); //创建Row组件 await checkButtonAndClickWithID('RowCreate'); await pressBack(); - // //改变width - // await checkButtonAndClickWithID('RowWidth'); - // await checkButtonAndClickWithID('RowChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('RowHeight'); - // await checkButtonAndClickWithID('RowChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('RowPadding'); - // await checkButtonAndClickWithID('RowChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('RowMargin'); - // await checkButtonAndClickWithID('RowChangeMargin'); - // await pressBack(); - // //改变space - // await checkButtonAndClickWithID('RowSpace'); - // await checkButtonAndClickWithID('RowChangeSpace'); - // await pressBack(); - // //改变magin space - // await checkButtonAndClickWithID('RowMarginSpace'); - // await checkButtonAndClickWithID('RowChangeMarginSpace'); - // await pressBack(); - // //改变Aligin - // await checkButtonAndClickWithID('RowAlign'); - // await checkButtonAndClickWithID('VerticalAlign.Top'); - // await checkButtonAndClickWithID('VerticalAlign.Center'); - // await checkButtonAndClickWithID('VerticalAlign.Bottom'); - // await pressBack(); - // //改变JustifyContent - // await checkButtonAndClickWithID('RowJustify'); - // await checkButtonAndClickWithID('FlexAlign.Start'); - // await checkButtonAndClickWithID('FlexAlign.Center'); - // await checkButtonAndClickWithID('FlexAlign.End'); - // await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); - // await checkButtonAndClickWithID('FlexAlign.SpaceAround'); - // await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); - // await pressBack(); + //改变width + await checkButtonAndClickWithID('RowWidth'); + await checkButtonAndClickWithID('RowChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('RowHeight'); + await checkButtonAndClickWithID('RowChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('RowPadding'); + await checkButtonAndClickWithID('RowChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('RowMargin'); + await checkButtonAndClickWithID('RowChangeMargin'); + await pressBack(); + //改变space + await checkButtonAndClickWithID('RowSpace'); + await checkButtonAndClickWithID('RowChangeSpace'); + await pressBack(); + //改变magin space + await checkButtonAndClickWithID('RowMarginSpace'); + await checkButtonAndClickWithID('RowChangeMarginSpace'); + await pressBack(); + //改变Aligin + await checkButtonAndClickWithID('RowAlign'); + await checkButtonAndClickWithID('VerticalAlign.Top'); + await checkButtonAndClickWithID('VerticalAlign.Center'); + await checkButtonAndClickWithID('VerticalAlign.Bottom'); + await pressBack(); + //改变JustifyContent + await checkButtonAndClickWithID('RowJustify'); + await checkButtonAndClickWithID('FlexAlign.Start'); + await checkButtonAndClickWithID('FlexAlign.Center'); + await checkButtonAndClickWithID('FlexAlign.End'); + await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + await pressBack(); await pressBack(); //返回首页 }) - /** - * 点击首页Column - */ + //点击首页Column it(`ColumnBenchMarkTest`, 0, async () => { await driver.delayMs(1000); await checkButtonAndClickWithID('Column'); @@ -504,52 +485,50 @@ export default function abilityTest() { await checkButtonAndClickWithID('ColumnCreate'); await pressBack(); //改变width - // await checkButtonAndClickWithID('ColumnWidth'); - // await checkButtonAndClickWithID('ColumnChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('ColumnHeight'); - // await checkButtonAndClickWithID('ColumnChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('ColumnPadding'); - // await checkButtonAndClickWithID('ColumnChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('ColumnMargin'); - // await checkButtonAndClickWithID('ColumnChangeMargin'); - // await pressBack(); - // //改变space - // await checkButtonAndClickWithID('ColumnSpace'); - // await checkButtonAndClickWithID('ColumnChangeSpace'); - // await pressBack(); - // //改变magin space - // await checkButtonAndClickWithID('ColumnMarginSpace'); - // await checkButtonAndClickWithID('ColumnChangeMarginSpace'); - // await pressBack(); - // //改变Aligin - // await checkButtonAndClickWithID('ColumnAlign'); - // await checkButtonAndClickWithID('HorizontalAlign.Start'); - // await checkButtonAndClickWithID('HorizontalAlign.Center'); - // await checkButtonAndClickWithID('HorizontalAlign.End'); - // await pressBack(); - // //改变JustifyContent - // await checkButtonAndClickWithID('ColumnJustify'); - // await checkButtonAndClickWithID('FlexAlign.Start'); - // await checkButtonAndClickWithID('FlexAlign.Center'); - // await checkButtonAndClickWithID('FlexAlign.End'); - // await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); - // await checkButtonAndClickWithID('FlexAlign.SpaceAround'); - // await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); - // await pressBack(); + await checkButtonAndClickWithID('ColumnWidth'); + await checkButtonAndClickWithID('ColumnChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('ColumnHeight'); + await checkButtonAndClickWithID('ColumnChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('ColumnPadding'); + await checkButtonAndClickWithID('ColumnChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('ColumnMargin'); + await checkButtonAndClickWithID('ColumnChangeMargin'); + await pressBack(); + //改变space + await checkButtonAndClickWithID('ColumnSpace'); + await checkButtonAndClickWithID('ColumnChangeSpace'); + await pressBack(); + //改变magin space + await checkButtonAndClickWithID('ColumnMarginSpace'); + await checkButtonAndClickWithID('ColumnChangeMarginSpace'); + await pressBack(); + //改变Aligin + await checkButtonAndClickWithID('ColumnAlign'); + await checkButtonAndClickWithID('HorizontalAlign.Start'); + await checkButtonAndClickWithID('HorizontalAlign.Center'); + await checkButtonAndClickWithID('HorizontalAlign.End'); + await pressBack(); + //改变JustifyContent + await checkButtonAndClickWithID('ColumnJustify'); + await checkButtonAndClickWithID('FlexAlign.Start'); + await checkButtonAndClickWithID('FlexAlign.Center'); + await checkButtonAndClickWithID('FlexAlign.End'); + await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + await pressBack(); await pressBack(); //返回首页 }) - /** - * 点击首页List - */ + //点击首页List it(`ListBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('List'); await checkButtonAndClickWithID('ListCreate'); @@ -704,177 +683,162 @@ export default function abilityTest() { await pressBack(); }) - /** - * 点击首页Scroll - */ + //点击首页Scroll it(`ScrollBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Scroll'); //创建Scroll组件 await checkButtonAndClickWithID('ScrollCreate'); await pressBack(); //改变width - // await checkButtonAndClickWithID('ScrollWidth'); - // await checkButtonAndClickWithID('ScrollWidth'); - // await pressBack(); - // - // //改变height - // await checkButtonAndClickWithID('ScrollHeight'); - // await checkButtonAndClickWithID('ScrollHeight'); - // await pressBack(); - // - // //改变Padding - // await checkButtonAndClickWithID('ScrollPadding'); - // await checkButtonAndClickWithID('ScrollPadding'); - // await pressBack(); - // - // //改变Margin - // await checkButtonAndClickWithID('ScrollMargin'); - // await checkButtonAndClickWithID('ScrollMargin'); - // await pressBack(); - // - // - // //改变EnableScrollInteraction - // await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); - // await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + await checkButtonAndClickWithID('ScrollWidth'); + await checkButtonAndClickWithID('ScrollWidth'); + await pressBack(); + + //改变height + await checkButtonAndClickWithID('ScrollHeight'); + await checkButtonAndClickWithID('ScrollHeight'); + await pressBack(); + + //改变Padding + await checkButtonAndClickWithID('ScrollPadding'); + await checkButtonAndClickWithID('ScrollPadding'); + await pressBack(); + + //改变Margin + await checkButtonAndClickWithID('ScrollMargin'); + await checkButtonAndClickWithID('ScrollMargin'); + await pressBack(); + + //改变EnableScrollInteraction + await checkButtonAndClickWithID('ScrollEnableScrollInteraction'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); // await pressBack(); - // - // await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); // await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); - // await pressBack(); - // - // //拖动场景下Scroll组件更新布局耗时 - // await checkButtonAndClickWithID('ScrollDrag'); - // await driver.fling({ - // x: 100, y: 1100 - // }, { - // x: 100, y: 500 - // }, 100, 100) - // await pressBack(); - // - // //抛滑场景下Scroll组件更新布局耗时 - // await checkButtonAndClickWithID('ScrollSlippage'); - // await driver.fling({ - // x: 100, y: 1100 - // }, { - // x: 100, y: 500 - // }, 100, 600) - // await pressBack(); - // //Scroll组件调用scrollTo触发页面跳转布局 - // await checkButtonAndClickWithID('ScrollScrollTo'); - // await checkButtonAndClickWithID('ScrollScrollTo'); - // await pressBack(); - // //Scroll组件调用scrollEdge触发页面跳转布局 - // await checkButtonAndClickWithID('ScrollScrollEdge'); - // await checkButtonAndClickWithID('ScrollScrollEdge'); - // await pressBack(); - // //Scroll组件edgeEffect属性更新布局耗时 - // await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - // await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - // await driver.swipe(100, 1100, 100, 500, 200) - // await pressBack(); - // - // - // await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - // await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - // await driver.swipe(100, 1100, 100, 500, 200) - // await pressBack(); - // - // await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - // await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - // await driver.swipe(100, 1100, 100, 500, 200) - // await pressBack(); - // - // //Scroll组件调用scrollBy触发页面跳转布局 - // await checkButtonAndClickWithID('ScrollScrollBy'); - // await checkButtonAndClickWithID('ScrollScrollBy'); - // await pressBack(); + await pressBack(); + + //拖动场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollDrag'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + + //抛滑场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollSlippage'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 600) + await pressBack(); + //Scroll组件调用scrollTo触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollTo'); + await checkButtonAndClickWithID('ScrollScrollTo'); + await pressBack(); + //Scroll组件调用scrollEdge触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollEdge'); + await checkButtonAndClickWithID('ScrollScrollEdge'); + await pressBack(); + //Scroll组件edgeEffect属性更新布局耗时 + await checkButtonAndClickWithID('ScrollEdgeEffect'); + await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + await driver.swipe(100, 1100, 100, 500, 200) + await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + await driver.swipe(100, 500, 100, 1100, 200) + await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + //Scroll组件调用scrollBy触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollBy'); + await checkButtonAndClickWithID('ScrollScrollBy'); + await pressBack(); await pressBack(); //返回首页 }) - /** - * 点击首页Tab - */ + //点击首页Tab it(`TabsBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Tabs'); //创建Tab组件 await checkButtonAndClickWithID('TabsCreate'); await pressBack(); //改变width - // await checkButtonAndClickWithID('TabsWidth'); - // await checkButtonAndClickWithID('TabChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('TabsHeight'); - // await checkButtonAndClickWithID('TabsChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('TabsPadding'); - // await checkButtonAndClickWithID('TabsChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('TabsMargin'); - // await checkButtonAndClickWithID('TabsChangeMargin'); - // await pressBack(); - // //改变Vertical - // await checkButtonAndClickWithID('TabsVertical'); - // await checkButtonAndClickWithID('TabsChangeVertical'); - // await pressBack(); - // //改变TabsBarMode - // await checkButtonAndClickWithID('TabsBarMode'); - // await checkButtonAndClickWithID('TabsChangeTabsBarMode'); - // await pressBack(); - // //改变Divider - // await checkButtonAndClickWithID('TabsDivider'); - // await checkButtonAndClickWithID('TabsChangeDivider'); - // await pressBack(); - // //改变BarPosition - // await checkButtonAndClickWithID('TabsBarPosition'); - // await checkButtonAndClickWithID('TabsChangeBarPosition'); - // await pressBack(); - // await driver.delayMs(1000); - // //改变tabIndex - // await checkButtonAndClickWithID('TabsIndex'); - // await driver.delayMs(2000); - // await checkButtonAndClickWithID('TabsChangeIndex'); - // await pressBack(); - // //改变BarWidth - // await checkButtonAndClickWithID('TabsBarWidth'); - // await checkButtonAndClickWithID('TabChangeBarWidth'); - // await pressBack(); - // //改变BarHeight - // await checkButtonAndClickWithID('TabsBarHeight'); - // await checkButtonAndClickWithID('TabChangeBarHeight'); - // await pressBack(); - // //抛滑Fling - // await checkButtonAndClickWithID('TabsFling'); - // await driver.fling({ - // x: 100, y: 500 - // }, { - // x: 700, y: 500 - // }, 100, 100) - // await pressBack(); - // //抛滑Drag - // await checkButtonAndClickWithID('TabsDrag'); - // await driver.fling({ - // x: 700, y: 500 - // }, { - // x: 100, y: 500 - // }, 100, 100) - // await pressBack(); - // //点击页签ClickTab - // await checkButtonAndClickWithID('TabsClickTab'); - // await checkButtonAndClickWithID('TabsChangeIndex'); - // await pressBack(); + await checkButtonAndClickWithID('TabsWidth'); + await checkButtonAndClickWithID('TabChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('TabsHeight'); + await checkButtonAndClickWithID('TabsChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TabsPadding'); + await checkButtonAndClickWithID('TabsChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TabsMargin'); + await checkButtonAndClickWithID('TabsChangeMargin'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('TabsVertical'); + await checkButtonAndClickWithID('TabsChangeVertical'); + await pressBack(); + //改变TabsBarMode + await checkButtonAndClickWithID('TabsBarMode'); + await checkButtonAndClickWithID('TabsChangeTabsBarMode'); + await pressBack(); + //改变Divider + await checkButtonAndClickWithID('TabsDivider'); + await checkButtonAndClickWithID('TabsChangeDivider'); + await pressBack(); + //改变BarPosition + await checkButtonAndClickWithID('TabsBarPosition'); + await checkButtonAndClickWithID('TabsChangeBarPosition'); + await pressBack(); + await driver.delayMs(1000); + //改变tabIndex + await checkButtonAndClickWithID('TabsIndex'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); + //改变BarWidth + await checkButtonAndClickWithID('TabsBarWidth'); + await checkButtonAndClickWithID('TabChangeBarWidth'); + await pressBack(); + //改变BarHeight + await checkButtonAndClickWithID('TabsBarHeight'); + await checkButtonAndClickWithID('TabChangeBarHeight'); + await pressBack(); + //抛滑Fling + await checkButtonAndClickWithID('TabsFling'); + await driver.fling({ + x: 100, y: 500 + }, { + x: 700, y: 500 + }, 100, 100) + await pressBack(); + //抛滑Drag + await checkButtonAndClickWithID('TabsDrag'); + await driver.fling({ + x: 700, y: 500 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + //点击页签ClickTab + await checkButtonAndClickWithID('TabsClickTab'); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); await pressBack(); //返回首页 }) - /** - * 点击首页Swiper - */ + //点击首页Swiper it(`SwiperBenchMarkTest`, 0, async () => { await driver.delayMs(1000); await checkButtonAndClickWithID('Swiper'); @@ -967,67 +931,63 @@ export default function abilityTest() { await pressBack(); }) - /** - * 点击首页Navigation - */ + //点击首页Navigation it(`NavigationBenchMarkTest`, 0, async () => { await driver.delayMs(1000); await checkButtonAndClickWithID('Navigation'); await checkButtonAndClickWithID('NavigationCreateSample'); await pressBack(); - // await checkButtonAndClickWithID('NavigationWidthSample'); - // await checkButtonAndClickWithID('change width 500 to 600'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationHeightSample'); - // await checkButtonAndClickWithID('change height 300 to 400'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationTitleModeSample'); - // await checkButtonAndClickWithID('change titleMode to Free'); - // await checkButtonAndClickWithID('change titleMode to Full'); - // await checkButtonAndClickWithID('change titleMode to Mini'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationHideToolBarSample'); - // await checkButtonAndClickWithID('change hideToolBar true to false'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationHideTitleBarSample'); - // await checkButtonAndClickWithID('change hideTitleBar true to false'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationHideBackButtonSample'); - // await checkButtonAndClickWithID('change hideBackButton true to false'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationNavBarWidthSample'); - // await checkButtonAndClickWithID('change navBarWidth 240 to 400'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationModeSample'); - // await checkButtonAndClickWithID('change navigationMode Stack to Split'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationNavBarPositionSample'); - // await checkButtonAndClickWithID('change navBarPosition Start to End'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationHideNavBarSample'); - // await checkButtonAndClickWithID('change hideNavBar Stack to Split'); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationStackJumpSample'); - // await checkButtonAndClickWithID('Stack jump to next page'); - // await pressBack(); - // await pressBack(); - // await checkButtonAndClickWithID('NavigationSplitJumpSample'); - // await checkButtonAndClickWithID('Split jump to next page'); - // await pressBack(); + await checkButtonAndClickWithID('NavigationWidthSample'); + await checkButtonAndClickWithID('change width 500 to 600'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationTitleModeSample'); + await checkButtonAndClickWithID('change titleMode to Free'); + await checkButtonAndClickWithID('change titleMode to Full'); + await checkButtonAndClickWithID('change titleMode to Mini'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideToolBarSample'); + await checkButtonAndClickWithID('change hideToolBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideTitleBarSample'); + await checkButtonAndClickWithID('change hideTitleBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideBackButtonSample'); + await checkButtonAndClickWithID('change hideBackButton true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarWidthSample'); + await checkButtonAndClickWithID('change navBarWidth 240 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationModeSample'); + await checkButtonAndClickWithID('change navigationMode Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarPositionSample'); + await checkButtonAndClickWithID('change navBarPosition Start to End'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideNavBarSample'); + await checkButtonAndClickWithID('change hideNavBar Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationStackJumpSample'); + await checkButtonAndClickWithID('Stack jump to next page'); + await pressBack(); + await pressBack(); + await checkButtonAndClickWithID('NavigationSplitJumpSample'); + await checkButtonAndClickWithID('Split jump to next page'); + await pressBack(); await pressBack(); }) - /** - * 点击首页Grid - */ + //点击首页Grid it(`GridBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Grid'); await checkButtonAndClickWithID('GridCreateSample'); await pressBack(); @@ -1076,6 +1036,9 @@ export default function abilityTest() { await checkButtonAndClickWithID('GridNotSetRCColumnsGapSample'); await checkButtonAndClickWithID('change columnGap 0 to 10'); await pressBack(); + + await driver.swipe(540, 1100, 540, 300, 200); + await checkButtonAndClickWithID('GridNotSetRCLayoutDirectionSample'); await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); await checkButtonAndClickWithID('change layoutDirection to GridDirection.RowReverse'); @@ -1091,7 +1054,6 @@ export default function abilityTest() { await checkButtonAndClickWithID('GridScrollToSample'); await checkButtonAndClickWithID('change scrollTo to 100'); await pressBack(); - await driver.swipe(540, 1000, 540, 500, 200); await checkButtonAndClickWithID('GridScrollEdgeSample'); await checkButtonAndClickWithID('change scrollEdge to Edge.Bottom'); await pressBack(); @@ -1106,1629 +1068,1587 @@ export default function abilityTest() { await pressBack(); }) - /** - * 点击首页Video - */ + //点击首页Video it(`VideoBenchMarkTest`, 0, async () => { await driver.delayMs(1000); await checkButtonAndClickWithID('Video'); await checkButtonAndClickWithID('VideoCreateSample'); - await driver.delayMs(1000); + await driver.delayMs(2000); await pressBack(); await checkButtonAndClickWithID('VideoWidthSample'); - await driver.delayMs(1000); + await driver.delayMs(2000); await checkButtonAndClickWithID('change width 80% to 100%'); await pressBack(); await checkButtonAndClickWithID('VideoHeightSample'); - await driver.delayMs(1000); + await driver.delayMs(2000); await checkButtonAndClickWithID('change height 300 to 400'); await pressBack(); await checkButtonAndClickWithID('VideoPaddingSample'); - await driver.delayMs(1000); + await driver.delayMs(2000); await checkButtonAndClickWithID('change padding 20 to 30'); await pressBack(); await checkButtonAndClickWithID('VideoMarginSample'); - await driver.delayMs(1000); + await driver.delayMs(2000); await checkButtonAndClickWithID('change margin 20 to 30'); await pressBack(); await pressBack(); }) - // - // * - // * 点击首页Flex - // it(`FlexBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Flex'); - // await checkButtonAndClickWithID('FlexCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexWidthSample'); - // await checkButtonAndClickWithID('change width 80% to 100%'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexHeightSample'); - // await checkButtonAndClickWithID('change height 300 to 400'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexValueDirectionSample'); - // await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); - // await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); - // await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); - // await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexValueWrapSample'); - // await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); - // await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); - // await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexValueJustifyContentSample'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); - // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexValueAlignItemsSample'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); - // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); - // await pressBack(); - // await checkButtonAndClickWithID('FlexValueAlignContentSample'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); - // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); - // await pressBack(); - // await pressBack(); - // }) - /** - * 点击首页Button - */ + //点击首页Flex + it(`FlexBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Flex'); + await checkButtonAndClickWithID('FlexCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('FlexWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('FlexHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('FlexPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueDirectionSample'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); + await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); + await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueWrapSample'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueJustifyContentSample'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignItemsSample'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignContentSample'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await pressBack(); + }) + + //点击首页Button it(`ButtonBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Button'); await checkButtonAndClickWithID('ButtonCreateSample'); await pressBack(); - // await checkButtonAndClickWithID('ButtonWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ButtonHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ButtonPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ButtonMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ButtonOptionTypeSample'); - // await checkButtonAndClickWithID('change Option type to Circle'); - // await checkButtonAndClickWithID('change Option type to Normal'); - // await checkButtonAndClickWithID('change Option type to Capsule'); - // await pressBack(); - // await checkButtonAndClickWithID('ButtonTypeSample'); - // await checkButtonAndClickWithID('change Option type to Circle'); - // await checkButtonAndClickWithID('change Option type to Normal'); - // await checkButtonAndClickWithID('change Option type to Capsule'); - // await pressBack(); + await checkButtonAndClickWithID('ButtonWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ButtonHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ButtonPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ButtonMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ButtonOptionTypeSample'); + await checkButtonAndClickWithID('change Option type to Circle'); + await checkButtonAndClickWithID('change Option type to Normal'); + await checkButtonAndClickWithID('change Option type to Capsule'); + await pressBack(); + await checkButtonAndClickWithID('ButtonTypeSample'); + await checkButtonAndClickWithID('change Option type to Circle'); + await checkButtonAndClickWithID('change Option type to Normal'); + await checkButtonAndClickWithID('change Option type to Capsule'); + await pressBack(); + await pressBack(); + }) + + //点击首页Select + it(`SelectBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Select'); + //创建Select组件 + await checkButtonAndClickWithID('SelectCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('SelectWidth'); + await checkButtonAndClickWithID('SelectChangeWidth'); await pressBack(); + //改变Height + await checkButtonAndClickWithID('SelectHeight'); + await checkButtonAndClickWithID('SelectChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('SelectSize'); + await checkButtonAndClickWithID('SelectChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SelectPadding'); + await checkButtonAndClickWithID('SelectChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SelectMargin'); + await checkButtonAndClickWithID('SelectChangeMargin'); + await pressBack(); + //改变Space + await checkButtonAndClickWithID('SelectSpace'); + await checkButtonAndClickWithID('SelectChangeSpace'); + await pressBack(); + //改变ArrowPosition + await checkButtonAndClickWithID('SelectArrowPosition'); + await checkButtonAndClickWithID('SelectChangeArrowPosition'); + await pressBack(); + //首次展开 + await checkButtonAndClickWithID('SelectFirstExpand'); + await checkButtonAndClickWithID('SelectFirstExpand'); + await pressBack(); + await pressBack(); + //再次展开 + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await pressBack(); + await pressBack(); + //首次展开后收起 + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await pressBack(); + //多次展开后收起 + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await pressBack(); + await pressBack(); //返回首页 }) - // /** - // * 点击首页Select - // */ - // it(`SelectBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Select'); - // //创建Select组件 - // await checkButtonAndClickWithID('SelectCreate'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('SelectWidth'); - // await checkButtonAndClickWithID('SelectChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('SelectHeight'); - // await checkButtonAndClickWithID('SelectChangeHeight'); - // await pressBack(); - // //改变Size - // await checkButtonAndClickWithID('SelectSize'); - // await checkButtonAndClickWithID('SelectChangeSize'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('SelectPadding'); - // await checkButtonAndClickWithID('SelectChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('SelectMargin'); - // await checkButtonAndClickWithID('SelectChangeMargin'); - // await pressBack(); - // //改变Space - // await checkButtonAndClickWithID('SelectSpace'); - // await checkButtonAndClickWithID('SelectChangeSpace'); - // await pressBack(); - // //改变ArrowPosition - // await checkButtonAndClickWithID('SelectArrowPosition'); - // await checkButtonAndClickWithID('SelectChangeArrowPosition'); - // await pressBack(); - // //首次展开 - // await checkButtonAndClickWithID('SelectFirstExpand'); - // await checkButtonAndClickWithID('SelectFirstExpand'); - // await pressBack(); - // await pressBack(); - // //再次展开 - // await checkButtonAndClickWithID('SelectSecondExpand'); - // await checkButtonAndClickWithID('SelectSecondExpand'); - // await checkButtonAndClickWithID('SelectSecondExpand'); - // await checkButtonAndClickWithID('SelectSecondExpand'); - // await pressBack(); - // await pressBack(); - // //首次展开后收起 - // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - // await pressBack(); - // //多次展开后收起 - // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - - // /** - // * 点击首页CheckBox - // */ - // it(`CheckboxBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('CheckBox'); - // //创建CheckBox组件 - // await checkButtonAndClickWithID('CheckBoxCreate'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('CheckBoxWidth'); - // await checkButtonAndClickWithID('CheckBoxChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('CheckBoxHeight'); - // await checkButtonAndClickWithID('CheckBoxChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('CheckBoxPadding'); - // await checkButtonAndClickWithID('CheckBoxChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('CheckBoxMargin'); - // await checkButtonAndClickWithID('CheckBoxChangeMargin'); - // await pressBack(); - // //改变Size - // await checkButtonAndClickWithID('CheckBoxSize'); - // await checkButtonAndClickWithID('CheckBoxChangeSize'); - // await pressBack(); - // //改变Select - // await checkButtonAndClickWithID('CheckBoxSelect'); - // await checkButtonAndClickWithID('CheckBoxChangeSelect'); - // await pressBack(); - // //改变MarkStyle - // await checkButtonAndClickWithID('CheckBoxMarkStyle'); - // await checkButtonAndClickWithID('CheckBoxChangeMarkStyle'); - // await pressBack(); - // //GroupSelect - // await checkButtonAndClickWithID('CheckBoxGroupSelect'); - // await checkButtonAndClickWithID('CheckBoxChangeSelect'); - // await pressBack(); - // //GroupCancelSelect - // await checkButtonAndClickWithID('CheckBoxGroupCancelSelect'); - // await checkButtonAndClickWithID('CheckBoxChangeCancelSelect'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - - - // /** - // * 点击首页Span - // */ - // it(`SpanboxBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Span'); - // //Text内创建Span组件 - // await checkButtonAndClickWithID('SpanCreateInText'); - // await driver.delayMs(1000); - // await pressBack(); - // //RichEditor内创建Span组件 - // await checkButtonAndClickWithID('SpanCreateInRichEditor'); - // await pressBack(); - // //Text内改变value - // await checkButtonAndClickWithID('SpanValueInText'); - // await checkButtonAndClickWithID('SpanChangeValueInText'); - // await pressBack(); - // //RichEditor内改变value - // await checkButtonAndClickWithID('SpanValueInRichEditor'); - // await checkButtonAndClickWithID('SpanChangeValueInRichEditor'); - // await pressBack(); - // //Text内改变LetterSpacing - // await checkButtonAndClickWithID('SpanLetterSpacingInText'); - // await checkButtonAndClickWithID('SpanChangeLetterSpacingInText'); - // await pressBack(); - // //RichEditor内改变LetterSpacing - // await checkButtonAndClickWithID('SpanLetterSpacingInRichEditor'); - // await checkButtonAndClickWithID('SpanChangeLetterSpacingInRichEditor'); - // await pressBack(); - // // Text内改变LetterSpacing - // await checkButtonAndClickWithID('SpanTextCaseInText'); - // await checkButtonAndClickWithID('TextCase.Normal.Text'); - // await checkButtonAndClickWithID('TextCase.LowerCase.Text'); - // await checkButtonAndClickWithID('TextCase.UpperCase.Text'); - // await pressBack(); - // //RichEditor内改变LetterSpacing - // await checkButtonAndClickWithID('SpanTextCaseInRichEditor'); - // await checkButtonAndClickWithID('TextCase.Normal.RichEditor'); - // await checkButtonAndClickWithID('TextCase.LowerCase.RichEditor'); - // await checkButtonAndClickWithID('TextCase.UpperCase.RichEditor'); - // await pressBack(); - // //Text内改变font - // await checkButtonAndClickWithID('SpanFontInText'); - // await checkButtonAndClickWithID('SpanChangeFontInText'); - // await pressBack(); - // //RichEditor内改变Font - // await checkButtonAndClickWithID('SpanFontInRichEditor'); - // await checkButtonAndClickWithID('SpanChangeFontInRichEditor'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) + //点击首页CheckBox + it(`CheckboxBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('CheckBox'); + //创建CheckBox组件 + await checkButtonAndClickWithID('CheckBoxCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('CheckBoxWidth'); + await checkButtonAndClickWithID('CheckBoxChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('CheckBoxHeight'); + await checkButtonAndClickWithID('CheckBoxChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('CheckBoxPadding'); + await checkButtonAndClickWithID('CheckBoxChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('CheckBoxMargin'); + await checkButtonAndClickWithID('CheckBoxChangeMargin'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('CheckBoxSize'); + await checkButtonAndClickWithID('CheckBoxChangeSize'); + await pressBack(); + //改变Select + await checkButtonAndClickWithID('CheckBoxSelect'); + await checkButtonAndClickWithID('CheckBoxChangeSelect'); + await pressBack(); + //改变MarkStyle + await checkButtonAndClickWithID('CheckBoxMarkStyle'); + await checkButtonAndClickWithID('CheckBoxChangeMarkStyle'); + await pressBack(); + //GroupSelect + await checkButtonAndClickWithID('CheckBoxGroupSelect'); + await checkButtonAndClickWithID('CheckBoxChangeSelect'); + await pressBack(); + //GroupCancelSelect + await checkButtonAndClickWithID('CheckBoxGroupCancelSelect'); + await checkButtonAndClickWithID('CheckBoxChangeCancelSelect'); + await pressBack(); + await pressBack(); //返回首页 + }) - /** - * 点击首页Slider - */ - it(`SliderBenchMarkTest`, 0, async () => { + //点击首页Span + it(`SpanBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Span'); + //Text内创建Span组件 + await checkButtonAndClickWithID('SpanCreateInText'); await driver.delayMs(1000); + await pressBack(); + //RichEditor内创建Span组件 + await checkButtonAndClickWithID('SpanCreateInRichEditor'); + await pressBack(); + //Text内改变value + await checkButtonAndClickWithID('SpanValueInText'); + await checkButtonAndClickWithID('SpanChangeValueInText'); + await pressBack(); + //RichEditor内改变value + await checkButtonAndClickWithID('SpanValueInRichEditor'); + await checkButtonAndClickWithID('SpanChangeValueInRichEditor'); + await pressBack(); + //Text内改变LetterSpacing + await checkButtonAndClickWithID('SpanLetterSpacingInText'); + await checkButtonAndClickWithID('SpanChangeLetterSpacingInText'); + await pressBack(); + //RichEditor内改变LetterSpacing + await checkButtonAndClickWithID('SpanLetterSpacingInRichEditor'); + await checkButtonAndClickWithID('SpanChangeLetterSpacingInRichEditor'); + await pressBack(); + // Text内改变LetterSpacing + await checkButtonAndClickWithID('SpanTextCaseInText'); + await checkButtonAndClickWithID('TextCase.Normal.Text'); + await checkButtonAndClickWithID('TextCase.LowerCase.Text'); + await checkButtonAndClickWithID('TextCase.UpperCase.Text'); + await pressBack(); + //RichEditor内改变LetterSpacing + await checkButtonAndClickWithID('SpanTextCaseInRichEditor'); + await checkButtonAndClickWithID('TextCase.Normal.RichEditor'); + await checkButtonAndClickWithID('TextCase.LowerCase.RichEditor'); + await checkButtonAndClickWithID('TextCase.UpperCase.RichEditor'); + await pressBack(); + //Text内改变font + await checkButtonAndClickWithID('SpanFontInText'); + await checkButtonAndClickWithID('SpanChangeFontInText'); + await pressBack(); + //RichEditor内改变Font + await checkButtonAndClickWithID('SpanFontInRichEditor'); + await checkButtonAndClickWithID('SpanChangeFontInRichEditor'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Slider + it(`SliderBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); await checkButtonAndClickWithID('Slider'); //创建Slider组件 await checkButtonAndClickWithID('SliderCreate'); await pressBack(); //改变width - // await checkButtonAndClickWithID('SliderWidth'); - // await checkButtonAndClickWithID('SliderChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('SliderHeight'); - // await checkButtonAndClickWithID('SliderChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('SliderPadding'); - // await checkButtonAndClickWithID('SliderChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('SliderMargin'); - // await checkButtonAndClickWithID('SliderChangeMargin'); - // await pressBack(); - // //改变Step - // await checkButtonAndClickWithID('SliderStep'); - // await checkButtonAndClickWithID('SliderChangeStep'); - // await pressBack(); - // //改变Direction - // await checkButtonAndClickWithID('SliderDirection'); - // await checkButtonAndClickWithID('SliderChangeDirection'); - // await pressBack(); - // //改变reverse - // await checkButtonAndClickWithID('SliderReverse'); - // await checkButtonAndClickWithID('SliderChangeReverse'); - // await pressBack(); - // //改变Style - // await checkButtonAndClickWithID('SliderStyle'); - // await checkButtonAndClickWithID('SliderChangeStyle'); - // await pressBack(); - // //改变TrackThickness - // await checkButtonAndClickWithID('SliderTrackThickness'); - // await checkButtonAndClickWithID('SliderChangeTrackThickness'); - // await pressBack(); - // //改变BlockSize - // await checkButtonAndClickWithID('SliderBlockSize'); - // await checkButtonAndClickWithID('SliderChangeBlockSize'); - // await pressBack(); - // //手指滑动 - // await checkButtonAndClickWithID('SliderFingerSliding'); - // await driver.swipe(13, 296, 383, 296, 200); - // await pressBack(); - // //手指点击滑轨 - // await checkButtonAndClickWithID('SliderClick'); - // await driver.click(383, 296); - // await pressBack(); - // // 鼠标滚轮调节滑块位置 - // await checkButtonAndClickWithID('SliderMouseScroll'); - // await driver.mouseScroll({ - // x: 163, y: 339 - // }, true, 20); - // await pressBack(); - // // 外接键盘调节滑块位置 - // await checkButtonAndClickWithID('SliderKeyboardScroll'); - // // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); - // await driver.swipe(13, 296, 383, 296, 200); - // await pressBack(); + await checkButtonAndClickWithID('SliderWidth'); + await checkButtonAndClickWithID('SliderChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('SliderHeight'); + await checkButtonAndClickWithID('SliderChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SliderPadding'); + await checkButtonAndClickWithID('SliderChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SliderMargin'); + await checkButtonAndClickWithID('SliderChangeMargin'); + await pressBack(); + //改变Step + await checkButtonAndClickWithID('SliderStep'); + await checkButtonAndClickWithID('SliderChangeStep'); + await pressBack(); + //改变Direction + await checkButtonAndClickWithID('SliderDirection'); + await checkButtonAndClickWithID('SliderChangeDirection'); + await pressBack(); + //改变reverse + await checkButtonAndClickWithID('SliderReverse'); + await checkButtonAndClickWithID('SliderChangeReverse'); + await pressBack(); + //改变Style + await checkButtonAndClickWithID('SliderStyle'); + await checkButtonAndClickWithID('SliderChangeStyle'); + await pressBack(); + //改变TrackThickness + await checkButtonAndClickWithID('SliderTrackThickness'); + await checkButtonAndClickWithID('SliderChangeTrackThickness'); + await pressBack(); + //改变BlockSize + await checkButtonAndClickWithID('SliderBlockSize'); + await checkButtonAndClickWithID('SliderChangeBlockSize'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('SliderFingerSliding'); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); + //手指点击滑轨 + await checkButtonAndClickWithID('SliderClick'); + await driver.click(383, 296); + await pressBack(); + // 鼠标滚轮调节滑块位置 + await checkButtonAndClickWithID('SliderMouseScroll'); + await driver.mouseScroll({ + x: 163, y: 339 + }, true, 20); + await pressBack(); + // 外接键盘调节滑块位置 + await checkButtonAndClickWithID('SliderKeyboardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); await pressBack(); //返回首页 }) - // /** - // * 点击首页Divider - // */ - // it(`DividerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Divider'); - // //创建Divider组件 - // await checkButtonAndClickWithID('DividerCreate'); - // await pressBack(); - // //更改StrokeWidth - // await checkButtonAndClickWithID('DividerStrokeWidth'); - // await checkButtonAndClickWithID('DividerChangeStrokeWidth'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('DividerWidth'); - // await checkButtonAndClickWithID('DividerChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('DividerHeight'); - // await checkButtonAndClickWithID('DividerChangeHeight'); - // await pressBack(); - // //改变Size - // await checkButtonAndClickWithID('DividerSize'); - // await checkButtonAndClickWithID('DividerChangeSize'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('DividerPadding'); - // await checkButtonAndClickWithID('DividerChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('DividerMargin'); - // await checkButtonAndClickWithID('DividerChangeMargin'); - // await pressBack(); - // //改变Color - // await checkButtonAndClickWithID('DividerColor'); - // await checkButtonAndClickWithID('DividerChangeColor'); - // await pressBack(); - // //改变Vertical - // await checkButtonAndClickWithID('DividerVertical'); - // await checkButtonAndClickWithID('DividerChangeVerticalTrue'); - // await checkButtonAndClickWithID('DividerChangeVerticalFalse'); - // await pressBack(); - // //改变LineCap - // await checkButtonAndClickWithID('DividerLineCap'); - // await checkButtonAndClickWithID('DividerChangeLineCapButt'); - // await checkButtonAndClickWithID('DividerChangeLineCapRound'); - // await checkButtonAndClickWithID('DividerChangeLineCapSquare'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) + //点击首页Divider + it(`DividerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Divider'); + //创建Divider组件 + await checkButtonAndClickWithID('DividerCreate'); + await pressBack(); + //更改StrokeWidth + await checkButtonAndClickWithID('DividerStrokeWidth'); + await checkButtonAndClickWithID('DividerChangeStrokeWidth'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DividerWidth'); + await checkButtonAndClickWithID('DividerChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DividerHeight'); + await checkButtonAndClickWithID('DividerChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('DividerSize'); + await checkButtonAndClickWithID('DividerChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DividerPadding'); + await checkButtonAndClickWithID('DividerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('DividerMargin'); + await checkButtonAndClickWithID('DividerChangeMargin'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('DividerColor'); + await checkButtonAndClickWithID('DividerChangeColor'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('DividerVertical'); + await checkButtonAndClickWithID('DividerChangeVerticalTrue'); + await checkButtonAndClickWithID('DividerChangeVerticalFalse'); + await pressBack(); + //改变LineCap + await checkButtonAndClickWithID('DividerLineCap'); + await checkButtonAndClickWithID('DividerChangeLineCapButt'); + await checkButtonAndClickWithID('DividerChangeLineCapRound'); + await checkButtonAndClickWithID('DividerChangeLineCapSquare'); + await pressBack(); + await pressBack(); //返回首页 + }) - /** - * 点击首页Toggle - */ + //点击首页Toggle it(`ToggleBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); + await driver.delayMs(3000); await checkButtonAndClickWithID('Toggle'); await checkButtonAndClickWithID('ToggleCreateSample'); await pressBack(); - // await checkButtonAndClickWithID('ToggleSelectedColorSample'); - // await checkButtonAndClickWithID('change selectedColor'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleSwitchPointColorSample'); - // await checkButtonAndClickWithID('change switchPointColor'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleSizeSample'); - // await checkButtonAndClickWithID('change size'); - // await pressBack(); - // await checkButtonAndClickWithID('TogglePaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleSwitchSample'); - // await checkButtonAndClickWithID('change toggleIsOn'); - // await checkButtonAndClickWithID('change toggleIsOn'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleCheckboxSelectSample'); - // await checkButtonAndClickWithID('change select'); - // await pressBack(); - // await checkButtonAndClickWithID('ToggleCheckboxCancelSample'); - // await checkButtonAndClickWithID('change cancel'); - // await pressBack(); + await checkButtonAndClickWithID('ToggleSelectedColorSample'); + await checkButtonAndClickWithID('change selectedColor'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSwitchPointColorSample'); + await checkButtonAndClickWithID('change switchPointColor'); + await pressBack(); + await checkButtonAndClickWithID('ToggleWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ToggleHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSizeSample'); + await checkButtonAndClickWithID('change size'); + await pressBack(); + await checkButtonAndClickWithID('TogglePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ToggleMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSwitchSample'); + await checkButtonAndClickWithID('change toggleIsOn'); + await checkButtonAndClickWithID('change toggleIsOn'); + await pressBack(); + await checkButtonAndClickWithID('ToggleCheckboxSelectSample'); + await checkButtonAndClickWithID('change select'); + await pressBack(); + await checkButtonAndClickWithID('ToggleCheckboxCancelSample'); + await checkButtonAndClickWithID('change cancel'); + await pressBack(); await pressBack(); }) - // /** - // * 点击首页Refresh - // */ - // it(`RefreshBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Refresh'); - // await checkButtonAndClickWithID('RefreshCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshSizeSample'); - // await checkButtonAndClickWithID('change size'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('RefreshPullSample'); - // await driver.swipe(360, 200, 360, 500, 600) - // await pressBack(); - // await checkButtonAndClickWithID('RefreshOffsetSample'); - // await checkButtonAndClickWithID('change offset 20 to 30'); - // await driver.swipe(360, 200, 360, 500, 600) - // await pressBack(); - // await checkButtonAndClickWithID('RefreshFrictionSample'); - // await checkButtonAndClickWithID('change friction 60 to 80'); - // await driver.swipe(360, 200, 360, 500, 600) - // await pressBack(); - // await checkButtonAndClickWithID('RefreshOnStateChangeSample'); - // await driver.swipe(360, 200, 360, 500, 600) - // await pressBack(); - // await pressBack(); - // }) - - // /** - // * 点击首页TextArea - // */ - // it(`TextAreaBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextArea'); - // await checkButtonAndClickWithID('TextAreaCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaTextAlignSample'); - // await checkButtonAndClickWithID('change textAlign to Start'); - // await checkButtonAndClickWithID('change textAlign to Center'); - // await checkButtonAndClickWithID('change textAlign to End'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaFontSample'); - // await checkButtonAndClickWithID('change font'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaTextSample'); - // await checkButtonAndClickWithID('change textAreaTextLength 10 to 100'); - // await pressBack(); - // await checkButtonAndClickWithID('TextAreaMaxLinesSample'); - // await checkButtonAndClickWithID('change maxLines 1 to 3'); - // await pressBack(); - // await pressBack(); - // }) - - // /** - // * 点击首页Search - // */ - // it(`SearchBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Search'); - // await checkButtonAndClickWithID('SearchCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchValueSample'); - // await checkButtonAndClickWithID('change searchValueLength 10 to 100'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchTextAlignSample'); - // await checkButtonAndClickWithID('change textAlign to Start'); - // await checkButtonAndClickWithID('change textAlign to Center'); - // await checkButtonAndClickWithID('change textAlign to End'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchTextFontSample'); - // await checkButtonAndClickWithID('change textFont'); - // await pressBack(); - // await checkButtonAndClickWithID('SearchPlaceholderFontSample'); - // await checkButtonAndClickWithID('change placeholderFont'); - // await pressBack(); - // await pressBack(); - // }) - - // /** - // * 点击首页Progress - // */ - it(`ProgressBenchMarkTest`, 0, async () => { + //点击首页Refresh + it(`RefreshBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Refresh'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshCreateSample'); await driver.delayMs(1000); - await checkButtonAndClickWithID('Progress'); - await checkButtonAndClickWithID('ProgressCreateSample'); await pressBack(); - // await checkButtonAndClickWithID('ProgressWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressProgressTypeSample'); - // await checkButtonAndClickWithID('change progressType to Linear'); - // await checkButtonAndClickWithID('change progressType to Ring'); - // await checkButtonAndClickWithID('change progressType to Eclipse'); - // await checkButtonAndClickWithID('change progressType to ScaleRing'); - // await checkButtonAndClickWithID('change progressType to Capsule'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressProgressStyleSample'); - // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressLinearSample'); - // await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressRingSample'); - // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - // await pressBack(); - // await checkButtonAndClickWithID('ProgressScaleRingSample'); - // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - // await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshSizeSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change size'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPullSample'); + await driver.delayMs(1000); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOffsetSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change offset 20 to 30'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshFrictionSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change friction 60 to 80'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOnStateChangeSample'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); await pressBack(); }) - // - // /** - // * 点击首页Marquee - // */ - // it(`MarqueeBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Marquee'); - // //创建Marquee组件 - // await checkButtonAndClickWithID('MarqueeCreate'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('MarqueeWidth'); - // await checkButtonAndClickWithID('MarqueeChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('MarqueeHeight'); - // await checkButtonAndClickWithID('MarqueeChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('MarqueePadding'); - // await checkButtonAndClickWithID('MarqueeChangePadding'); - // await pressBack(); - // // 改变Margin - // await checkButtonAndClickWithID('MarqueeMargin'); - // await checkButtonAndClickWithID('MarqueeChangeMargin'); - // await pressBack(); - // // 改变Src - // await checkButtonAndClickWithID('MarqueeSrc'); - // await checkButtonAndClickWithID('MarqueeChangeSrc'); - // await pressBack(); - // // 改变Step - // await checkButtonAndClickWithID('MarqueeStep'); - // await checkButtonAndClickWithID('MarqueeChangeStep'); - // await pressBack(); - // // 改变FromStart - // await checkButtonAndClickWithID('MarqueeFromStart'); - // await checkButtonAndClickWithID('MarqueeChangeFromStart'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页DataPanel - // */ - // it(`DataPanelBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('DataPanel'); - // //创建DataPanel组件 - // await checkButtonAndClickWithID('DataPanelCreate'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('DataPanelWidth'); - // await checkButtonAndClickWithID('DataPanelChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('DataPanelHeight'); - // await checkButtonAndClickWithID('DataPanelChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('DataPanelPadding'); - // await checkButtonAndClickWithID('DataPanelChangePadding'); - // await pressBack(); - // // 改变Margin - // await checkButtonAndClickWithID('DataPanelMargin'); - // await checkButtonAndClickWithID('DataPanelChangeMargin'); - // await pressBack(); - // // 改变CloseEffect - // await checkButtonAndClickWithID('DataPanelCloseEffect'); - // await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); - // await pressBack(); - // // 改变StrokeWidth - // await checkButtonAndClickWithID('DataPanelStrokeWidth'); - // await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); - // await pressBack(); - // // 改变Radius - // await checkButtonAndClickWithID('DataPanelRadius'); - // await checkButtonAndClickWithID('DataPanelChangeRadius'); - // await pressBack(); - // // 改变OffsetX - // await checkButtonAndClickWithID('DataPanelOffsetX'); - // await checkButtonAndClickWithID('DataPanelChangeOffsetX'); - // await pressBack(); - // // 改变OffsetY - // await checkButtonAndClickWithID('DataPanelOffsetY'); - // await checkButtonAndClickWithID('DataPanelChangeOffsetY'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Rating - // */ - // it(`RatingBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Rating'); - // //创建Rating组件 - // await checkButtonAndClickWithID('RatingCreate'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('RatingWidth'); - // await checkButtonAndClickWithID('RatingChangeWidth'); - // await pressBack(); - // //改变height - // await checkButtonAndClickWithID('RatingHeight'); - // await checkButtonAndClickWithID('RatingChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('RatingPadding'); - // await checkButtonAndClickWithID('RatingChangePadding'); - // await pressBack(); - // // 改变Margin - // await checkButtonAndClickWithID('RatingMargin'); - // await checkButtonAndClickWithID('RatingChangeMargin'); - // await pressBack(); - // // 改变Stars - // await checkButtonAndClickWithID('RatingStars'); - // await checkButtonAndClickWithID('RatingChangeStars'); - // await pressBack(); - // // 改变StarStyle - // await checkButtonAndClickWithID('RatingStarStyle'); - // await checkButtonAndClickWithID('RatingChangeStarStyle'); - // await pressBack(); - // // 改变OptionsRating - // await checkButtonAndClickWithID('RatingOptionsRating'); - // await checkButtonAndClickWithID('RatingChangeOptionsRating'); - // await pressBack(); - // // Click - // await checkButtonAndClickWithID('RatingClick'); - // await checkButtonAndClickWithID('RatingClickIndex6'); - // await pressBack(); - // // swip - // await checkButtonAndClickWithID('RatingSwip'); - // await driver.swipe(50, 600, 500, 600); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页TextClock - // */ - // it(`TextClockBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextClock'); - // await checkButtonAndClickWithID('TextClockCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('TextClockWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextClockHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextClockPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextClockMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextClockFormatSample'); - // await checkButtonAndClickWithID('change format'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Hyperlink - // */ - // it(`HyperlinkBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Hyperlink'); - // await checkButtonAndClickWithID('HyperlinkCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('HyperlinkWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('HyperlinkHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('HyperlinkPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('HyperlinkMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页QRCode - // */ - // it(`QRCodeBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('QRCode'); - // await checkButtonAndClickWithID('QRCodeCreateSample'); - // await driver.delayMs(1000); - // await pressBack(); - // await checkButtonAndClickWithID('QRCodeWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('QRCodeHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('QRCodePaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('QRCodeMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Gauge - // */ - // it(`GaugeBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Gauge'); - // await checkButtonAndClickWithID('GaugeCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('GaugeWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('GaugeHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('GaugePaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('GaugeMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('GaugeStrokeWidthSample'); - // await checkButtonAndClickWithID('change strokeWidth 4 to 10'); - // await pressBack(); - // // await checkButtonAndClickWithID('GaugeTrackShadowSample'); - // // await checkButtonAndClickWithID('change trackShadow'); - // // await pressBack(); - // await checkButtonAndClickWithID('GaugeAngleSample'); - // await checkButtonAndClickWithID('change angle'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Badge - // */ - // it(`BadgeBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Badge'); - // //创建Badge组件 - // await checkButtonAndClickWithID('BadgeCreate'); - // await pressBack(); - // //改变Size - // await checkButtonAndClickWithID('BadgeSize'); - // await checkButtonAndClickWithID('BadgeChangeSize'); - // await pressBack(); - // //改变Color - // await checkButtonAndClickWithID('BadgeColor'); - // await checkButtonAndClickWithID('BadgeChangeColor'); - // await pressBack(); - // //改变FontSize - // await checkButtonAndClickWithID('BadgeFontSize'); - // await checkButtonAndClickWithID('BadgeChangeFontSize'); - // await pressBack(); - // //改变FontWeight - // await checkButtonAndClickWithID('BadgeFontWeight'); - // await checkButtonAndClickWithID('BadgeChangeFontWeight'); - // await pressBack(); - // //改变BorderWidth - // await checkButtonAndClickWithID('BadgeBorderWidth'); - // await checkButtonAndClickWithID('BadgeChangeBorderWidth'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页AlphabetIndexer - // */ - // it(`AlphabetIndexerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('AlphabetIndexer'); - // //创建AlphabetIndexerCreate组件 - // await checkButtonAndClickWithID('AlphabetIndexerCreate'); - // await driver.delayMs(1000); - // await pressBack(); - // //改变SelectedColor - // await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); - // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); - // await pressBack(); - // //改变PopupColor - // await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); - // await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); - // await pressBack(); - // //改变SelectedBackgroundColor - // await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); - // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); - // await pressBack(); - // // 改变PopupBackground - // await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); - // await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); - // await pressBack(); - // //改变SelectedFont - // await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); - // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); - // await pressBack(); - // //改变popupFont - // await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); - // await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Menu - // */ - // it(`DividerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Menu'); - // //创建Menu组件 - // await checkButtonAndClickWithID('MenuCreate'); - // await pressBack(); - // //改变Font - // await checkButtonAndClickWithID('MenuFont'); - // await checkButtonAndClickWithID('MenuChangeFont'); - // await pressBack(); - // //改变FontColor - // await checkButtonAndClickWithID('MenuFontColor'); - // await checkButtonAndClickWithID('MenuChangeFontColor'); - // await pressBack(); - // //改变Width - // await checkButtonAndClickWithID('MenuWidth'); - // await checkButtonAndClickWithID('MenuChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('MenuHeight'); - // await checkButtonAndClickWithID('MenuChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('MenuPadding'); - // await checkButtonAndClickWithID('MenuChangePadding'); - // await pressBack(); - // // 变Margin - // await checkButtonAndClickWithID('MenuMargin'); - // await checkButtonAndClickWithID('MenuChangeMargin'); - // await pressBack(); - // // Menu展开菜单Expend - // await checkButtonAndClickWithID('MenuFirstExpend'); - // await checkButtonAndClickWithID('MenuFirstChangeExpend'); - // await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); - // await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); - // await pressBack(); - // await pressBack(); - // // Menu收起后再次展开菜单Expend - // await checkButtonAndClickWithID('MenuSecondExpend'); - // await checkButtonAndClickWithID('MenuSecondChangeExpend'); - // await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - // await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuSecondChangeExpend'); - // await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - // await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - // await pressBack(); - // await pressBack(); - // // Menu收起后多次关闭 - // await checkButtonAndClickWithID('MenuMoreClose'); - // await checkButtonAndClickWithID('MenuMoreCloseFirst'); - // await checkButtonAndClickWithID('MenuMoreCloseSencond'); - // await checkButtonAndClickWithID('MenuMoreCloseThird'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuMoreCloseFirst'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuMoreCloseFirst'); - // await pressBack(); - // await pressBack(); - // // Group收起后再次展开 - // await checkButtonAndClickWithID('MenuGroupCloseExpand'); - // await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - // await pressBack(); - // await pressBack(); - // // Group多次关闭 - // await checkButtonAndClickWithID('MenuGroupMoreClose'); - // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - // await pressBack(); - // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - // await pressBack(); - // await pressBack(); - // - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页TextPicker - // */ - // it(`TextPickerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextPicker'); - // //创建TextPicker组件 - // await checkButtonAndClickWithID('TextPickerCreate'); - // await pressBack(); - // //改变TextStyle - // await checkButtonAndClickWithID('TextPickerTextStyle'); - // await checkButtonAndClickWithID('TextPickerChangeTextStyle'); - // await pressBack(); - // //改变SelectedTextStyle - // await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); - // await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); - // await pressBack(); - // //改变DisappearTextStyle - // await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); - // await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('TextPickerWidth'); - // await checkButtonAndClickWithID('TextPickerChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('TextPickerHeight'); - // await checkButtonAndClickWithID('TextPickerChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('TextPickerPadding'); - // await checkButtonAndClickWithID('TextPickerChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('TextPickerMargin'); - // await checkButtonAndClickWithID('TextPickerChangeMargin'); - // await pressBack(); - // //手指滑动 - // await checkButtonAndClickWithID('TextPickerFingerSwip'); - // await driver.swipe(150, 300, 150, 150) - // await pressBack(); - // //手指点击 - // await checkButtonAndClickWithID('TextPickerClick'); - // await driver.click(150, 150) - // await driver.delayMs(1000); - // await pressBack(); - // //鼠标滚轮MouseScroll - // await checkButtonAndClickWithID('TextPickerMouseScroll'); - // await driver.mouseScroll({ x: 150, y: 200 }, true, 5); - // await driver.delayMs(1000); - // await pressBack(); - // //键盘Scroll - // await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); - // // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); - // await driver.swipe(150, 300, 150, 150) - // await driver.delayMs(1000); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Counter - // */ - // it(`CounterBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Counter'); - // //创建Counter组件 - // await checkButtonAndClickWithID('CounterCreate'); - // await driver.delayMs(1000); - // await pressBack(); - // //改变width - // await checkButtonAndClickWithID('CounterWidth'); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('CounterChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('CounterHeight'); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('CounterChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('CounterPadding'); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('CounterChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('CounterMargin'); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('CounterChangeMargin'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页XComponent - // */ - // it(`XComponentBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('XComponent'); - // //创建XComponent组件 - // await checkButtonAndClickWithID('XComponentCreate'); - // await driver.delayMs(1000); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页PatternLock - // */ - // it(`PatternLockBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('PatternLock'); - // //创建PatternLock组件 - // await checkButtonAndClickWithID('PatternLockCreate'); - // await driver.delayMs(1000); - // await pressBack(); - // //改变SideLength - // await checkButtonAndClickWithID('PatternLockSideLength'); - // await checkButtonAndClickWithID('PatternLockChangeSideLength'); - // await pressBack(); - // //改变CircleRadius - // await checkButtonAndClickWithID('PatternLockCircleRadius'); - // await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); - // await pressBack(); - // //改变RegularColor - // await checkButtonAndClickWithID('PatternLockRegularColor'); - // await checkButtonAndClickWithID('PatternLockChangeRegularColor'); - // await pressBack(); - // //改变SelectedColor - // await checkButtonAndClickWithID('PatternLockSelectedColor'); - // await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); - // await pressBack(); - // //改变ActiveColor - // await checkButtonAndClickWithID('PatternLockActiveColor'); - // await checkButtonAndClickWithID('PatternLockChangeActiveColor'); - // await pressBack(); - // //改变PathColor - // await checkButtonAndClickWithID('PatternLockPathColor'); - // await checkButtonAndClickWithID('PatternLockChangePathColor'); - // await pressBack(); - // //改变PathStrokeWidth - // await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); - // await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); - // await pressBack(); - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Shape - // */ - // it(`ShapeBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Shape'); - // //创建Shape组件 - // await checkButtonAndClickWithID('ShapeCreate'); - // await pressBack(); - // //改变Fill - // await checkButtonAndClickWithID('ShapeFill'); - // await checkButtonAndClickWithID('ShapeChangeFill'); - // await pressBack(); - // //改变FillOpacity - // await checkButtonAndClickWithID('ShapeFillOpacity'); - // await checkButtonAndClickWithID('ShapeChangeFillOpacity'); - // await pressBack(); - // //改变stroke - // await checkButtonAndClickWithID('ShapeStroke'); - // await checkButtonAndClickWithID('ShapeChangeStroke'); - // await pressBack(); - // //改变StrokeDashArray - // await checkButtonAndClickWithID('ShapeStrokeDashArray'); - // await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); - // await pressBack(); - // //改变StrokeDashOffset - // await checkButtonAndClickWithID('ShapeStrokeDashOffset'); - // await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); - // await pressBack(); - // //改变StrokeWidth - // await checkButtonAndClickWithID('ShapeStrokeWidth'); - // await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); - // await pressBack(); - // //改变Width - // await checkButtonAndClickWithID('ShapeWidth'); - // await checkButtonAndClickWithID('ShapeChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('ShapeHeight'); - // await checkButtonAndClickWithID('ShapeChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('ShapePadding'); - // await checkButtonAndClickWithID('ShapeChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('ShapeMargin'); - // await checkButtonAndClickWithID('ShapeChangeMargin'); - // await pressBack(); - // - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Path - // */ - // it(`PathBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Path'); - // //创建Path组件 - // await checkButtonAndClickWithID('PathCreate'); - // await pressBack(); - // //改变Fill - // await checkButtonAndClickWithID('PathFill'); - // await checkButtonAndClickWithID('PathChangeFill'); - // await pressBack(); - // // 改变FillOpacity - // await checkButtonAndClickWithID('PathFillOpacity'); - // await checkButtonAndClickWithID('PathChangeFillOpacity'); - // await pressBack(); - // //改变Stroke - // await checkButtonAndClickWithID('PathStroke'); - // await checkButtonAndClickWithID('PathChangeStroke'); - // await pressBack(); - // //改变StrokeDashArray - // await checkButtonAndClickWithID('PathStrokeDashArray'); - // await checkButtonAndClickWithID('PathChangeStrokeDashArray'); - // await pressBack(); - // //改变StrokeDashOffset - // await checkButtonAndClickWithID('PathStrokeDashOffset'); - // await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); - // await pressBack(); - // //改变StrokeWidth - // await checkButtonAndClickWithID('PathStrokeWidth'); - // await checkButtonAndClickWithID('PathChangeStrokeWidth'); - // await pressBack(); - // //改变Width - // await checkButtonAndClickWithID('PathWidth'); - // await checkButtonAndClickWithID('PathChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('PathHeight'); - // await checkButtonAndClickWithID('PathChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('PathPadding'); - // await checkButtonAndClickWithID('PathChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('PathMargin'); - // await checkButtonAndClickWithID('PathChangeMargin'); - // await pressBack(); - // - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Line - // */ - // it(`LineBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Line'); - // //创建Line组件 - // await checkButtonAndClickWithID('LineCreate'); - // await pressBack(); - // //改变Fill - // await checkButtonAndClickWithID('LineFill'); - // await checkButtonAndClickWithID('LineChangeFill'); - // await pressBack(); - // // 改变FillOpacity - // await checkButtonAndClickWithID('LineFillOpacity'); - // await checkButtonAndClickWithID('LineChangeFillOpacity'); - // await pressBack(); - // //改变Stroke - // await checkButtonAndClickWithID('LineStroke'); - // await checkButtonAndClickWithID('LineChangeStroke'); - // await pressBack(); - // //改变StrokeDashArray - // await checkButtonAndClickWithID('LineStrokeDashArray'); - // await checkButtonAndClickWithID('LineChangeStrokeDashArray'); - // await pressBack(); - // //改变StrokeDashOffset - // await checkButtonAndClickWithID('LineStrokeDashOffset'); - // await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); - // await pressBack(); - // //改变StrokeWidth - // await checkButtonAndClickWithID('LineStrokeWidth'); - // await checkButtonAndClickWithID('LineChangeStrokeWidth'); - // await pressBack(); - // //改变Width - // await checkButtonAndClickWithID('LineWidth'); - // await checkButtonAndClickWithID('LineChangeWidth'); - // await pressBack(); - // //改变Height - // await checkButtonAndClickWithID('LineHeight'); - // await checkButtonAndClickWithID('LineChangeHeight'); - // await pressBack(); - // //改变Padding - // await checkButtonAndClickWithID('LinePadding'); - // await checkButtonAndClickWithID('LineChangePadding'); - // await pressBack(); - // //改变Margin - // await checkButtonAndClickWithID('LineMargin'); - // await checkButtonAndClickWithID('LineChangeMargin'); - // await pressBack(); - // - // await pressBack(); //返回首页 - // }) - // - // /** - // * 点击首页Circle - // */ - // it(`CircleBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Circle'); - // await checkButtonAndClickWithID('CircleCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleFillSample'); - // await checkButtonAndClickWithID('change fill'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleFillOpacitySample'); - // await checkButtonAndClickWithID('change fillOpacity'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleStrokeSample'); - // await checkButtonAndClickWithID('change stroke'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleStrokeDashArraySample'); - // await checkButtonAndClickWithID('change strokeDashArray'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); - // await checkButtonAndClickWithID('change strokeDashOffset'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleStrokeWidthSample'); - // await checkButtonAndClickWithID('change strokeWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('CirclePaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('CircleMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Polyline - // */ - // it(`PolylineBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Polyline'); - // await checkButtonAndClickWithID('PolylineCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineFillSample'); - // await checkButtonAndClickWithID('change fill'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineFillOpacitySample'); - // await checkButtonAndClickWithID('change fillOpacity'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineStrokeSample'); - // await checkButtonAndClickWithID('change stroke'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); - // await checkButtonAndClickWithID('change strokeDashArray'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); - // await checkButtonAndClickWithID('change strokeDashOffset'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineStrokeWidthSample'); - // await checkButtonAndClickWithID('change strokeWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylinePaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('PolylineMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页SideBarContainer - // */ - // it(`SideBarContainerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('SideBarContainer'); - // await checkButtonAndClickWithID('SideBarContainerCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); - // await checkButtonAndClickWithID('change showSideBar'); - // await checkButtonAndClickWithID('SideBarContainerControlButtonSample'); - // await checkButtonAndClickWithID('change controlButton'); - // await pressBack(); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); - // await checkButtonAndClickWithID('change showControlButton'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); - // await checkButtonAndClickWithID('change sideBarWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); - // await checkButtonAndClickWithID('change autoHide'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); - // await checkButtonAndClickWithID('change sideBarPosition'); - // await pressBack(); - // await driver.swipe(540, 1000, 540, 500); - // await checkButtonAndClickWithID('SideBarContainerDividerSample'); - // await checkButtonAndClickWithID('change divider'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); - // await checkButtonAndClickWithID('change minContentWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); - // await checkButtonAndClickWithID('change minSideBarWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); - // await checkButtonAndClickWithID('change maxSideBarWidth'); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); - // await driver.delayMs(1000); - // await driver.swipe(300, 500, 100, 500); - // await pressBack(); - // await checkButtonAndClickWithID('SideBarContainerDragContentSample'); - // await driver.delayMs(1000); - // await driver.drag(300, 500, 500, 500); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页ImageAnimator - // */ - // it(`ImageAnimatorBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('ImageAnimator'); - // await checkButtonAndClickWithID('ImageAnimatorCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorWidthSample'); - // await checkButtonAndClickWithID('change width 80% to 100%'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorHeightSample'); - // await checkButtonAndClickWithID('change height 300 to 400'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorImagesSample'); - // await checkButtonAndClickWithID('change images'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorStateSample'); - // await checkButtonAndClickWithID('change state'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorDurationSample'); - // await checkButtonAndClickWithID('change duration'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorReverseSample'); - // await checkButtonAndClickWithID('change reverse'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); - // await checkButtonAndClickWithID('change fixedSize'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); - // await checkButtonAndClickWithID('change fillMode'); - // await pressBack(); - // await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); - // await checkButtonAndClickWithID('change iterations'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页LoadingProgress - // */ - // it(`LoadingProgressBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('LoadingProgress'); - // await checkButtonAndClickWithID('LoadingProgressCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('LoadingProgressWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('LoadingProgressHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('LoadingProgressPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('LoadingProgressMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); - // await checkButtonAndClickWithID('change enableLoading'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页TextTimer - // */ - // it(`TextTimerBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextTimer'); - // await checkButtonAndClickWithID('TextTimerCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerControllerSample'); - // await checkButtonAndClickWithID('change controller to start'); - // await checkButtonAndClickWithID('change controller to pause'); - // await checkButtonAndClickWithID('change controller to reset'); - // await pressBack(); - // await checkButtonAndClickWithID('TextTimerFormatSample'); - // await checkButtonAndClickWithID('change format'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Blank - // */ - // it(`BlankBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Blank'); - // await checkButtonAndClickWithID('BlankCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('BlankWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('BlankHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('BlankPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('BlankMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('BlankMinSample'); - // await checkButtonAndClickWithID('change min 0 to 60'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页Radio - // */ - // it(`RadioBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('Radio'); - // await checkButtonAndClickWithID('RadioCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('RadioWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('RadioHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('RadioPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('RadioMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await pressBack(); - // }) - // - // /** - // * 点击首页ScrollBar - // */ - // it(`ScrollBarBenchMarkTest`, 0, async () => { - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('ScrollBar'); - // await checkButtonAndClickWithID('ScrollBarCreateSample'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarWidthSample'); - // await checkButtonAndClickWithID('change width 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarHeightSample'); - // await checkButtonAndClickWithID('change height 100 to 200'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarPaddingSample'); - // await checkButtonAndClickWithID('change padding 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarMarginSample'); - // await checkButtonAndClickWithID('change margin 20 to 30'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarDirectionSample'); - // await checkButtonAndClickWithID('change direction'); - // await pressBack(); - // await checkButtonAndClickWithID('ScrollBarStateSample'); - // await checkButtonAndClickWithID('change state to On'); - // await checkButtonAndClickWithID('change state to Auto'); - // await pressBack(); - // await pressBack(); - // }) + + //点击首页TextArea + it(`TextAreaBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextArea'); + await checkButtonAndClickWithID('TextAreaCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaTextAlignSample'); + await checkButtonAndClickWithID('change textAlign to Start'); + await checkButtonAndClickWithID('change textAlign to Center'); + await checkButtonAndClickWithID('change textAlign to End'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaFontSample'); + await checkButtonAndClickWithID('change font'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaTextSample'); + await checkButtonAndClickWithID('change textAreaTextLength 10 to 100'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaMaxLinesSample'); + await checkButtonAndClickWithID('change maxLines 1 to 3'); + await pressBack(); + await pressBack(); + }) + + //点击首页Search + it(`SearchBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Search'); + await checkButtonAndClickWithID('SearchCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SearchValueSample'); + await checkButtonAndClickWithID('change searchValueLength 10 to 100'); + await pressBack(); + await checkButtonAndClickWithID('SearchTextAlignSample'); + await checkButtonAndClickWithID('change textAlign to Start'); + await checkButtonAndClickWithID('change textAlign to Center'); + await checkButtonAndClickWithID('change textAlign to End'); + await pressBack(); + await checkButtonAndClickWithID('SearchWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SearchHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SearchPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SearchMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SearchTextFontSample'); + await checkButtonAndClickWithID('change textFont'); + await pressBack(); + await checkButtonAndClickWithID('SearchPlaceholderFontSample'); + await checkButtonAndClickWithID('change placeholderFont'); + await pressBack(); + await pressBack(); + }) + + //点击首页Progress + it(`ProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Progress'); + await checkButtonAndClickWithID('ProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressTypeSample'); + await checkButtonAndClickWithID('change progressType to Linear'); + await checkButtonAndClickWithID('change progressType to Ring'); + await checkButtonAndClickWithID('change progressType to Eclipse'); + await checkButtonAndClickWithID('change progressType to ScaleRing'); + await checkButtonAndClickWithID('change progressType to Capsule'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressStyleSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressLinearSample'); + await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); + await pressBack(); + await checkButtonAndClickWithID('ProgressRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressScaleRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await pressBack(); + }) + + //点击首页Marquee + it(`MarqueeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Marquee'); + //创建Marquee组件 + await checkButtonAndClickWithID('MarqueeCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('MarqueeWidth'); + await checkButtonAndClickWithID('MarqueeChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('MarqueeHeight'); + await checkButtonAndClickWithID('MarqueeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MarqueePadding'); + await checkButtonAndClickWithID('MarqueeChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('MarqueeMargin'); + await checkButtonAndClickWithID('MarqueeChangeMargin'); + await pressBack(); + // 改变Src + await checkButtonAndClickWithID('MarqueeSrc'); + await checkButtonAndClickWithID('MarqueeChangeSrc'); + await pressBack(); + // 改变Step + await checkButtonAndClickWithID('MarqueeStep'); + await checkButtonAndClickWithID('MarqueeChangeStep'); + await pressBack(); + // 改变FromStart + await checkButtonAndClickWithID('MarqueeFromStart'); + await checkButtonAndClickWithID('MarqueeChangeFromStart'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页DataPanel + it(`DataPanelBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('DataPanel'); + //创建DataPanel组件 + await checkButtonAndClickWithID('DataPanelCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DataPanelWidth'); + await checkButtonAndClickWithID('DataPanelChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DataPanelHeight'); + await checkButtonAndClickWithID('DataPanelChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DataPanelPadding'); + await checkButtonAndClickWithID('DataPanelChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('DataPanelMargin'); + await checkButtonAndClickWithID('DataPanelChangeMargin'); + await pressBack(); + // 改变CloseEffect + await checkButtonAndClickWithID('DataPanelCloseEffect'); + await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); + await pressBack(); + // 改变StrokeWidth + await checkButtonAndClickWithID('DataPanelStrokeWidth'); + await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); + await pressBack(); + // 改变Radius + await checkButtonAndClickWithID('DataPanelRadius'); + await checkButtonAndClickWithID('DataPanelChangeRadius'); + await pressBack(); + // 改变OffsetX + await checkButtonAndClickWithID('DataPanelOffsetX'); + await checkButtonAndClickWithID('DataPanelChangeOffsetX'); + await pressBack(); + // 改变OffsetY + await checkButtonAndClickWithID('DataPanelOffsetY'); + await checkButtonAndClickWithID('DataPanelChangeOffsetY'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Rating + it(`RatingBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Rating'); + //创建Rating组件 + await checkButtonAndClickWithID('RatingCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('RatingWidth'); + await checkButtonAndClickWithID('RatingChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('RatingHeight'); + await checkButtonAndClickWithID('RatingChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('RatingPadding'); + await checkButtonAndClickWithID('RatingChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('RatingMargin'); + await checkButtonAndClickWithID('RatingChangeMargin'); + await pressBack(); + // 改变Stars + await checkButtonAndClickWithID('RatingStars'); + await checkButtonAndClickWithID('RatingChangeStars'); + await pressBack(); + // 改变StarStyle + await checkButtonAndClickWithID('RatingStarStyle'); + await checkButtonAndClickWithID('RatingChangeStarStyle'); + await pressBack(); + // 改变OptionsRating + await checkButtonAndClickWithID('RatingOptionsRating'); + await checkButtonAndClickWithID('RatingChangeOptionsRating'); + await pressBack(); + // Click + await checkButtonAndClickWithID('RatingClick'); + await checkButtonAndClickWithID('RatingClickIndex6'); + await pressBack(); + // swip + await checkButtonAndClickWithID('RatingSwip'); + await driver.swipe(50, 600, 500, 600); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页TextClock + it(`TextClockBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('TextClock'); + await checkButtonAndClickWithID('TextClockCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextClockWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + //点击首页Hyperlink + it(`HyperlinkBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Hyperlink'); + await checkButtonAndClickWithID('HyperlinkCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页QRCode 单元测试失败 + it(`QRCodeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('QRCode'); + await checkButtonAndClickWithID('QRCodeCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await checkButtonAndClickWithID('QRCodeWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodePaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页Gauge + it(`GaugeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Gauge'); + await checkButtonAndClickWithID('GaugeCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('GaugeWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugeHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 10'); + await pressBack(); + // await checkButtonAndClickWithID('GaugeTrackShadowSample'); + // await checkButtonAndClickWithID('change trackShadow'); + // await pressBack(); + await checkButtonAndClickWithID('GaugeAngleSample'); + await checkButtonAndClickWithID('change angle'); + await pressBack(); + await pressBack(); + }) + + //点击首页Badge + it(`BadgeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Badge'); + //创建Badge组件 + await checkButtonAndClickWithID('BadgeCreate'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('BadgeSize'); + await checkButtonAndClickWithID('BadgeChangeSize'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('BadgeColor'); + await checkButtonAndClickWithID('BadgeChangeColor'); + await pressBack(); + //改变FontSize + await checkButtonAndClickWithID('BadgeFontSize'); + await checkButtonAndClickWithID('BadgeChangeFontSize'); + await pressBack(); + //改变FontWeight + await checkButtonAndClickWithID('BadgeFontWeight'); + await checkButtonAndClickWithID('BadgeChangeFontWeight'); + await pressBack(); + //改变BorderWidth + await checkButtonAndClickWithID('BadgeBorderWidth'); + await checkButtonAndClickWithID('BadgeChangeBorderWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页AlphabetIndexer + it(`AlphabetIndexerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('AlphabetIndexer'); + //创建AlphabetIndexerCreate组件 + await checkButtonAndClickWithID('AlphabetIndexerCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); + await pressBack(); + //改变PopupColor + await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); + await pressBack(); + //改变SelectedBackgroundColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); + await pressBack(); + // 改变PopupBackground + await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); + await pressBack(); + //改变SelectedFont + await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); + await pressBack(); + //改变popupFont + await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Menu + it(`MenuBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Menu'); + //创建Menu组件 + await checkButtonAndClickWithID('MenuCreate'); + await pressBack(); + //改变Font + await checkButtonAndClickWithID('MenuFont'); + await checkButtonAndClickWithID('MenuChangeFont'); + await pressBack(); + //改变FontColor + await checkButtonAndClickWithID('MenuFontColor'); + await checkButtonAndClickWithID('MenuChangeFontColor'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('MenuWidth'); + await checkButtonAndClickWithID('MenuChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('MenuHeight'); + await checkButtonAndClickWithID('MenuChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MenuPadding'); + await checkButtonAndClickWithID('MenuChangePadding'); + await pressBack(); + // 变Margin + await checkButtonAndClickWithID('MenuMargin'); + await checkButtonAndClickWithID('MenuChangeMargin'); + await pressBack(); + // Menu展开菜单Expend + await checkButtonAndClickWithID('MenuFirstExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); + await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后再次展开菜单Expend + await checkButtonAndClickWithID('MenuSecondExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后多次关闭 + await checkButtonAndClickWithID('MenuMoreClose'); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await checkButtonAndClickWithID('MenuMoreCloseSencond'); + await checkButtonAndClickWithID('MenuMoreCloseThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await pressBack(); + // Group收起后再次展开 + await checkButtonAndClickWithID('MenuGroupCloseExpand'); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await pressBack(); + // Group多次关闭 + await checkButtonAndClickWithID('MenuGroupMoreClose'); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页TextPicker + it(`TextPickerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('TextPicker'); + //创建TextPicker组件 + await checkButtonAndClickWithID('TextPickerCreate'); + await pressBack(); + //改变TextStyle + await checkButtonAndClickWithID('TextPickerTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeTextStyle'); + await pressBack(); + //改变SelectedTextStyle + await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); + await pressBack(); + //改变DisappearTextStyle + await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('TextPickerWidth'); + await checkButtonAndClickWithID('TextPickerChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('TextPickerHeight'); + await checkButtonAndClickWithID('TextPickerChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextPickerPadding'); + await checkButtonAndClickWithID('TextPickerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TextPickerMargin'); + await checkButtonAndClickWithID('TextPickerChangeMargin'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('TextPickerFingerSwip'); + await driver.swipe(150, 300, 150, 150) + await pressBack(); + //手指点击 + await checkButtonAndClickWithID('TextPickerClick'); + await driver.click(150, 150) + await driver.delayMs(1000); + await pressBack(); + //鼠标滚轮MouseScroll + await checkButtonAndClickWithID('TextPickerMouseScroll'); + await driver.mouseScroll({ + x: 150, y: 200 + }, true, 5); + await driver.delayMs(1000); + await pressBack(); + //键盘Scroll + await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + await driver.swipe(150, 300, 150, 150) + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Counter + it(`CounterBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Counter'); + //创建Counter组件 + await checkButtonAndClickWithID('CounterCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变width + await checkButtonAndClickWithID('CounterWidth'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeWidth'); + await driver.delayMs(1000); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('CounterHeight'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeHeight'); + await driver.delayMs(1000); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('CounterPadding'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangePadding'); + await driver.delayMs(1000); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('CounterMargin'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeMargin'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页XComponent + it(`XComponentBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('XComponent'); + //创建XComponent组件 + await checkButtonAndClickWithID('XComponentCreate'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页PatternLock + it(`PatternLockBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('PatternLock'); + //创建PatternLock组件 + await checkButtonAndClickWithID('PatternLockCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SideLength + await checkButtonAndClickWithID('PatternLockSideLength'); + await checkButtonAndClickWithID('PatternLockChangeSideLength'); + await pressBack(); + //改变CircleRadius + await checkButtonAndClickWithID('PatternLockCircleRadius'); + await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); + await pressBack(); + //改变RegularColor + await checkButtonAndClickWithID('PatternLockRegularColor'); + await checkButtonAndClickWithID('PatternLockChangeRegularColor'); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('PatternLockSelectedColor'); + await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); + await pressBack(); + //改变ActiveColor + await checkButtonAndClickWithID('PatternLockActiveColor'); + await checkButtonAndClickWithID('PatternLockChangeActiveColor'); + await pressBack(); + //改变PathColor + await checkButtonAndClickWithID('PatternLockPathColor'); + await checkButtonAndClickWithID('PatternLockChangePathColor'); + await pressBack(); + //改变PathStrokeWidth + await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); + await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Shape + it(`ShapeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Shape'); + //创建Shape组件 + await checkButtonAndClickWithID('ShapeCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('ShapeFill'); + await checkButtonAndClickWithID('ShapeChangeFill'); + await pressBack(); + //改变FillOpacity + await checkButtonAndClickWithID('ShapeFillOpacity'); + await checkButtonAndClickWithID('ShapeChangeFillOpacity'); + await pressBack(); + //改变stroke + await checkButtonAndClickWithID('ShapeStroke'); + await checkButtonAndClickWithID('ShapeChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('ShapeStrokeDashArray'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('ShapeStrokeDashOffset'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('ShapeStrokeWidth'); + await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('ShapeWidth'); + await checkButtonAndClickWithID('ShapeChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('ShapeHeight'); + await checkButtonAndClickWithID('ShapeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('ShapePadding'); + await checkButtonAndClickWithID('ShapeChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('ShapeMargin'); + await checkButtonAndClickWithID('ShapeChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Path + it(`PathBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Path'); + //创建Path组件 + await checkButtonAndClickWithID('PathCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('PathFill'); + await checkButtonAndClickWithID('PathChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('PathFillOpacity'); + await checkButtonAndClickWithID('PathChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('PathStroke'); + await checkButtonAndClickWithID('PathChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('PathStrokeDashArray'); + await checkButtonAndClickWithID('PathChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('PathStrokeDashOffset'); + await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('PathStrokeWidth'); + await checkButtonAndClickWithID('PathChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('PathWidth'); + await checkButtonAndClickWithID('PathChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('PathHeight'); + await checkButtonAndClickWithID('PathChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('PathPadding'); + await checkButtonAndClickWithID('PathChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('PathMargin'); + await checkButtonAndClickWithID('PathChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Line + it(`LineBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Line'); + //创建Line组件 + await checkButtonAndClickWithID('LineCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('LineFill'); + await checkButtonAndClickWithID('LineChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('LineFillOpacity'); + await checkButtonAndClickWithID('LineChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('LineStroke'); + await checkButtonAndClickWithID('LineChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('LineStrokeDashArray'); + await checkButtonAndClickWithID('LineChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('LineStrokeDashOffset'); + await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('LineStrokeWidth'); + await checkButtonAndClickWithID('LineChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('LineWidth'); + await checkButtonAndClickWithID('LineChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('LineHeight'); + await checkButtonAndClickWithID('LineChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('LinePadding'); + await checkButtonAndClickWithID('LineChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('LineMargin'); + await checkButtonAndClickWithID('LineChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Circle + it(`CircleBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Circle'); + await checkButtonAndClickWithID('CircleCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('CircleWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CircleHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CirclePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('CircleMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页Polyline + it(`PolylineBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Polyline'); + await checkButtonAndClickWithID('PolylineCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('PolylineWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylineHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylinePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('PolylineMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页SideBarContainer + it(`SideBarContainerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('SideBarContainer'); + await checkButtonAndClickWithID('SideBarContainerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); + await checkButtonAndClickWithID('change showSideBar'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerControlButtonSample'); + await checkButtonAndClickWithID('change controlButton'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); + await checkButtonAndClickWithID('change showControlButton'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); + await checkButtonAndClickWithID('change sideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); + await checkButtonAndClickWithID('change autoHide'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); + await checkButtonAndClickWithID('change sideBarPosition'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDividerSample'); + await checkButtonAndClickWithID('change divider'); + await pressBack(); + await driver.swipe(540, 1000, 540, 500); + await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); + await checkButtonAndClickWithID('change minContentWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); + await checkButtonAndClickWithID('change minSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); + await checkButtonAndClickWithID('change maxSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); + await driver.delayMs(1000); + await driver.swipe(300, 500, 100, 500); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragContentSample'); + await driver.delayMs(1000); + await driver.drag(300, 500, 500, 500); + await pressBack(); + await pressBack(); + }) + + //点击首页ImageAnimator + it(`ImageAnimatorBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('ImageAnimator'); + await checkButtonAndClickWithID('ImageAnimatorCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorImagesSample'); + await checkButtonAndClickWithID('change images'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorStateSample'); + await checkButtonAndClickWithID('change state'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorDurationSample'); + await checkButtonAndClickWithID('change duration'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorReverseSample'); + await checkButtonAndClickWithID('change reverse'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); + await checkButtonAndClickWithID('change fixedSize'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); + await checkButtonAndClickWithID('change fillMode'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); + await checkButtonAndClickWithID('change iterations'); + await pressBack(); + await pressBack(); + }) + + //点击首页LoadingProgress + it(`LoadingProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('LoadingProgress'); + await checkButtonAndClickWithID('LoadingProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); + await checkButtonAndClickWithID('change enableLoading'); + await pressBack(); + await pressBack(); + }) + + //点击首页TextTimer + it(`TextTimerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('TextTimer'); + await checkButtonAndClickWithID('TextTimerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerControllerSample'); + await checkButtonAndClickWithID('change controller to start'); + await checkButtonAndClickWithID('change controller to pause'); + await checkButtonAndClickWithID('change controller to reset'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + //点击首页Blank + it(`BlankBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Blank'); + await checkButtonAndClickWithID('BlankCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('BlankWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMinSample'); + await checkButtonAndClickWithID('change min 0 to 60'); + await pressBack(); + await pressBack(); + }) + + //点击首页Radio + it(`RadioBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Radio'); + await checkButtonAndClickWithID('RadioCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('RadioWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('RadioMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页ScrollBar + it(`ScrollBarBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('ScrollBar'); + await checkButtonAndClickWithID('ScrollBarCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarDirectionSample'); + await checkButtonAndClickWithID('change direction'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarStateSample'); + await checkButtonAndClickWithID('change state to On'); + await checkButtonAndClickWithID('change state to Auto'); + await pressBack(); + await pressBack(); + }) + }) } \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets deleted file mode 100644 index 2a843ceb7ff06977c8562be064837ff35cfb5463..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets +++ /dev/null @@ -1,957 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 3000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(3000); -} - -export default function firstProjectTest() { - describe('ActsFirstProjectTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - //点击首页Text - it(`TextBenchMarkTest`, 0, async () => { - await driver.delayMs(5000); - await checkButtonAndClickWithID('Text'); - //创建Text组件 - await checkButtonAndClickWithID('TextCreate10Char'); - await driver.delayMs(1000); - await pressBack(); - await checkButtonAndClickWithID('TextCreate100Char'); - await driver.delayMs(1000); - await pressBack(); - //改变Align - await checkButtonAndClickWithID('TextAlign10char'); - await checkButtonAndClickWithID('TextAlign.Start'); - await checkButtonAndClickWithID('TextAlign.Center'); - await checkButtonAndClickWithID('TextAlign.End'); - await pressBack(); - // await checkButtonAndClickWithID('TextAlign100Char'); - // await checkButtonAndClickWithID('TextAlign.Start'); - // await checkButtonAndClickWithID('TextAlign.Center'); - // await checkButtonAndClickWithID('TextAlign.End'); - // await pressBack(); - //改变width - await checkButtonAndClickWithID('TextWidth10Char'); - await checkButtonAndClickWithID('TextChangeWidth'); - await pressBack(); - // await checkButtonAndClickWithID('TextWidth100Char'); - // await checkButtonAndClickWithID('TextChangeWidth'); - // await pressBack(); - //改变height - await checkButtonAndClickWithID('TextHeight10Char'); - await checkButtonAndClickWithID('TextChangeHeight'); - await pressBack(); - // await checkButtonAndClickWithID('TextHeight100Char'); - // await checkButtonAndClickWithID('TextChangeHeight'); - // await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TextPadding10Char'); - await checkButtonAndClickWithID('TextChangePadding'); - await pressBack(); - // await checkButtonAndClickWithID('TextPadding100Char'); - // await checkButtonAndClickWithID('TextChangePadding'); - // await pressBack(); - //改变Margin - await checkButtonAndClickWithID('TextMargin10Char'); - await checkButtonAndClickWithID('TextChangeMargin'); - await pressBack(); - // await checkButtonAndClickWithID('TextMargin100Char'); - // await checkButtonAndClickWithID('TextChangeMargin'); - // await pressBack(); - //改变Font - await checkButtonAndClickWithID('TextFont10Char'); - await checkButtonAndClickWithID('TextChangeFont'); - await pressBack(); - // await checkButtonAndClickWithID('TextFont100Char'); - // await checkButtonAndClickWithID('TextChangeFont'); - // await pressBack(); - //改变Text文本长度 - await checkButtonAndClickWithID('TextContent10Char'); - await checkButtonAndClickWithID('TextChangeContent'); - await pressBack(); - // await checkButtonAndClickWithID('TextContent100Char'); - // await checkButtonAndClickWithID('TextChangeContent'); - // await pressBack(); - //改变TextIndent - await checkButtonAndClickWithID('TextTextIndent10Char'); - await checkButtonAndClickWithID('TextChangeTextIndent'); - await pressBack(); - // await checkButtonAndClickWithID('TextTextIndent100Char'); - // await checkButtonAndClickWithID('TextChangeTextIndent'); - // await pressBack(); - //改变TextCase - await checkButtonAndClickWithID('TextTextCase10Char'); - await checkButtonAndClickWithID('TextChangeTextCase'); - await pressBack(); - // await checkButtonAndClickWithID('TextTextCase100Char'); - // await checkButtonAndClickWithID('TextChangeTextCase'); - // await pressBack(); - //改变LetterSpacing - await checkButtonAndClickWithID('TextLetterSpacing10Char'); - await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); - await pressBack(); - // await checkButtonAndClickWithID('TextLetterSpacing100Char'); - // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); - // await pressBack(); - //改变BaselineOffset - await checkButtonAndClickWithID('TextBaselineOffset10Char'); - await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - await pressBack(); - // await checkButtonAndClickWithID('TextBaselineOffset100Char'); - // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - // await pressBack(); - await driver.swipe(360, 2100, 360, 300, 40000) - // 改变TextBaselineOffset - await checkButtonAndClickWithID('TextLineHeight10Char'); - await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - await pressBack(); - // await checkButtonAndClickWithID('TextLineHeight100Char'); - // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); - // await pressBack(); - // await driver.swipe(360, 1100, 360, 500, 200) - //改变TextChangeMaxLines - await checkButtonAndClickWithID('TextMaxLines10Char'); - await checkButtonAndClickWithID('TextChangeMaxLines'); - await pressBack(); - // await checkButtonAndClickWithID('TextMaxLines100Char'); - // await checkButtonAndClickWithID('TextChangeMaxLines'); - // await pressBack(); - //改变Overflow - await checkButtonAndClickWithID('TextOverflow10Char'); - await checkButtonAndClickWithID('TextChangeOverflow'); - await pressBack(); - // await checkButtonAndClickWithID('TextOverflow100Char'); - // await checkButtonAndClickWithID('TextChangeOverflow'); - // await pressBack(); - //改变heightAdaptivePolicy maxLine - await checkButtonAndClickWithID('heightAdaptivePolicyOne10Char'); - await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); - await pressBack(); - // await checkButtonAndClickWithID('heightAdaptivePolicyOne100Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); - // await pressBack(); - //改变heightAdaptivePolicy minfontSize - await driver.delayMs(1000); - await checkButtonAndClickWithID('heightAdaptivePolicyTwo10Char'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); - await driver.delayMs(1000); - await pressBack(); - // await checkButtonAndClickWithID('heightAdaptivePolicyTwo100Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); - // await pressBack(); - //改变heightAdaptivePolicy content - await driver.delayMs(1000); - await checkButtonAndClickWithID('heightAdaptivePolicyThree10Char'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); - await driver.delayMs(1000); - await pressBack(); - // await checkButtonAndClickWithID('heightAdaptivePolicyThree100Char'); - // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); - // await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页TextInput - it(`TextInputBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextInput'); - //创建TextInput组件 - await checkButtonAndClickWithID('TextInputCreate10Char'); - await driver.delayMs(1000); - await pressBack(); - // await driver.delayMs(1000); - // await checkButtonAndClickWithID('TextInputCreate100Char'); - // await driver.delayMs(1000); - // await pressBack(); - - //改变width - await checkButtonAndClickWithID('TextInputWidth10Char'); - await checkButtonAndClickWithID('TextInputChangeWidth'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputWidth100Char'); - // await checkButtonAndClickWithID('TextInputChangeWidth'); - // await pressBack(); - - //改变height - await checkButtonAndClickWithID('TextInputHeight10Char'); - await checkButtonAndClickWithID('TextInputChangeHeight'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputHeight100Char'); - // await checkButtonAndClickWithID('TextInputChangeHeight'); - // await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TextInputPadding10Char'); - await checkButtonAndClickWithID('TextInputChangePadding'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputPadding100Char'); - // await checkButtonAndClickWithID('TextInputChangePadding'); - // await pressBack(); - - //改变Margin - await checkButtonAndClickWithID('TextInputMargin10Char'); - await checkButtonAndClickWithID('TextInputChangeMargin'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputMargin100Char'); - // await checkButtonAndClickWithID('TextInputChangeMargin'); - // await pressBack(); - - //改变Align - await checkButtonAndClickWithID('TextInputAlign10Char'); - await checkButtonAndClickWithID('TextInputAlign.Start'); - await checkButtonAndClickWithID('TextInputAlign.Center'); - await checkButtonAndClickWithID('TextInputAlign.End'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputAlign100Char'); - // await checkButtonAndClickWithID('TextInputAlign.Start'); - // await checkButtonAndClickWithID('TextInputAlign.Center'); - // await checkButtonAndClickWithID('TextInputAlign.End'); - // await pressBack(); - - //改变InputType - await checkButtonAndClickWithID('TextInputType10Char'); - await checkButtonAndClickWithID('TextInputType.Norma'); - await checkButtonAndClickWithID('TextInputType.Password'); - await checkButtonAndClickWithID('TextInputType.Email'); - await checkButtonAndClickWithID('TextInputType.Number'); - await checkButtonAndClickWithID('TextInputType.PhoneNumber'); - await pressBack(); - // await checkButtonAndClickWithID('TextInputType100Char'); - // await checkButtonAndClickWithID('TextInputType.Norma'); - // await checkButtonAndClickWithID('TextInputType.Password'); - // await checkButtonAndClickWithID('TextInputType.Email'); - // await checkButtonAndClickWithID('TextInputType.Number'); - // await checkButtonAndClickWithID('TextInputType.PhoneNumber'); - // await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页Image - it(`ImageBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Image'); - await checkButtonAndClickWithID('ImageCreate'); - await pressBack(); - await checkButtonAndClickWithID('ImageWidth'); - await checkButtonAndClickWithID('ImageWidth'); - await pressBack(); - await checkButtonAndClickWithID('ImageHeight'); - await checkButtonAndClickWithID('ImageHeight'); - await pressBack(); - await checkButtonAndClickWithID('ImagePadding'); - await checkButtonAndClickWithID('ImagePadding'); - await pressBack(); - await checkButtonAndClickWithID('ImageMargin'); - await checkButtonAndClickWithID('ImageMargin'); - await pressBack(); - await checkButtonAndClickWithID('ImageObjectFit'); - await checkButtonAndClickWithID('ImageObjectFit_Contain'); - await checkButtonAndClickWithID('ImageObjectFit_Cover'); - await checkButtonAndClickWithID('ImageObjectFit_Auto'); - await checkButtonAndClickWithID('ImageObjectFit_Fill'); - await checkButtonAndClickWithID('ImageObjectFit_ScaleDown'); - await checkButtonAndClickWithID('ImageObjectFit_None'); - await pressBack(); - await checkButtonAndClickWithID('ImageObjectRepeat'); - await checkButtonAndClickWithID('ImageObjectRepeat_X'); - await checkButtonAndClickWithID('ImageObjectRepeat_Y'); - await checkButtonAndClickWithID('ImageObjectRepeat_XY'); - await checkButtonAndClickWithID('ImageObjectRepeat_NoRepeat'); - await pressBack(); - await checkButtonAndClickWithID('ImageAutoResize'); - await checkButtonAndClickWithID('ImageAutoResize'); - await pressBack(); - await checkButtonAndClickWithID('ImageInterpolation'); - await checkButtonAndClickWithID('ImageInterpolation_None'); - await checkButtonAndClickWithID('ImageInterpolation_High'); - await checkButtonAndClickWithID('ImageInterpolation_Medium'); - await checkButtonAndClickWithID('ImageInterpolation_Low'); - await pressBack(); - await checkButtonAndClickWithID('ImageFitOriginalSize'); - await checkButtonAndClickWithID('ImageFitOriginalSize'); - await pressBack(); - await pressBack(); - }) - - //点击首页Row - it(`RowBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Row'); - //创建Row组件 - await checkButtonAndClickWithID('RowCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('RowWidth'); - await checkButtonAndClickWithID('RowChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('RowHeight'); - await checkButtonAndClickWithID('RowChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('RowPadding'); - await checkButtonAndClickWithID('RowChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('RowMargin'); - await checkButtonAndClickWithID('RowChangeMargin'); - await pressBack(); - //改变space - await checkButtonAndClickWithID('RowSpace'); - await checkButtonAndClickWithID('RowChangeSpace'); - await pressBack(); - //改变magin space - await checkButtonAndClickWithID('RowMarginSpace'); - await checkButtonAndClickWithID('RowChangeMarginSpace'); - await pressBack(); - //改变Aligin - await checkButtonAndClickWithID('RowAlign'); - await checkButtonAndClickWithID('VerticalAlign.Top'); - await checkButtonAndClickWithID('VerticalAlign.Center'); - await checkButtonAndClickWithID('VerticalAlign.Bottom'); - await pressBack(); - //改变JustifyContent - await checkButtonAndClickWithID('RowJustify'); - await checkButtonAndClickWithID('FlexAlign.Start'); - await checkButtonAndClickWithID('FlexAlign.Center'); - await checkButtonAndClickWithID('FlexAlign.End'); - await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Column - it(`ColumnBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Column'); - //创建Column组件 - await checkButtonAndClickWithID('ColumnCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('ColumnWidth'); - await checkButtonAndClickWithID('ColumnChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('ColumnHeight'); - await checkButtonAndClickWithID('ColumnChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('ColumnPadding'); - await checkButtonAndClickWithID('ColumnChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('ColumnMargin'); - await checkButtonAndClickWithID('ColumnChangeMargin'); - await pressBack(); - //改变space - await checkButtonAndClickWithID('ColumnSpace'); - await checkButtonAndClickWithID('ColumnChangeSpace'); - await pressBack(); - //改变magin space - await checkButtonAndClickWithID('ColumnMarginSpace'); - await checkButtonAndClickWithID('ColumnChangeMarginSpace'); - await pressBack(); - //改变Aligin - await checkButtonAndClickWithID('ColumnAlign'); - await checkButtonAndClickWithID('HorizontalAlign.Start'); - await checkButtonAndClickWithID('HorizontalAlign.Center'); - await checkButtonAndClickWithID('HorizontalAlign.End'); - await pressBack(); - //改变JustifyContent - await checkButtonAndClickWithID('ColumnJustify'); - await checkButtonAndClickWithID('FlexAlign.Start'); - await checkButtonAndClickWithID('FlexAlign.Center'); - await checkButtonAndClickWithID('FlexAlign.End'); - await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); - await pressBack(); - await pressBack(); //返回首页 - }) - - ///////////////////////// - - //点击首页List - it(`ListBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('List'); - - await checkButtonAndClickWithID('ListCreate'); - await pressBack(); - - await checkButtonAndClickWithID('ListWidth'); - await checkButtonAndClickWithID('ListWidth'); - await pressBack(); - - await checkButtonAndClickWithID('ListHeight'); - await checkButtonAndClickWithID('ListHeight'); - await pressBack(); - - await checkButtonAndClickWithID('ListPadding'); - await checkButtonAndClickWithID('ListPadding'); - await pressBack(); - - await checkButtonAndClickWithID('ListMargin'); - await checkButtonAndClickWithID('ListMargin'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemWidth'); - await checkButtonAndClickWithID('ListItemWidth'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemHeight'); - await checkButtonAndClickWithID('ListItemHeight'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemPadding'); - await checkButtonAndClickWithID('ListItemPadding'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemMargin'); - await checkButtonAndClickWithID('ListItemMargin'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemGroupDivider'); - await checkButtonAndClickWithID('ListItemGroupDivider'); - await pressBack(); - - await checkButtonAndClickWithID('ListItemGroupSpace'); - await checkButtonAndClickWithID('ListItemGroupSpace'); - await pressBack(); - - await checkButtonAndClickWithID('ListSpace'); - await checkButtonAndClickWithID('ListSpace'); - await pressBack(); - - await checkButtonAndClickWithID('ListListDirection'); - await checkButtonAndClickWithID('ListListDirection'); - await pressBack(); - - await checkButtonAndClickWithID('ListAlignListItem'); - await checkButtonAndClickWithID('ListAlignListItem_Start'); - await checkButtonAndClickWithID('ListAlignListItem_Center'); - await checkButtonAndClickWithID('ListAlignListItem_End'); - await pressBack(); - - await checkButtonAndClickWithID('ListLanes'); - await checkButtonAndClickWithID('ListLanes'); - await pressBack(); - - await checkButtonAndClickWithID('ListCachedCount'); - await checkButtonAndClickWithID('ListCachedCount'); - await pressBack(); - - await checkButtonAndClickWithID('ListDivider'); - await checkButtonAndClickWithID('ListDivider'); - await pressBack(); - - await checkButtonAndClickWithID('ListScrollBar'); - await checkButtonAndClickWithID('ListScrollBar_Off'); - await checkButtonAndClickWithID('ListScrollBar_On'); - await checkButtonAndClickWithID('ListScrollBar_Auto'); - await pressBack(); - - await checkButtonAndClickWithID('ListRemoveItem'); - await checkButtonAndClickWithID('ListChangeRemoveItem'); - await pressBack(); - - await checkButtonAndClickWithID('ListAddItem'); - await checkButtonAndClickWithID('ListAddItem'); - await pressBack(); - - await checkButtonAndClickWithID('ListEdgeEffect'); - await checkButtonAndClickWithID('ListEdgeEffect_Spring'); - await driver.swipe(600, 900, 600, 100); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListEdgeEffect_Fade'); - await driver.swipe(100, 300, 100, 900); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListEdgeEffect_None'); - await driver.swipe(600, 900, 600, 100); - await driver.delayMs(1000); - await pressBack(); - - await checkButtonAndClickWithID('ListChainAnimation'); - await checkButtonAndClickWithID('ListChainAnimation'); - await driver.swipe(600, 900, 600, 100); - await driver.delayMs(1000); - await pressBack(); - - await checkButtonAndClickWithID('ListFriction'); - await checkButtonAndClickWithID('ListFriction'); - await driver.swipe(600, 900, 600, 100); - await driver.delayMs(1000); - await pressBack(); - - await checkButtonAndClickWithID('ListEnableScrollInteraction'); - await checkButtonAndClickWithID('ListEnableScrollInteraction_true'); - await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); - await driver.delayMs(500); - await checkButtonAndClickWithID('ListEnableScrollInteraction_false'); - await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); - await driver.delayMs(500); - await pressBack(); - - await checkButtonAndClickWithID('ListScrollSnapAlign'); - await checkButtonAndClickWithID('ListScrollSnapAlign_NONE'); - await driver.swipe(600, 1080, 600, 300); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListScrollSnapAlign_START'); - await driver.swipe(100, 500, 100, 1080); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListScrollSnapAlign_CENTER'); - await driver.swipe(600, 1080, 600, 100); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListScrollSnapAlign_END'); - await driver.swipe(100, 500, 100, 1080); - await driver.delayMs(1000); - await pressBack(); - - await checkButtonAndClickWithID('ListChainAnimationOptions'); - await checkButtonAndClickWithID('ListChainAnimationOptions'); - await driver.swipe(600, 1080, 600, 300); - await driver.delayMs(1000); - await pressBack(); - - await checkButtonAndClickWithID('ListSticky'); - await checkButtonAndClickWithID('ListSticky_None'); - await driver.swipe(600, 1080, 600, 300); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListSticky_Header'); - await driver.swipe(100, 500, 100, 1080); - await driver.delayMs(1000); - await checkButtonAndClickWithID('ListSticky_Footer'); - await driver.swipe(600, 1080, 600, 100); - await driver.delayMs(1000); - await pressBack(); - - await pressBack(); - }) - - //点击首页Swiper - it(`SwiperBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Swiper'); - await checkButtonAndClickWithID('SwiperCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('SwiperWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('SwiperHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('SwiperPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SwiperMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SwiperIndexSample'); - await checkButtonAndClickWithID('change index 5 to 20'); - await pressBack(); - await checkButtonAndClickWithID('SwiperVerticalSample'); - await checkButtonAndClickWithID('change Vertical false to true'); - await pressBack(); - await checkButtonAndClickWithID('SwiperItemSpaceSample'); - await checkButtonAndClickWithID('change itemSpace 0 to 20'); - await pressBack(); - await checkButtonAndClickWithID('SwiperDisplayModeSample'); - await checkButtonAndClickWithID('change displayMode to STRETCH'); - await checkButtonAndClickWithID('change displayMode to AUTO_LINEAR'); - await pressBack(); - await checkButtonAndClickWithID('SwiperDisplayCountSample'); - await checkButtonAndClickWithID('change displayCount 1 to 3'); - await pressBack(); - await checkButtonAndClickWithID('SwiperNextMarginSample'); - await checkButtonAndClickWithID('change nextMargin 0 to 20'); - await pressBack(); - await checkButtonAndClickWithID('SwiperPrevMarginSample'); - await checkButtonAndClickWithID('change prevMargin 0 to 20'); - await pressBack(); - await checkButtonAndClickWithID('SwiperCurveSample'); - await checkButtonAndClickWithID('change curve to Linear'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to Ease'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to EaseIn'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to EaseOut'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to EaseInOut'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to FastOutSlowIn'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to LinearOutSlowIn'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to FastOutLinearIn'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to ExtremeDeceleration'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to Sharp'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to Rhythm'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to Smooth'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change curve to Friction'); - await driver.swipe(500, 800, 100, 800); - await pressBack(); - await checkButtonAndClickWithID('SwiperControllerShowNextSample'); - await checkButtonAndClickWithID('swiperController showNext'); - await pressBack(); - await checkButtonAndClickWithID('SwiperManualSlidingSample'); - await driver.swipe(500, 800, 100, 800); - await pressBack(); - await checkButtonAndClickWithID('SwiperLoopSample'); - await checkButtonAndClickWithID('change loop false to true'); - await driver.swipe(500, 800, 100, 800); - await pressBack(); - await checkButtonAndClickWithID('SwiperEffectModeSample'); - await checkButtonAndClickWithID('change effectMode to Spring'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change effectMode to Fade'); - await driver.swipe(500, 800, 100, 800); - await checkButtonAndClickWithID('change effectMode to None'); - await driver.swipe(500, 800, 100, 800); - await pressBack(); - await checkButtonAndClickWithID('SwiperDurationSample'); - await checkButtonAndClickWithID('change duration 200 to 500'); - await driver.swipe(500, 800, 100, 800); - await pressBack(); - await pressBack(); - }) - - //点击首页Grid - it(`GridBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Grid'); - await checkButtonAndClickWithID('GridCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('GridWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('GridHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('GridPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GridMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRCColumnsTemplateSample'); - await checkButtonAndClickWithID('change columnsTemplate 1fr 1fr to 1fr 1fr 2fr'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRCRowsTemplateSample'); - await checkButtonAndClickWithID('change rowsTemplate 1fr 1fr to 1fr 1fr 2fr'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRCRowsGapSample'); - await checkButtonAndClickWithID('change rowsGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRCColumnsGapSample'); - await checkButtonAndClickWithID('change columnGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridSetCColumnsGapSample'); - await checkButtonAndClickWithID('change columnGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRRowsGapSample'); - await checkButtonAndClickWithID('change rowsGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRColumnsGapSample'); - await checkButtonAndClickWithID('change columnGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridSetRRowsGapSample'); - await checkButtonAndClickWithID('change rowsGap 5 to 10'); - await pressBack(); - await checkButtonAndClickWithID('GridMinCountSample'); - await checkButtonAndClickWithID('change minCount 0 to 5'); - await pressBack(); - await checkButtonAndClickWithID('GridMaxCountSample'); - await checkButtonAndClickWithID('change maxCount 10 to 5'); - await pressBack(); - await checkButtonAndClickWithID('GridNotSetRCColumnsGapSample'); - await checkButtonAndClickWithID('change columnGap 0 to 10'); - await pressBack(); - - await driver.swipe(540, 2100, 540, 300, 200); - - await checkButtonAndClickWithID('GridNotSetRCLayoutDirectionSample'); - await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); - await checkButtonAndClickWithID('change layoutDirection to GridDirection.RowReverse'); - await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); - await checkButtonAndClickWithID('change layoutDirection to GridDirection.ColumnReverse'); - await pressBack(); - await checkButtonAndClickWithID('GridNotSetRCCellLengthSample'); - await checkButtonAndClickWithID('change cellLength 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('GridManualScrollingSample'); - await driver.swipe(540, 1000, 540, 500, 200); - await pressBack(); - await checkButtonAndClickWithID('GridScrollToSample'); - await checkButtonAndClickWithID('change scrollTo to 100'); - await pressBack(); - await checkButtonAndClickWithID('GridScrollEdgeSample'); - await checkButtonAndClickWithID('change scrollEdge to Edge.Bottom'); - await pressBack(); - await checkButtonAndClickWithID('GridScrollBySample'); - await checkButtonAndClickWithID('change scrollBy to 100'); - await pressBack(); - await checkButtonAndClickWithID('GridEdgeEffectSample'); - await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Spring'); - await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Fade'); - await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.None'); - await pressBack(); - await pressBack(); - }) - - //点击首页Video - it(`VideoBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Video'); - await checkButtonAndClickWithID('VideoCreateSample'); - await driver.delayMs(2000); - await pressBack(); - await checkButtonAndClickWithID('VideoWidthSample'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('VideoHeightSample'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('VideoPaddingSample'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('VideoMarginSample'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - ////////////////////// - - //点击首页CheckBox - it(`CheckboxBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('CheckBox'); - //创建CheckBox组件 - await checkButtonAndClickWithID('CheckBoxCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('CheckBoxWidth'); - await checkButtonAndClickWithID('CheckBoxChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('CheckBoxHeight'); - await checkButtonAndClickWithID('CheckBoxChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('CheckBoxPadding'); - await checkButtonAndClickWithID('CheckBoxChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('CheckBoxMargin'); - await checkButtonAndClickWithID('CheckBoxChangeMargin'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('CheckBoxSize'); - await checkButtonAndClickWithID('CheckBoxChangeSize'); - await pressBack(); - //改变Select - await checkButtonAndClickWithID('CheckBoxSelect'); - await checkButtonAndClickWithID('CheckBoxChangeSelect'); - await pressBack(); - //改变MarkStyle - await checkButtonAndClickWithID('CheckBoxMarkStyle'); - await checkButtonAndClickWithID('CheckBoxChangeMarkStyle'); - await pressBack(); - //GroupSelect - await checkButtonAndClickWithID('CheckBoxGroupSelect'); - await checkButtonAndClickWithID('CheckBoxChangeSelect'); - await pressBack(); - //GroupCancelSelect - await checkButtonAndClickWithID('CheckBoxGroupCancelSelect'); - await checkButtonAndClickWithID('CheckBoxChangeCancelSelect'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Toggle - it(`ToggleBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Toggle'); - await checkButtonAndClickWithID('ToggleCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ToggleSelectedColorSample'); - await checkButtonAndClickWithID('change selectedColor'); - await pressBack(); - await checkButtonAndClickWithID('ToggleSwitchPointColorSample'); - await checkButtonAndClickWithID('change switchPointColor'); - await pressBack(); - await checkButtonAndClickWithID('ToggleWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ToggleHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ToggleSizeSample'); - await checkButtonAndClickWithID('change size'); - await pressBack(); - await checkButtonAndClickWithID('TogglePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ToggleMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ToggleSwitchSample'); - await checkButtonAndClickWithID('change toggleIsOn'); - await checkButtonAndClickWithID('change toggleIsOn'); - await pressBack(); - await checkButtonAndClickWithID('ToggleCheckboxSelectSample'); - await checkButtonAndClickWithID('change select'); - await pressBack(); - await checkButtonAndClickWithID('ToggleCheckboxCancelSample'); - await checkButtonAndClickWithID('change cancel'); - await pressBack(); - await pressBack(); - }) - - //点击首页TextArea - it(`TextAreaBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextArea'); - await checkButtonAndClickWithID('TextAreaCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaTextAlignSample'); - await checkButtonAndClickWithID('change textAlign to Start'); - await checkButtonAndClickWithID('change textAlign to Center'); - await checkButtonAndClickWithID('change textAlign to End'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaFontSample'); - await checkButtonAndClickWithID('change font'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaTextSample'); - await checkButtonAndClickWithID('change textAreaTextLength 10 to 100'); - await pressBack(); - await checkButtonAndClickWithID('TextAreaMaxLinesSample'); - await checkButtonAndClickWithID('change maxLines 1 to 3'); - await pressBack(); - await pressBack(); - }) - - //点击首页Search - it(`SearchBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Search'); - await checkButtonAndClickWithID('SearchCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('SearchValueSample'); - await checkButtonAndClickWithID('change searchValueLength 10 to 100'); - await pressBack(); - await checkButtonAndClickWithID('SearchTextAlignSample'); - await checkButtonAndClickWithID('change textAlign to Start'); - await checkButtonAndClickWithID('change textAlign to Center'); - await checkButtonAndClickWithID('change textAlign to End'); - await pressBack(); - await checkButtonAndClickWithID('SearchWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SearchHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SearchPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SearchMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SearchTextFontSample'); - await checkButtonAndClickWithID('change textFont'); - await pressBack(); - await checkButtonAndClickWithID('SearchPlaceholderFontSample'); - await checkButtonAndClickWithID('change placeholderFont'); - await pressBack(); - await pressBack(); - }) - - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets deleted file mode 100644 index 42b5bdb6f4b8b36afdbd3daaab0ac6b5821b9000..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets +++ /dev/null @@ -1,743 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(1000); -} - -export default function gridRowTest() { - describe('ActsGridRowTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - /** - * 点击首页GridRow - */ - it(`GridRowBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('GridRow'); - - await checkButtonAndClickWithID('GridRowCreate'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowWidth'); - await checkButtonAndClickWithID('GridRowWidth'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowHeight'); - await checkButtonAndClickWithID('GridRowHeight'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowPadding'); - await checkButtonAndClickWithID('GridRowPadding'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowMargin'); - await checkButtonAndClickWithID('GridRowMargin'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowColumns'); - await checkButtonAndClickWithID('GridRowColumns'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowGutter'); - await checkButtonAndClickWithID('GridRowGutter'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowDirection'); - await checkButtonAndClickWithID('GridRowDirection'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowBreakpoints'); - await checkButtonAndClickWithID('GridRowBreakpoints'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页GridCol - */ - it(`GridColBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('GridCol'); - - await checkButtonAndClickWithID('GridColCreate'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionSpan'); - await checkButtonAndClickWithID('GridColOptionSpan'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionOffset'); - await checkButtonAndClickWithID('GridColOptionOffset'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionOrder'); - await checkButtonAndClickWithID('GridColOptionOrder'); - await pressBack(); - - await checkButtonAndClickWithID('GridColSpan'); - await checkButtonAndClickWithID('GridColSpan'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOffset'); - await checkButtonAndClickWithID('GridColOffset'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOrder'); - await checkButtonAndClickWithID('GridColOrder'); - await pressBack(); - - await checkButtonAndClickWithID('GridColWidth'); - await checkButtonAndClickWithID('GridColWidth'); - await pressBack(); - - await checkButtonAndClickWithID('GridColHeight'); - await checkButtonAndClickWithID('GridColHeight'); - await pressBack(); - - await checkButtonAndClickWithID('GridColPadding'); - await checkButtonAndClickWithID('GridColPadding'); - await pressBack(); - - await checkButtonAndClickWithID('GridColMargin'); - await checkButtonAndClickWithID('GridColMargin'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Scroll - */ - it(`ScrollBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Scroll'); - //创建Scroll组件 - await checkButtonAndClickWithID('ScrollCreate'); - await pressBack(); - - //改变width - await checkButtonAndClickWithID('ScrollWidth'); - await checkButtonAndClickWithID('ScrollWidth'); - await pressBack(); - - //改变height - await checkButtonAndClickWithID('ScrollHeight'); - await checkButtonAndClickWithID('ScrollHeight'); - await pressBack(); - - //改变Padding - await checkButtonAndClickWithID('ScrollPadding'); - await checkButtonAndClickWithID('ScrollPadding'); - await pressBack(); - - //改变Margin - await checkButtonAndClickWithID('ScrollMargin'); - await checkButtonAndClickWithID('ScrollMargin'); - await pressBack(); - - - //改变EnableScrollInteraction - await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); - await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); - await pressBack(); - - await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); - await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); - await pressBack(); - - //拖动场景下Scroll组件更新布局耗时 - await checkButtonAndClickWithID('ScrollDrag'); - await driver.fling({ - x: 100, y: 1100 - }, { - x: 100, y: 500 - }, 100, 100) - await pressBack(); - - //抛滑场景下Scroll组件更新布局耗时 - await checkButtonAndClickWithID('ScrollSlippage'); - await driver.fling({ - x: 100, y: 1100 - }, { - x: 100, y: 500 - }, 100, 600) - await pressBack(); - //Scroll组件调用scrollTo触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollTo'); - await checkButtonAndClickWithID('ScrollScrollTo'); - await pressBack(); - //Scroll组件调用scrollEdge触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollEdge'); - await checkButtonAndClickWithID('ScrollScrollEdge'); - await pressBack(); - //Scroll组件edgeEffect属性更新布局耗时 - await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - - await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - //Scroll组件调用scrollBy触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollBy'); - await checkButtonAndClickWithID('ScrollScrollBy'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - /** - * 点击首页Tab - */ - it(`TabsBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Tabs'); - //创建Tab组件 - await checkButtonAndClickWithID('TabsCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('TabsWidth'); - await checkButtonAndClickWithID('TabChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('TabsHeight'); - await checkButtonAndClickWithID('TabsChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TabsPadding'); - await checkButtonAndClickWithID('TabsChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('TabsMargin'); - await checkButtonAndClickWithID('TabsChangeMargin'); - await pressBack(); - //改变Vertical - await checkButtonAndClickWithID('TabsVertical'); - await checkButtonAndClickWithID('TabsChangeVertical'); - await pressBack(); - //改变TabsBarMode - await checkButtonAndClickWithID('TabsBarMode'); - await checkButtonAndClickWithID('TabsChangeTabsBarMode'); - await pressBack(); - //改变Divider - await checkButtonAndClickWithID('TabsDivider'); - await checkButtonAndClickWithID('TabsChangeDivider'); - await pressBack(); - //改变BarPosition - await checkButtonAndClickWithID('TabsBarPosition'); - await checkButtonAndClickWithID('TabsChangeBarPosition'); - await pressBack(); - await driver.delayMs(1000); - //改变tabIndex - await checkButtonAndClickWithID('TabsIndex'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('TabsChangeIndex'); - await pressBack(); - //改变BarWidth - await checkButtonAndClickWithID('TabsBarWidth'); - await checkButtonAndClickWithID('TabChangeBarWidth'); - await pressBack(); - //改变BarHeight - await checkButtonAndClickWithID('TabsBarHeight'); - await checkButtonAndClickWithID('TabChangeBarHeight'); - await pressBack(); - //抛滑Fling - await checkButtonAndClickWithID('TabsFling'); - await driver.fling({ - x: 100, y: 500 - }, { - x: 700, y: 500 - }, 100, 100) - await pressBack(); - //抛滑Drag - await checkButtonAndClickWithID('TabsDrag'); - await driver.fling({ - x: 700, y: 500 - }, { - x: 100, y: 500 - }, 100, 100) - await pressBack(); - //点击页签ClickTab - await checkButtonAndClickWithID('TabsClickTab'); - await checkButtonAndClickWithID('TabsChangeIndex'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Navigation - */ - it(`NavigationBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Navigation'); - await checkButtonAndClickWithID('NavigationCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('NavigationWidthSample'); - await checkButtonAndClickWithID('change width 500 to 600'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('NavigationPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('NavigationMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('NavigationTitleModeSample'); - await checkButtonAndClickWithID('change titleMode to Free'); - await checkButtonAndClickWithID('change titleMode to Full'); - await checkButtonAndClickWithID('change titleMode to Mini'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideToolBarSample'); - await checkButtonAndClickWithID('change hideToolBar true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideTitleBarSample'); - await checkButtonAndClickWithID('change hideTitleBar true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideBackButtonSample'); - await checkButtonAndClickWithID('change hideBackButton true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationNavBarWidthSample'); - await checkButtonAndClickWithID('change navBarWidth 240 to 400'); - await pressBack(); - await checkButtonAndClickWithID('NavigationModeSample'); - await checkButtonAndClickWithID('change navigationMode Stack to Split'); - await pressBack(); - await checkButtonAndClickWithID('NavigationNavBarPositionSample'); - await checkButtonAndClickWithID('change navBarPosition Start to End'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideNavBarSample'); - await checkButtonAndClickWithID('change hideNavBar Stack to Split'); - await pressBack(); - await checkButtonAndClickWithID('NavigationStackJumpSample'); - await checkButtonAndClickWithID('Stack jump to next page'); - await pressBack(); - await pressBack(); - await checkButtonAndClickWithID('NavigationSplitJumpSample'); - await checkButtonAndClickWithID('Split jump to next page'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Flex - */ - it(`FlexBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Flex'); - await checkButtonAndClickWithID('FlexCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('FlexWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('FlexHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('FlexPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('FlexMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueDirectionSample'); - await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); - await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); - await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); - await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueWrapSample'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueJustifyContentSample'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueAlignItemsSample'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueAlignContentSample'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Select - */ - it(`SelectBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Select'); - //创建Select组件 - await checkButtonAndClickWithID('SelectCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('SelectWidth'); - await checkButtonAndClickWithID('SelectChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('SelectHeight'); - await checkButtonAndClickWithID('SelectChangeHeight'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('SelectSize'); - await checkButtonAndClickWithID('SelectChangeSize'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('SelectPadding'); - await checkButtonAndClickWithID('SelectChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('SelectMargin'); - await checkButtonAndClickWithID('SelectChangeMargin'); - await pressBack(); - //改变Space - await checkButtonAndClickWithID('SelectSpace'); - await checkButtonAndClickWithID('SelectChangeSpace'); - await pressBack(); - //改变ArrowPosition - await checkButtonAndClickWithID('SelectArrowPosition'); - await checkButtonAndClickWithID('SelectChangeArrowPosition'); - await pressBack(); - //首次展开 - await checkButtonAndClickWithID('SelectFirstExpand'); - await checkButtonAndClickWithID('SelectFirstExpand'); - await pressBack(); - await pressBack(); - //再次展开 - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await pressBack(); - await pressBack(); - //首次展开后收起 - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await pressBack(); - //多次展开后收起 - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Slider - */ - it(`SliderBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Slider'); - //创建Slider组件 - await checkButtonAndClickWithID('SliderCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('SliderWidth'); - await checkButtonAndClickWithID('SliderChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('SliderHeight'); - await checkButtonAndClickWithID('SliderChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('SliderPadding'); - await checkButtonAndClickWithID('SliderChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('SliderMargin'); - await checkButtonAndClickWithID('SliderChangeMargin'); - await pressBack(); - //改变Step - await checkButtonAndClickWithID('SliderStep'); - await checkButtonAndClickWithID('SliderChangeStep'); - await pressBack(); - //改变Direction - await checkButtonAndClickWithID('SliderDirection'); - await checkButtonAndClickWithID('SliderChangeDirection'); - await pressBack(); - //改变reverse - await checkButtonAndClickWithID('SliderReverse'); - await checkButtonAndClickWithID('SliderChangeReverse'); - await pressBack(); - //改变Style - await checkButtonAndClickWithID('SliderStyle'); - await checkButtonAndClickWithID('SliderChangeStyle'); - await pressBack(); - //改变TrackThickness - await checkButtonAndClickWithID('SliderTrackThickness'); - await checkButtonAndClickWithID('SliderChangeTrackThickness'); - await pressBack(); - //改变BlockSize - await checkButtonAndClickWithID('SliderBlockSize'); - await checkButtonAndClickWithID('SliderChangeBlockSize'); - await pressBack(); - //手指滑动 - await checkButtonAndClickWithID('SliderFingerSliding'); - await driver.swipe(13, 296, 383, 296, 200); - await pressBack(); - //手指点击滑轨 - await checkButtonAndClickWithID('SliderClick'); - await driver.click(383, 296); - await pressBack(); - // 鼠标滚轮调节滑块位置 - await checkButtonAndClickWithID('SliderMouseScroll'); - await driver.mouseScroll({ - x: 163, y: 339 - }, true, 20); - await pressBack(); - // 外接键盘调节滑块位置 - await checkButtonAndClickWithID('SliderKeyboardScroll'); - // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); - await driver.swipe(13, 296, 383, 296, 200); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Divider - */ - it(`DividerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Divider'); - //创建Divider组件 - await checkButtonAndClickWithID('DividerCreate'); - await pressBack(); - //更改StrokeWidth - await checkButtonAndClickWithID('DividerStrokeWidth'); - await checkButtonAndClickWithID('DividerChangeStrokeWidth'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('DividerWidth'); - await checkButtonAndClickWithID('DividerChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('DividerHeight'); - await checkButtonAndClickWithID('DividerChangeHeight'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('DividerSize'); - await checkButtonAndClickWithID('DividerChangeSize'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('DividerPadding'); - await checkButtonAndClickWithID('DividerChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('DividerMargin'); - await checkButtonAndClickWithID('DividerChangeMargin'); - await pressBack(); - //改变Color - await checkButtonAndClickWithID('DividerColor'); - await checkButtonAndClickWithID('DividerChangeColor'); - await pressBack(); - //改变Vertical - await checkButtonAndClickWithID('DividerVertical'); - await checkButtonAndClickWithID('DividerChangeVerticalTrue'); - await checkButtonAndClickWithID('DividerChangeVerticalFalse'); - await pressBack(); - //改变LineCap - await checkButtonAndClickWithID('DividerLineCap'); - await checkButtonAndClickWithID('DividerChangeLineCapButt'); - await checkButtonAndClickWithID('DividerChangeLineCapRound'); - await checkButtonAndClickWithID('DividerChangeLineCapSquare'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Refresh - */ - it(`RefreshBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Refresh'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshCreateSample'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshWidthSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change width 100 to 200'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshHeightSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change height 100 to 200'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshSizeSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change size'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshPaddingSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change padding 20 to 30'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshMarginSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change margin 20 to 30'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshPullSample'); - await driver.delayMs(1000); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshOffsetSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change offset 20 to 30'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshFrictionSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change friction 60 to 80'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshOnStateChangeSample'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await pressBack(); - }) - - /** - * 点击首页Progress - */ - it(`ProgressBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Progress'); - await checkButtonAndClickWithID('ProgressCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ProgressWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ProgressHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ProgressPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ProgressMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ProgressProgressTypeSample'); - await checkButtonAndClickWithID('change progressType to Linear'); - await checkButtonAndClickWithID('change progressType to Ring'); - await checkButtonAndClickWithID('change progressType to Eclipse'); - await checkButtonAndClickWithID('change progressType to ScaleRing'); - await checkButtonAndClickWithID('change progressType to Capsule'); - await pressBack(); - await checkButtonAndClickWithID('ProgressProgressStyleSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await checkButtonAndClickWithID('ProgressLinearSample'); - await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); - await pressBack(); - await checkButtonAndClickWithID('ProgressRingSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await checkButtonAndClickWithID('ProgressScaleRingSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await pressBack(); - }) - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets index ae5425df9d8d0af68ca08c58659dc49b995ae3cc..27c07a1a174f6862ea84c4bb5f45bc1789234441 100644 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets @@ -14,19 +14,7 @@ */ import abilityTest from './Ability.test' -import firstProjectTest from './FirstProject.test' -import twoTest from './Two.test' -import threeTest from './Three.test' -import gridRow from './GridRow.test' -import middleThirteenTest from './MiddleThirteen.test' -import patternLockToScrollBarTest from './PatternLockToScrollBar.test' export default function testsuite() { - // abilityTest() - firstProjectTest() - twoTest() - threeTest() - gridRow() - middleThirteenTest() - patternLockToScrollBarTest() + abilityTest() } \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets deleted file mode 100644 index 23492623891f84491a898de80fc38db1c0ef567e..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets +++ /dev/null @@ -1,580 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; -import { KeyCode } from '@ohos.multimodalInput.keyCode'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(1000); -} - -export default function middleThirteenTest() { - describe('ActsMiddleThirteenTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - - /** - * 点击首页Marquee - */ - it(`MarqueeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Marquee'); - //创建Marquee组件 - await checkButtonAndClickWithID('MarqueeCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('MarqueeWidth'); - await checkButtonAndClickWithID('MarqueeChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('MarqueeHeight'); - await checkButtonAndClickWithID('MarqueeChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('MarqueePadding'); - await checkButtonAndClickWithID('MarqueeChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('MarqueeMargin'); - await checkButtonAndClickWithID('MarqueeChangeMargin'); - await pressBack(); - // 改变Src - await checkButtonAndClickWithID('MarqueeSrc'); - await checkButtonAndClickWithID('MarqueeChangeSrc'); - await pressBack(); - // 改变Step - await checkButtonAndClickWithID('MarqueeStep'); - await checkButtonAndClickWithID('MarqueeChangeStep'); - await pressBack(); - // 改变FromStart - await checkButtonAndClickWithID('MarqueeFromStart'); - await checkButtonAndClickWithID('MarqueeChangeFromStart'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页DataPanel - */ - it(`DataPanelBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('DataPanel'); - //创建DataPanel组件 - await checkButtonAndClickWithID('DataPanelCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('DataPanelWidth'); - await checkButtonAndClickWithID('DataPanelChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('DataPanelHeight'); - await checkButtonAndClickWithID('DataPanelChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('DataPanelPadding'); - await checkButtonAndClickWithID('DataPanelChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('DataPanelMargin'); - await checkButtonAndClickWithID('DataPanelChangeMargin'); - await pressBack(); - // 改变CloseEffect - await checkButtonAndClickWithID('DataPanelCloseEffect'); - await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); - await pressBack(); - // 改变StrokeWidth - await checkButtonAndClickWithID('DataPanelStrokeWidth'); - await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); - await pressBack(); - // 改变Radius - await checkButtonAndClickWithID('DataPanelRadius'); - await checkButtonAndClickWithID('DataPanelChangeRadius'); - await pressBack(); - // 改变OffsetX - await checkButtonAndClickWithID('DataPanelOffsetX'); - await checkButtonAndClickWithID('DataPanelChangeOffsetX'); - await pressBack(); - // 改变OffsetY - await checkButtonAndClickWithID('DataPanelOffsetY'); - await checkButtonAndClickWithID('DataPanelChangeOffsetY'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Rating - */ - it(`RatingBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Rating'); - //创建Rating组件 - await checkButtonAndClickWithID('RatingCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('RatingWidth'); - await checkButtonAndClickWithID('RatingChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('RatingHeight'); - await checkButtonAndClickWithID('RatingChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('RatingPadding'); - await checkButtonAndClickWithID('RatingChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('RatingMargin'); - await checkButtonAndClickWithID('RatingChangeMargin'); - await pressBack(); - // 改变Stars - await checkButtonAndClickWithID('RatingStars'); - await checkButtonAndClickWithID('RatingChangeStars'); - await pressBack(); - // 改变StarStyle - await checkButtonAndClickWithID('RatingStarStyle'); - await checkButtonAndClickWithID('RatingChangeStarStyle'); - await pressBack(); - // 改变OptionsRating - await checkButtonAndClickWithID('RatingOptionsRating'); - await checkButtonAndClickWithID('RatingChangeOptionsRating'); - await pressBack(); - // Click - await checkButtonAndClickWithID('RatingClick'); - await checkButtonAndClickWithID('RatingClickIndex6'); - await pressBack(); - // swip - await checkButtonAndClickWithID('RatingSwip'); - await driver.swipe(50, 600, 500, 600); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页TextClock - */ - it(`TextClockBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextClock'); - await checkButtonAndClickWithID('TextClockCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('TextClockWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextClockHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextClockPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextClockMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextClockFormatSample'); - await checkButtonAndClickWithID('change format'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Hyperlink - */ - it(`HyperlinkBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Hyperlink'); - await checkButtonAndClickWithID('HyperlinkCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页QRCode - */ - it(`QRCodeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('QRCode'); - await checkButtonAndClickWithID('QRCodeCreateSample'); - await driver.delayMs(1000); - await pressBack(); - await checkButtonAndClickWithID('QRCodeWidthSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('QRCodeHeightSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('QRCodePaddingSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('QRCodeMarginSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Gauge - */ - it(`GaugeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Gauge'); - await checkButtonAndClickWithID('GaugeCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('GaugeWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('GaugeHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('GaugePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GaugeMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GaugeStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 10'); - await pressBack(); - // await checkButtonAndClickWithID('GaugeTrackShadowSample'); - // await checkButtonAndClickWithID('change trackShadow'); - // await pressBack(); - await checkButtonAndClickWithID('GaugeAngleSample'); - await checkButtonAndClickWithID('change angle'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Badge - */ - it(`BadgeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Badge'); - //创建Badge组件 - await checkButtonAndClickWithID('BadgeCreate'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('BadgeSize'); - await checkButtonAndClickWithID('BadgeChangeSize'); - await pressBack(); - //改变Color - await checkButtonAndClickWithID('BadgeColor'); - await checkButtonAndClickWithID('BadgeChangeColor'); - await pressBack(); - //改变FontSize - await checkButtonAndClickWithID('BadgeFontSize'); - await checkButtonAndClickWithID('BadgeChangeFontSize'); - await pressBack(); - //改变FontWeight - await checkButtonAndClickWithID('BadgeFontWeight'); - await checkButtonAndClickWithID('BadgeChangeFontWeight'); - await pressBack(); - //改变BorderWidth - await checkButtonAndClickWithID('BadgeBorderWidth'); - await checkButtonAndClickWithID('BadgeChangeBorderWidth'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页AlphabetIndexer - */ - it(`AlphabetIndexerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('AlphabetIndexer'); - //创建AlphabetIndexerCreate组件 - await checkButtonAndClickWithID('AlphabetIndexerCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变SelectedColor - await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); - await pressBack(); - //改变PopupColor - await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); - await pressBack(); - //改变SelectedBackgroundColor - await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); - await pressBack(); - // 改变PopupBackground - await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); - await pressBack(); - //改变SelectedFont - await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); - await pressBack(); - //改变popupFont - await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Menu - */ - it(`MenuBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Menu'); - //创建Menu组件 - await checkButtonAndClickWithID('MenuCreate'); - await pressBack(); - //改变Font - await checkButtonAndClickWithID('MenuFont'); - await checkButtonAndClickWithID('MenuChangeFont'); - await pressBack(); - //改变FontColor - await checkButtonAndClickWithID('MenuFontColor'); - await checkButtonAndClickWithID('MenuChangeFontColor'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('MenuWidth'); - await checkButtonAndClickWithID('MenuChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('MenuHeight'); - await checkButtonAndClickWithID('MenuChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('MenuPadding'); - await checkButtonAndClickWithID('MenuChangePadding'); - await pressBack(); - // 变Margin - await checkButtonAndClickWithID('MenuMargin'); - await checkButtonAndClickWithID('MenuChangeMargin'); - await pressBack(); - // Menu展开菜单Expend - await checkButtonAndClickWithID('MenuFirstExpend'); - await checkButtonAndClickWithID('MenuFirstChangeExpend'); - await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); - await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); - await pressBack(); - await pressBack(); - // Menu收起后再次展开菜单Expend - await checkButtonAndClickWithID('MenuSecondExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - await pressBack(); - await checkButtonAndClickWithID('MenuSecondChangeExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - await pressBack(); - await pressBack(); - // Menu收起后多次关闭 - await checkButtonAndClickWithID('MenuMoreClose'); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await checkButtonAndClickWithID('MenuMoreCloseSencond'); - await checkButtonAndClickWithID('MenuMoreCloseThird'); - await pressBack(); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await pressBack(); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await pressBack(); - await pressBack(); - // Group收起后再次展开 - await checkButtonAndClickWithID('MenuGroupCloseExpand'); - await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - await pressBack(); - await pressBack(); - // Group多次关闭 - await checkButtonAndClickWithID('MenuGroupMoreClose'); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await pressBack(); - - await pressBack(); //返回首页 - }) - - /** - * 点击首页TextPicker - */ - it(`TextPickerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextPicker'); - //创建TextPicker组件 - await checkButtonAndClickWithID('TextPickerCreate'); - await pressBack(); - //改变TextStyle - await checkButtonAndClickWithID('TextPickerTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeTextStyle'); - await pressBack(); - //改变SelectedTextStyle - await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); - await pressBack(); - //改变DisappearTextStyle - await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('TextPickerWidth'); - await checkButtonAndClickWithID('TextPickerChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('TextPickerHeight'); - await checkButtonAndClickWithID('TextPickerChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TextPickerPadding'); - await checkButtonAndClickWithID('TextPickerChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('TextPickerMargin'); - await checkButtonAndClickWithID('TextPickerChangeMargin'); - await pressBack(); - //手指滑动 - await checkButtonAndClickWithID('TextPickerFingerSwip'); - await driver.swipe(150, 300, 150, 150) - await pressBack(); - //手指点击 - await checkButtonAndClickWithID('TextPickerClick'); - await driver.click(150, 150) - await driver.delayMs(1000); - await pressBack(); - //鼠标滚轮MouseScroll - await checkButtonAndClickWithID('TextPickerMouseScroll'); - await driver.mouseScroll({ x: 150, y: 200 }, true, 5); - await driver.delayMs(1000); - await pressBack(); - //键盘Scroll - await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); - // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); - await driver.swipe(150, 300, 150, 150) - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Counter - */ - it(`CounterBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Counter'); - //创建Counter组件 - await checkButtonAndClickWithID('CounterCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变width - await checkButtonAndClickWithID('CounterWidth'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeWidth'); - await driver.delayMs(1000); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('CounterHeight'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeHeight'); - await driver.delayMs(1000); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('CounterPadding'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangePadding'); - await driver.delayMs(1000); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('CounterMargin'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeMargin'); - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页XComponent - */ - it(`XComponentBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('XComponent'); - //创建XComponent组件 - await checkButtonAndClickWithID('XComponentCreate'); - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets deleted file mode 100644 index de65a160acf32816b86c104f79a33b6363bb3267..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets +++ /dev/null @@ -1,596 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(1000); -} - -export default function patternLockToScrollBarTest() { - describe('ActsPatternLockToScrollBarTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - /** - * 点击首页PatternLock - */ - it(`PatternLockBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('PatternLock'); - //创建PatternLock组件 - await checkButtonAndClickWithID('PatternLockCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变SideLength - await checkButtonAndClickWithID('PatternLockSideLength'); - await checkButtonAndClickWithID('PatternLockChangeSideLength'); - await pressBack(); - //改变CircleRadius - await checkButtonAndClickWithID('PatternLockCircleRadius'); - await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); - await pressBack(); - //改变RegularColor - await checkButtonAndClickWithID('PatternLockRegularColor'); - await checkButtonAndClickWithID('PatternLockChangeRegularColor'); - await pressBack(); - //改变SelectedColor - await checkButtonAndClickWithID('PatternLockSelectedColor'); - await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); - await pressBack(); - //改变ActiveColor - await checkButtonAndClickWithID('PatternLockActiveColor'); - await checkButtonAndClickWithID('PatternLockChangeActiveColor'); - await pressBack(); - //改变PathColor - await checkButtonAndClickWithID('PatternLockPathColor'); - await checkButtonAndClickWithID('PatternLockChangePathColor'); - await pressBack(); - //改变PathStrokeWidth - await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); - await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); - await pressBack(); - await pressBack(); //返回首页 - }) - - /** - * 点击首页Shape - */ - it(`ShapeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Shape'); - //创建Shape组件 - await checkButtonAndClickWithID('ShapeCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('ShapeFill'); - await checkButtonAndClickWithID('ShapeChangeFill'); - await pressBack(); - //改变FillOpacity - await checkButtonAndClickWithID('ShapeFillOpacity'); - await checkButtonAndClickWithID('ShapeChangeFillOpacity'); - await pressBack(); - //改变stroke - await checkButtonAndClickWithID('ShapeStroke'); - await checkButtonAndClickWithID('ShapeChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('ShapeStrokeDashArray'); - await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('ShapeStrokeDashOffset'); - await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('ShapeStrokeWidth'); - await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('ShapeWidth'); - await checkButtonAndClickWithID('ShapeChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('ShapeHeight'); - await checkButtonAndClickWithID('ShapeChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('ShapePadding'); - await checkButtonAndClickWithID('ShapeChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('ShapeMargin'); - await checkButtonAndClickWithID('ShapeChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - /** - * 点击首页Path - */ - it(`PathBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Path'); - //创建Path组件 - await checkButtonAndClickWithID('PathCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('PathFill'); - await checkButtonAndClickWithID('PathChangeFill'); - await pressBack(); - // 改变FillOpacity - await checkButtonAndClickWithID('PathFillOpacity'); - await checkButtonAndClickWithID('PathChangeFillOpacity'); - await pressBack(); - //改变Stroke - await checkButtonAndClickWithID('PathStroke'); - await checkButtonAndClickWithID('PathChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('PathStrokeDashArray'); - await checkButtonAndClickWithID('PathChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('PathStrokeDashOffset'); - await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('PathStrokeWidth'); - await checkButtonAndClickWithID('PathChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('PathWidth'); - await checkButtonAndClickWithID('PathChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('PathHeight'); - await checkButtonAndClickWithID('PathChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('PathPadding'); - await checkButtonAndClickWithID('PathChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('PathMargin'); - await checkButtonAndClickWithID('PathChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - /** - * 点击首页Line - */ - it(`LineBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Line'); - //创建Line组件 - await checkButtonAndClickWithID('LineCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('LineFill'); - await checkButtonAndClickWithID('LineChangeFill'); - await pressBack(); - // 改变FillOpacity - await checkButtonAndClickWithID('LineFillOpacity'); - await checkButtonAndClickWithID('LineChangeFillOpacity'); - await pressBack(); - //改变Stroke - await checkButtonAndClickWithID('LineStroke'); - await checkButtonAndClickWithID('LineChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('LineStrokeDashArray'); - await checkButtonAndClickWithID('LineChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('LineStrokeDashOffset'); - await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('LineStrokeWidth'); - await checkButtonAndClickWithID('LineChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('LineWidth'); - await checkButtonAndClickWithID('LineChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('LineHeight'); - await checkButtonAndClickWithID('LineChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('LinePadding'); - await checkButtonAndClickWithID('LineChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('LineMargin'); - await checkButtonAndClickWithID('LineChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - /** - * 点击首页Circle - */ - it(`CircleBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Circle'); - await checkButtonAndClickWithID('CircleCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('CircleFillSample'); - await checkButtonAndClickWithID('change fill'); - await pressBack(); - await checkButtonAndClickWithID('CircleFillOpacitySample'); - await checkButtonAndClickWithID('change fillOpacity'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeSample'); - await checkButtonAndClickWithID('change stroke'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeDashArraySample'); - await checkButtonAndClickWithID('change strokeDashArray'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); - await checkButtonAndClickWithID('change strokeDashOffset'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth'); - await pressBack(); - await checkButtonAndClickWithID('CircleWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('CircleHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('CirclePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('CircleMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Polyline - */ - it(`PolylineBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Polyline'); - await checkButtonAndClickWithID('PolylineCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('PolylineFillSample'); - await checkButtonAndClickWithID('change fill'); - await pressBack(); - await checkButtonAndClickWithID('PolylineFillOpacitySample'); - await checkButtonAndClickWithID('change fillOpacity'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeSample'); - await checkButtonAndClickWithID('change stroke'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); - await checkButtonAndClickWithID('change strokeDashArray'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); - await checkButtonAndClickWithID('change strokeDashOffset'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth'); - await pressBack(); - await checkButtonAndClickWithID('PolylineWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('PolylineHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('PolylinePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('PolylineMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页SideBarContainer - */ - it(`SideBarContainerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('SideBarContainer'); - await checkButtonAndClickWithID('SideBarContainerCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); - await checkButtonAndClickWithID('change showSideBar'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerControlButtonSample'); - await checkButtonAndClickWithID('change controlButton'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); - await checkButtonAndClickWithID('change showControlButton'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); - await checkButtonAndClickWithID('change sideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); - await checkButtonAndClickWithID('change autoHide'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); - await checkButtonAndClickWithID('change sideBarPosition'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDividerSample'); - await checkButtonAndClickWithID('change divider'); - await pressBack(); - await driver.swipe(540, 1000, 540, 500); - await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); - await checkButtonAndClickWithID('change minContentWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); - await checkButtonAndClickWithID('change minSideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); - await checkButtonAndClickWithID('change maxSideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); - await driver.delayMs(1000); - await driver.swipe(300, 500, 100, 500); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDragContentSample'); - await driver.delayMs(1000); - await driver.drag(300, 500, 500, 500); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页ImageAnimator - */ - it(`ImageAnimatorBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('ImageAnimator'); - await checkButtonAndClickWithID('ImageAnimatorCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorImagesSample'); - await checkButtonAndClickWithID('change images'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorStateSample'); - await checkButtonAndClickWithID('change state'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorDurationSample'); - await checkButtonAndClickWithID('change duration'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorReverseSample'); - await checkButtonAndClickWithID('change reverse'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); - await checkButtonAndClickWithID('change fixedSize'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); - await checkButtonAndClickWithID('change fillMode'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); - await checkButtonAndClickWithID('change iterations'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页LoadingProgress - */ - it(`LoadingProgressBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('LoadingProgress'); - await checkButtonAndClickWithID('LoadingProgressCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); - await checkButtonAndClickWithID('change enableLoading'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页TextTimer - */ - it(`TextTimerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextTimer'); - await checkButtonAndClickWithID('TextTimerCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerControllerSample'); - await checkButtonAndClickWithID('change controller to start'); - await checkButtonAndClickWithID('change controller to pause'); - await checkButtonAndClickWithID('change controller to reset'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerFormatSample'); - await checkButtonAndClickWithID('change format'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Blank - */ - it(`BlankBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Blank'); - await checkButtonAndClickWithID('BlankCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('BlankWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('BlankHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('BlankPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('BlankMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('BlankMinSample'); - await checkButtonAndClickWithID('change min 0 to 60'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页Radio - */ - it(`RadioBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Radio'); - await checkButtonAndClickWithID('RadioCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('RadioWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('RadioHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('RadioPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('RadioMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - /** - * 点击首页ScrollBar - */ - it(`ScrollBarBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('ScrollBar'); - await checkButtonAndClickWithID('ScrollBarCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarDirectionSample'); - await checkButtonAndClickWithID('change direction'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarStateSample'); - await checkButtonAndClickWithID('change state to On'); - await checkButtonAndClickWithID('change state to Auto'); - await pressBack(); - await pressBack(); - }) - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets deleted file mode 100644 index 122bde9fc07ec76f5f54d67b75eca707db1092a5..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(1000); -} - -export default function threeTest() { - describe('ActsThreeTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - //点击首页Counter - it(`CounterBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Counter'); - //创建Counter组件 - await checkButtonAndClickWithID('CounterCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变width - await checkButtonAndClickWithID('CounterWidth'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeWidth'); - await driver.delayMs(1000); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('CounterHeight'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeHeight'); - await driver.delayMs(1000); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('CounterPadding'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangePadding'); - await driver.delayMs(1000); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('CounterMargin'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('CounterChangeMargin'); - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页XComponent - it(`XComponentBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('XComponent'); - //创建XComponent组件 - await checkButtonAndClickWithID('XComponentCreate'); - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页PatternLock - it(`PatternLockBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('PatternLock'); - //创建PatternLock组件 - await checkButtonAndClickWithID('PatternLockCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变SideLength - await checkButtonAndClickWithID('PatternLockSideLength'); - await checkButtonAndClickWithID('PatternLockChangeSideLength'); - await pressBack(); - //改变CircleRadius - await checkButtonAndClickWithID('PatternLockCircleRadius'); - await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); - await pressBack(); - //改变RegularColor - await checkButtonAndClickWithID('PatternLockRegularColor'); - await checkButtonAndClickWithID('PatternLockChangeRegularColor'); - await pressBack(); - //改变SelectedColor - await checkButtonAndClickWithID('PatternLockSelectedColor'); - await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); - await pressBack(); - //改变ActiveColor - await checkButtonAndClickWithID('PatternLockActiveColor'); - await checkButtonAndClickWithID('PatternLockChangeActiveColor'); - await pressBack(); - //改变PathColor - await checkButtonAndClickWithID('PatternLockPathColor'); - await checkButtonAndClickWithID('PatternLockChangePathColor'); - await pressBack(); - //改变PathStrokeWidth - await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); - await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Shape - it(`ShapeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Shape'); - //创建Shape组件 - await checkButtonAndClickWithID('ShapeCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('ShapeFill'); - await checkButtonAndClickWithID('ShapeChangeFill'); - await pressBack(); - //改变FillOpacity - await checkButtonAndClickWithID('ShapeFillOpacity'); - await checkButtonAndClickWithID('ShapeChangeFillOpacity'); - await pressBack(); - //改变stroke - await checkButtonAndClickWithID('ShapeStroke'); - await checkButtonAndClickWithID('ShapeChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('ShapeStrokeDashArray'); - await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('ShapeStrokeDashOffset'); - await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('ShapeStrokeWidth'); - await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('ShapeWidth'); - await checkButtonAndClickWithID('ShapeChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('ShapeHeight'); - await checkButtonAndClickWithID('ShapeChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('ShapePadding'); - await checkButtonAndClickWithID('ShapeChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('ShapeMargin'); - await checkButtonAndClickWithID('ShapeChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页Path - it(`PathBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Path'); - //创建Path组件 - await checkButtonAndClickWithID('PathCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('PathFill'); - await checkButtonAndClickWithID('PathChangeFill'); - await pressBack(); - // 改变FillOpacity - await checkButtonAndClickWithID('PathFillOpacity'); - await checkButtonAndClickWithID('PathChangeFillOpacity'); - await pressBack(); - //改变Stroke - await checkButtonAndClickWithID('PathStroke'); - await checkButtonAndClickWithID('PathChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('PathStrokeDashArray'); - await checkButtonAndClickWithID('PathChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('PathStrokeDashOffset'); - await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('PathStrokeWidth'); - await checkButtonAndClickWithID('PathChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('PathWidth'); - await checkButtonAndClickWithID('PathChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('PathHeight'); - await checkButtonAndClickWithID('PathChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('PathPadding'); - await checkButtonAndClickWithID('PathChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('PathMargin'); - await checkButtonAndClickWithID('PathChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页Line - it(`LineBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Line'); - //创建Line组件 - await checkButtonAndClickWithID('LineCreate'); - await pressBack(); - //改变Fill - await checkButtonAndClickWithID('LineFill'); - await checkButtonAndClickWithID('LineChangeFill'); - await pressBack(); - // 改变FillOpacity - await checkButtonAndClickWithID('LineFillOpacity'); - await checkButtonAndClickWithID('LineChangeFillOpacity'); - await pressBack(); - //改变Stroke - await checkButtonAndClickWithID('LineStroke'); - await checkButtonAndClickWithID('LineChangeStroke'); - await pressBack(); - //改变StrokeDashArray - await checkButtonAndClickWithID('LineStrokeDashArray'); - await checkButtonAndClickWithID('LineChangeStrokeDashArray'); - await pressBack(); - //改变StrokeDashOffset - await checkButtonAndClickWithID('LineStrokeDashOffset'); - await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); - await pressBack(); - //改变StrokeWidth - await checkButtonAndClickWithID('LineStrokeWidth'); - await checkButtonAndClickWithID('LineChangeStrokeWidth'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('LineWidth'); - await checkButtonAndClickWithID('LineChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('LineHeight'); - await checkButtonAndClickWithID('LineChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('LinePadding'); - await checkButtonAndClickWithID('LineChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('LineMargin'); - await checkButtonAndClickWithID('LineChangeMargin'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页Circle - it(`CircleBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Circle'); - await checkButtonAndClickWithID('CircleCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('CircleFillSample'); - await checkButtonAndClickWithID('change fill'); - await pressBack(); - await checkButtonAndClickWithID('CircleFillOpacitySample'); - await checkButtonAndClickWithID('change fillOpacity'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeSample'); - await checkButtonAndClickWithID('change stroke'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeDashArraySample'); - await checkButtonAndClickWithID('change strokeDashArray'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); - await checkButtonAndClickWithID('change strokeDashOffset'); - await pressBack(); - await checkButtonAndClickWithID('CircleStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth'); - await pressBack(); - await checkButtonAndClickWithID('CircleWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('CircleHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('CirclePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('CircleMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - //点击首页Polyline - it(`PolylineBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Polyline'); - await checkButtonAndClickWithID('PolylineCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('PolylineFillSample'); - await checkButtonAndClickWithID('change fill'); - await pressBack(); - await checkButtonAndClickWithID('PolylineFillOpacitySample'); - await checkButtonAndClickWithID('change fillOpacity'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeSample'); - await checkButtonAndClickWithID('change stroke'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); - await checkButtonAndClickWithID('change strokeDashArray'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); - await checkButtonAndClickWithID('change strokeDashOffset'); - await pressBack(); - await checkButtonAndClickWithID('PolylineStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth'); - await pressBack(); - await checkButtonAndClickWithID('PolylineWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('PolylineHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('PolylinePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('PolylineMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - //点击首页SideBarContainer - it(`SideBarContainerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('SideBarContainer'); - await checkButtonAndClickWithID('SideBarContainerCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); - await checkButtonAndClickWithID('change showSideBar'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); - await checkButtonAndClickWithID('change showControlButton'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); - await checkButtonAndClickWithID('change sideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); - await checkButtonAndClickWithID('change autoHide'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); - await checkButtonAndClickWithID('change sideBarPosition'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDividerSample'); - await checkButtonAndClickWithID('change divider'); - await pressBack(); - await driver.swipe(540, 1000, 540, 500); - await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); - await checkButtonAndClickWithID('change minContentWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); - await checkButtonAndClickWithID('change minSideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); - await checkButtonAndClickWithID('change maxSideBarWidth'); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); - await driver.delayMs(1000); - await driver.swipe(300, 500, 100, 500); - await pressBack(); - await checkButtonAndClickWithID('SideBarContainerDragContentSample'); - await driver.delayMs(1000); - await driver.drag(300, 500, 500, 500); - await pressBack(); - await pressBack(); - }) - - //点击首页ImageAnimator - it(`ImageAnimatorBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('ImageAnimator'); - await checkButtonAndClickWithID('ImageAnimatorCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorImagesSample'); - await checkButtonAndClickWithID('change images'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorStateSample'); - await checkButtonAndClickWithID('change state'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorDurationSample'); - await checkButtonAndClickWithID('change duration'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorReverseSample'); - await checkButtonAndClickWithID('change reverse'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); - await checkButtonAndClickWithID('change fixedSize'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); - await checkButtonAndClickWithID('change fillMode'); - await pressBack(); - await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); - await checkButtonAndClickWithID('change iterations'); - await pressBack(); - await pressBack(); - }) - - //点击首页LoadingProgress - it(`LoadingProgressBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('LoadingProgress'); - await checkButtonAndClickWithID('LoadingProgressCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); - await checkButtonAndClickWithID('change enableLoading'); - await pressBack(); - await pressBack(); - }) - - //点击首页TextTimer - it(`TextTimerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextTimer'); - await checkButtonAndClickWithID('TextTimerCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerControllerSample'); - await checkButtonAndClickWithID('change controller to start'); - await checkButtonAndClickWithID('change controller to pause'); - await checkButtonAndClickWithID('change controller to reset'); - await pressBack(); - await checkButtonAndClickWithID('TextTimerFormatSample'); - await checkButtonAndClickWithID('change format'); - await pressBack(); - await pressBack(); - }) - - //点击首页Blank - it(`BlankBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Blank'); - await checkButtonAndClickWithID('BlankCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('BlankWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('BlankHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('BlankPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('BlankMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('BlankMinSample'); - await checkButtonAndClickWithID('change min 0 to 60'); - await pressBack(); - await pressBack(); - }) - - //点击首页Radio - it(`RadioBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Radio'); - await checkButtonAndClickWithID('RadioCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('RadioWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('RadioHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('RadioPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('RadioMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets deleted file mode 100644 index d55cc4409cf99e27181b61ec90f0c5fe9eb26695..0000000000000000000000000000000000000000 --- a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets +++ /dev/null @@ -1,1234 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import hilog from '@ohos.hilog'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { Driver, ON } from '@ohos.UiTest'; - -const driver = Driver.create(); -let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); - -//通过id验证有没有这个组件 有的话点击一下 -async function checkButtonAndClickWithID(text: string, delayTime: number = 3000) { - let idName = text; - await driver.assertComponentExist(ON.id(idName)); - let button = await driver.findComponent(ON.id(idName)); - await button.click(); - if (delayTime > 0) { - await driver.delayMs(delayTime); - } -} - -async function pressBack() { - await driver.pressBack(); - await driver.delayMs(3000); -} - -export default function twoTest() { - describe('ActsTwoTest', () => { - beforeAll(() => { - - }) - beforeEach(() => { - - }) - afterEach(() => { - - }) - afterAll(() => { - - }) - /** - * 拉起应用 - */ - it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { - hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); - try { - await abilityDelegatorRegistry.startAbility({ - bundleName: 'cn.openharmony.benchmarksample', - abilityName: 'EntryAbility' - }); - done(); - } catch (err) { - done(); - } - hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); - }) - - //点击首页GridRow - it(`GridRowBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('GridRow'); - - await checkButtonAndClickWithID('GridRowCreate'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowWidth'); - await checkButtonAndClickWithID('GridRowWidth'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowHeight'); - await checkButtonAndClickWithID('GridRowHeight'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowPadding'); - await checkButtonAndClickWithID('GridRowPadding'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowMargin'); - await checkButtonAndClickWithID('GridRowMargin'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowColumns'); - await checkButtonAndClickWithID('GridRowColumns'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowGutter'); - await checkButtonAndClickWithID('GridRowGutter'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowDirection'); - await checkButtonAndClickWithID('GridRowDirection'); - await pressBack(); - - await checkButtonAndClickWithID('GridRowBreakpoints'); - await checkButtonAndClickWithID('GridRowBreakpoints'); - await pressBack(); - await pressBack(); - }) - - //点击首页GridCol - it(`GridColBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('GridCol'); - - await checkButtonAndClickWithID('GridColCreate'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionSpan'); - await checkButtonAndClickWithID('GridColOptionSpan'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionOffset'); - await checkButtonAndClickWithID('GridColOptionOffset'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOptionOrder'); - await checkButtonAndClickWithID('GridColOptionOrder'); - await pressBack(); - - await checkButtonAndClickWithID('GridColSpan'); - await checkButtonAndClickWithID('GridColSpan'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOffset'); - await checkButtonAndClickWithID('GridColOffset'); - await pressBack(); - - await checkButtonAndClickWithID('GridColOrder'); - await checkButtonAndClickWithID('GridColOrder'); - await pressBack(); - - await checkButtonAndClickWithID('GridColWidth'); - await checkButtonAndClickWithID('GridColWidth'); - await pressBack(); - - await checkButtonAndClickWithID('GridColHeight'); - await checkButtonAndClickWithID('GridColHeight'); - await pressBack(); - - await checkButtonAndClickWithID('GridColPadding'); - await checkButtonAndClickWithID('GridColPadding'); - await pressBack(); - - await checkButtonAndClickWithID('GridColMargin'); - await checkButtonAndClickWithID('GridColMargin'); - await pressBack(); - await pressBack(); - }) - - //点击首页Scroll - it(`ScrollBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Scroll'); - //创建Scroll组件 - await checkButtonAndClickWithID('ScrollCreate'); - await pressBack(); - - //改变width - await checkButtonAndClickWithID('ScrollWidth'); - await checkButtonAndClickWithID('ScrollWidth'); - await pressBack(); - - //改变height - await checkButtonAndClickWithID('ScrollHeight'); - await checkButtonAndClickWithID('ScrollHeight'); - await pressBack(); - - //改变Padding - await checkButtonAndClickWithID('ScrollPadding'); - await checkButtonAndClickWithID('ScrollPadding'); - await pressBack(); - - //改变Margin - await checkButtonAndClickWithID('ScrollMargin'); - await checkButtonAndClickWithID('ScrollMargin'); - await pressBack(); - - - //改变EnableScrollInteraction - await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); - await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); - await pressBack(); - - await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); - await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); - await pressBack(); - - //拖动场景下Scroll组件更新布局耗时 - await checkButtonAndClickWithID('ScrollDrag'); - await driver.fling({ - x: 100, y: 1100 - }, { - x: 100, y: 500 - }, 100, 100) - await pressBack(); - - //抛滑场景下Scroll组件更新布局耗时 - await checkButtonAndClickWithID('ScrollSlippage'); - await driver.fling({ - x: 100, y: 1100 - }, { - x: 100, y: 500 - }, 100, 600) - await pressBack(); - //Scroll组件调用scrollTo触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollTo'); - await checkButtonAndClickWithID('ScrollScrollTo'); - await pressBack(); - //Scroll组件调用scrollEdge触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollEdge'); - await checkButtonAndClickWithID('ScrollScrollEdge'); - await pressBack(); - //Scroll组件edgeEffect属性更新布局耗时 - await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - - await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - await checkButtonAndClickWithID('ScrollEdgeEffectFade'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - await checkButtonAndClickWithID('ScrollEdgeEffectNone'); - await driver.swipe(100, 1100, 100, 500, 200) - await pressBack(); - - //Scroll组件调用scrollBy触发页面跳转布局 - await checkButtonAndClickWithID('ScrollScrollBy'); - await checkButtonAndClickWithID('ScrollScrollBy'); - await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页Tab - it(`TabsBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Tabs'); - //创建Tab组件 - await checkButtonAndClickWithID('TabsCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('TabsWidth'); - await checkButtonAndClickWithID('TabChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('TabsHeight'); - await checkButtonAndClickWithID('TabsChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TabsPadding'); - await checkButtonAndClickWithID('TabsChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('TabsMargin'); - await checkButtonAndClickWithID('TabsChangeMargin'); - await pressBack(); - //改变Vertical - await checkButtonAndClickWithID('TabsVertical'); - await checkButtonAndClickWithID('TabsChangeVertical'); - await pressBack(); - //改变TabsBarMode - await checkButtonAndClickWithID('TabsBarMode'); - await checkButtonAndClickWithID('TabsChangeTabsBarMode'); - await pressBack(); - //改变Divider - await checkButtonAndClickWithID('TabsDivider'); - await checkButtonAndClickWithID('TabsChangeDivider'); - await pressBack(); - //改变BarPosition - await checkButtonAndClickWithID('TabsBarPosition'); - await checkButtonAndClickWithID('TabsChangeBarPosition'); - await pressBack(); - await driver.delayMs(1000); - //改变tabIndex - await checkButtonAndClickWithID('TabsIndex'); - await driver.delayMs(2000); - await checkButtonAndClickWithID('TabsChangeIndex'); - await pressBack(); - //改变BarWidth - await checkButtonAndClickWithID('TabsBarWidth'); - await checkButtonAndClickWithID('TabChangeBarWidth'); - await pressBack(); - //改变BarHeight - await checkButtonAndClickWithID('TabsBarHeight'); - await checkButtonAndClickWithID('TabChangeBarHeight'); - await pressBack(); - //抛滑Fling - await checkButtonAndClickWithID('TabsFling'); - await driver.fling({ - x: 100, y: 500 - }, { - x: 700, y: 500 - }, 100, 100) - await pressBack(); - //抛滑Drag - await checkButtonAndClickWithID('TabsDrag'); - await driver.fling({ - x: 700, y: 500 - }, { - x: 100, y: 500 - }, 100, 100) - await pressBack(); - //点击页签ClickTab - await checkButtonAndClickWithID('TabsClickTab'); - await checkButtonAndClickWithID('TabsChangeIndex'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Navigation - it(`NavigationBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Navigation'); - await checkButtonAndClickWithID('NavigationCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('NavigationWidthSample'); - await checkButtonAndClickWithID('change width 500 to 600'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('NavigationPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('NavigationMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('NavigationTitleModeSample'); - await checkButtonAndClickWithID('change titleMode to Free'); - await checkButtonAndClickWithID('change titleMode to Full'); - await checkButtonAndClickWithID('change titleMode to Mini'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideToolBarSample'); - await checkButtonAndClickWithID('change hideToolBar true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideTitleBarSample'); - await checkButtonAndClickWithID('change hideTitleBar true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideBackButtonSample'); - await checkButtonAndClickWithID('change hideBackButton true to false'); - await pressBack(); - await checkButtonAndClickWithID('NavigationNavBarWidthSample'); - await checkButtonAndClickWithID('change navBarWidth 240 to 400'); - await pressBack(); - await checkButtonAndClickWithID('NavigationModeSample'); - await checkButtonAndClickWithID('change navigationMode Stack to Split'); - await pressBack(); - await checkButtonAndClickWithID('NavigationNavBarPositionSample'); - await checkButtonAndClickWithID('change navBarPosition Start to End'); - await pressBack(); - await checkButtonAndClickWithID('NavigationHideNavBarSample'); - await checkButtonAndClickWithID('change hideNavBar Stack to Split'); - await pressBack(); - await checkButtonAndClickWithID('NavigationStackJumpSample'); - await checkButtonAndClickWithID('Stack jump to next page'); - await pressBack(); - await pressBack(); - await checkButtonAndClickWithID('NavigationSplitJumpSample'); - await checkButtonAndClickWithID('Split jump to next page'); - await pressBack(); - await pressBack(); - }) - - //点击首页Flex - it(`FlexBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Flex'); - await checkButtonAndClickWithID('FlexCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('FlexWidthSample'); - await checkButtonAndClickWithID('change width 80% to 100%'); - await pressBack(); - await checkButtonAndClickWithID('FlexHeightSample'); - await checkButtonAndClickWithID('change height 300 to 400'); - await pressBack(); - await checkButtonAndClickWithID('FlexPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('FlexMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueDirectionSample'); - await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); - await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); - await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); - await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueWrapSample'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); - await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueJustifyContentSample'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueAlignItemsSample'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); - await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); - await pressBack(); - await checkButtonAndClickWithID('FlexValueAlignContentSample'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); - await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); - await pressBack(); - await pressBack(); - }) - - //点击首页Select - it(`SelectBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Select'); - //创建Select组件 - await checkButtonAndClickWithID('SelectCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('SelectWidth'); - await checkButtonAndClickWithID('SelectChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('SelectHeight'); - await checkButtonAndClickWithID('SelectChangeHeight'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('SelectSize'); - await checkButtonAndClickWithID('SelectChangeSize'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('SelectPadding'); - await checkButtonAndClickWithID('SelectChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('SelectMargin'); - await checkButtonAndClickWithID('SelectChangeMargin'); - await pressBack(); - //改变Space - await checkButtonAndClickWithID('SelectSpace'); - await checkButtonAndClickWithID('SelectChangeSpace'); - await pressBack(); - //改变ArrowPosition - await checkButtonAndClickWithID('SelectArrowPosition'); - await checkButtonAndClickWithID('SelectChangeArrowPosition'); - await pressBack(); - //首次展开 - await checkButtonAndClickWithID('SelectFirstExpand'); - await checkButtonAndClickWithID('SelectFirstExpand'); - await pressBack(); - await pressBack(); - //再次展开 - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await checkButtonAndClickWithID('SelectSecondExpand'); - await pressBack(); - await pressBack(); - //首次展开后收起 - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await checkButtonAndClickWithID('SelectFirstExpandCollapse'); - await pressBack(); - //多次展开后收起 - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await checkButtonAndClickWithID('SelectSecondExpandCollapse'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Span - it(`SpanBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Span'); - //Text内创建Span组件 - await checkButtonAndClickWithID('SpanCreateInText'); - await driver.delayMs(1000); - await pressBack(); - //RichEditor内创建Span组件 - await checkButtonAndClickWithID('SpanCreateInRichEditor'); - await pressBack(); - //Text内改变value - await checkButtonAndClickWithID('SpanValueInText'); - await checkButtonAndClickWithID('SpanChangeValueInText'); - await pressBack(); - //RichEditor内改变value - await checkButtonAndClickWithID('SpanValueInRichEditor'); - await checkButtonAndClickWithID('SpanChangeValueInRichEditor'); - await pressBack(); - //Text内改变LetterSpacing - await checkButtonAndClickWithID('SpanLetterSpacingInText'); - await checkButtonAndClickWithID('SpanChangeLetterSpacingInText'); - await pressBack(); - //RichEditor内改变LetterSpacing - await checkButtonAndClickWithID('SpanLetterSpacingInRichEditor'); - await checkButtonAndClickWithID('SpanChangeLetterSpacingInRichEditor'); - await pressBack(); - // Text内改变LetterSpacing - await checkButtonAndClickWithID('SpanTextCaseInText'); - await checkButtonAndClickWithID('TextCase.Normal.Text'); - await checkButtonAndClickWithID('TextCase.LowerCase.Text'); - await checkButtonAndClickWithID('TextCase.UpperCase.Text'); - await pressBack(); - //RichEditor内改变LetterSpacing - await checkButtonAndClickWithID('SpanTextCaseInRichEditor'); - await checkButtonAndClickWithID('TextCase.Normal.RichEditor'); - await checkButtonAndClickWithID('TextCase.LowerCase.RichEditor'); - await checkButtonAndClickWithID('TextCase.UpperCase.RichEditor'); - await pressBack(); - //Text内改变font - await checkButtonAndClickWithID('SpanFontInText'); - await checkButtonAndClickWithID('SpanChangeFontInText'); - await pressBack(); - //RichEditor内改变Font - await checkButtonAndClickWithID('SpanFontInRichEditor'); - await checkButtonAndClickWithID('SpanChangeFontInRichEditor'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Slider - it(`SliderBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Slider'); - //创建Slider组件 - await checkButtonAndClickWithID('SliderCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('SliderWidth'); - await checkButtonAndClickWithID('SliderChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('SliderHeight'); - await checkButtonAndClickWithID('SliderChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('SliderPadding'); - await checkButtonAndClickWithID('SliderChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('SliderMargin'); - await checkButtonAndClickWithID('SliderChangeMargin'); - await pressBack(); - //改变Step - await checkButtonAndClickWithID('SliderStep'); - await checkButtonAndClickWithID('SliderChangeStep'); - await pressBack(); - //改变Direction - await checkButtonAndClickWithID('SliderDirection'); - await checkButtonAndClickWithID('SliderChangeDirection'); - await pressBack(); - //改变reverse - await checkButtonAndClickWithID('SliderReverse'); - await checkButtonAndClickWithID('SliderChangeReverse'); - await pressBack(); - //改变Style - await checkButtonAndClickWithID('SliderStyle'); - await checkButtonAndClickWithID('SliderChangeStyle'); - await pressBack(); - //改变TrackThickness - await checkButtonAndClickWithID('SliderTrackThickness'); - await checkButtonAndClickWithID('SliderChangeTrackThickness'); - await pressBack(); - //改变BlockSize - await checkButtonAndClickWithID('SliderBlockSize'); - await checkButtonAndClickWithID('SliderChangeBlockSize'); - await pressBack(); - //手指滑动 - await checkButtonAndClickWithID('SliderFingerSliding'); - await driver.swipe(13, 296, 383, 296, 200); - await pressBack(); - //手指点击滑轨 - await checkButtonAndClickWithID('SliderClick'); - await driver.click(383, 296); - await pressBack(); - // 鼠标滚轮调节滑块位置 - await checkButtonAndClickWithID('SliderMouseScroll'); - await driver.mouseScroll({ - x: 163, y: 339 - }, true, 20); - await pressBack(); - // 外接键盘调节滑块位置 - await checkButtonAndClickWithID('SliderKeyboardScroll'); - // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); - await driver.swipe(13, 296, 383, 296, 200); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Divider - it(`DividerBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Divider'); - //创建Divider组件 - await checkButtonAndClickWithID('DividerCreate'); - await pressBack(); - //更改StrokeWidth - await checkButtonAndClickWithID('DividerStrokeWidth'); - await checkButtonAndClickWithID('DividerChangeStrokeWidth'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('DividerWidth'); - await checkButtonAndClickWithID('DividerChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('DividerHeight'); - await checkButtonAndClickWithID('DividerChangeHeight'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('DividerSize'); - await checkButtonAndClickWithID('DividerChangeSize'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('DividerPadding'); - await checkButtonAndClickWithID('DividerChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('DividerMargin'); - await checkButtonAndClickWithID('DividerChangeMargin'); - await pressBack(); - //改变Color - await checkButtonAndClickWithID('DividerColor'); - await checkButtonAndClickWithID('DividerChangeColor'); - await pressBack(); - //改变Vertical - await checkButtonAndClickWithID('DividerVertical'); - await checkButtonAndClickWithID('DividerChangeVerticalTrue'); - await checkButtonAndClickWithID('DividerChangeVerticalFalse'); - await pressBack(); - //改变LineCap - await checkButtonAndClickWithID('DividerLineCap'); - await checkButtonAndClickWithID('DividerChangeLineCapButt'); - await checkButtonAndClickWithID('DividerChangeLineCapRound'); - await checkButtonAndClickWithID('DividerChangeLineCapSquare'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Refresh - it(`RefreshBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Refresh'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshCreateSample'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshWidthSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change width 100 to 200'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshHeightSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change height 100 to 200'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshSizeSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change size'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshPaddingSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change padding 20 to 30'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshMarginSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change margin 20 to 30'); - await driver.delayMs(1000); - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshPullSample'); - await driver.delayMs(1000); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshOffsetSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change offset 20 to 30'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshFrictionSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change friction 60 to 80'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await checkButtonAndClickWithID('RefreshOnStateChangeSample'); - await driver.swipe(360, 200, 360, 500, 600) - await pressBack(); - await driver.delayMs(1000); - await pressBack(); - }) - - //点击首页Progress - it(`ProgressBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Progress'); - await checkButtonAndClickWithID('ProgressCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ProgressWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ProgressHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ProgressPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ProgressMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ProgressProgressTypeSample'); - await checkButtonAndClickWithID('change progressType to Linear'); - await checkButtonAndClickWithID('change progressType to Ring'); - await checkButtonAndClickWithID('change progressType to Eclipse'); - await checkButtonAndClickWithID('change progressType to ScaleRing'); - await checkButtonAndClickWithID('change progressType to Capsule'); - await pressBack(); - await checkButtonAndClickWithID('ProgressProgressStyleSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await checkButtonAndClickWithID('ProgressLinearSample'); - await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); - await pressBack(); - await checkButtonAndClickWithID('ProgressRingSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await checkButtonAndClickWithID('ProgressScaleRingSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 20'); - await pressBack(); - await pressBack(); - }) - - //点击首页Marquee - it(`MarqueeBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Marquee'); - //创建Marquee组件 - await checkButtonAndClickWithID('MarqueeCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('MarqueeWidth'); - await checkButtonAndClickWithID('MarqueeChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('MarqueeHeight'); - await checkButtonAndClickWithID('MarqueeChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('MarqueePadding'); - await checkButtonAndClickWithID('MarqueeChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('MarqueeMargin'); - await checkButtonAndClickWithID('MarqueeChangeMargin'); - await pressBack(); - // 改变Src - await checkButtonAndClickWithID('MarqueeSrc'); - await checkButtonAndClickWithID('MarqueeChangeSrc'); - await pressBack(); - // 改变Step - await checkButtonAndClickWithID('MarqueeStep'); - await checkButtonAndClickWithID('MarqueeChangeStep'); - await pressBack(); - // 改变FromStart - await checkButtonAndClickWithID('MarqueeFromStart'); - await checkButtonAndClickWithID('MarqueeChangeFromStart'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页DataPanel - it(`DataPanelBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('DataPanel'); - //创建DataPanel组件 - await checkButtonAndClickWithID('DataPanelCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('DataPanelWidth'); - await checkButtonAndClickWithID('DataPanelChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('DataPanelHeight'); - await checkButtonAndClickWithID('DataPanelChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('DataPanelPadding'); - await checkButtonAndClickWithID('DataPanelChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('DataPanelMargin'); - await checkButtonAndClickWithID('DataPanelChangeMargin'); - await pressBack(); - // 改变CloseEffect - await checkButtonAndClickWithID('DataPanelCloseEffect'); - await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); - await pressBack(); - // 改变StrokeWidth - await checkButtonAndClickWithID('DataPanelStrokeWidth'); - await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); - await pressBack(); - // 改变Radius - await checkButtonAndClickWithID('DataPanelRadius'); - await checkButtonAndClickWithID('DataPanelChangeRadius'); - await pressBack(); - // 改变OffsetX - await checkButtonAndClickWithID('DataPanelOffsetX'); - await checkButtonAndClickWithID('DataPanelChangeOffsetX'); - await pressBack(); - // 改变OffsetY - await checkButtonAndClickWithID('DataPanelOffsetY'); - await checkButtonAndClickWithID('DataPanelChangeOffsetY'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Rating - it(`RatingBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Rating'); - //创建Rating组件 - await checkButtonAndClickWithID('RatingCreate'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('RatingWidth'); - await checkButtonAndClickWithID('RatingChangeWidth'); - await pressBack(); - //改变height - await checkButtonAndClickWithID('RatingHeight'); - await checkButtonAndClickWithID('RatingChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('RatingPadding'); - await checkButtonAndClickWithID('RatingChangePadding'); - await pressBack(); - // 改变Margin - await checkButtonAndClickWithID('RatingMargin'); - await checkButtonAndClickWithID('RatingChangeMargin'); - await pressBack(); - // 改变Stars - await checkButtonAndClickWithID('RatingStars'); - await checkButtonAndClickWithID('RatingChangeStars'); - await pressBack(); - // 改变StarStyle - await checkButtonAndClickWithID('RatingStarStyle'); - await checkButtonAndClickWithID('RatingChangeStarStyle'); - await pressBack(); - // 改变OptionsRating - await checkButtonAndClickWithID('RatingOptionsRating'); - await checkButtonAndClickWithID('RatingChangeOptionsRating'); - await pressBack(); - // Click - await checkButtonAndClickWithID('RatingClick'); - await checkButtonAndClickWithID('RatingClickIndex6'); - await pressBack(); - // swip - await checkButtonAndClickWithID('RatingSwip'); - await driver.swipe(50, 600, 500, 600); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页TextClock - it(`TextClockBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('TextClock'); - await checkButtonAndClickWithID('TextClockCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('TextClockWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextClockHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('TextClockPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextClockMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('TextClockFormatSample'); - await checkButtonAndClickWithID('change format'); - await pressBack(); - await pressBack(); - }) - - //点击首页Hyperlink - it(`HyperlinkBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Hyperlink'); - await checkButtonAndClickWithID('HyperlinkCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('HyperlinkMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - //点击首页QRCode - it(`QRCodeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('QRCode'); - await checkButtonAndClickWithID('QRCodeCreateSample'); - await driver.delayMs(1000); - await pressBack(); - await checkButtonAndClickWithID('QRCodeWidthSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('QRCodeHeightSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('QRCodePaddingSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('QRCodeMarginSample'); - await driver.delayMs(1000); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await pressBack(); - }) - - //点击首页Gauge - it(`GaugeBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Gauge'); - await checkButtonAndClickWithID('GaugeCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('GaugeWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('GaugeHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('GaugePaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GaugeMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('GaugeStrokeWidthSample'); - await checkButtonAndClickWithID('change strokeWidth 4 to 10'); - await pressBack(); - // await checkButtonAndClickWithID('GaugeTrackShadowSample'); - // await checkButtonAndClickWithID('change trackShadow'); - // await pressBack(); - await checkButtonAndClickWithID('GaugeAngleSample'); - await checkButtonAndClickWithID('change angle'); - await pressBack(); - await pressBack(); - }) - - //点击首页Badge - it(`BadgeBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('Badge'); - //创建Badge组件 - await checkButtonAndClickWithID('BadgeCreate'); - await pressBack(); - //改变Size - await checkButtonAndClickWithID('BadgeSize'); - await checkButtonAndClickWithID('BadgeChangeSize'); - await pressBack(); - //改变Color - await checkButtonAndClickWithID('BadgeColor'); - await checkButtonAndClickWithID('BadgeChangeColor'); - await pressBack(); - //改变FontSize - await checkButtonAndClickWithID('BadgeFontSize'); - await checkButtonAndClickWithID('BadgeChangeFontSize'); - await pressBack(); - //改变FontWeight - await checkButtonAndClickWithID('BadgeFontWeight'); - await checkButtonAndClickWithID('BadgeChangeFontWeight'); - await pressBack(); - //改变BorderWidth - await checkButtonAndClickWithID('BadgeBorderWidth'); - await checkButtonAndClickWithID('BadgeChangeBorderWidth'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页AlphabetIndexer - it(`AlphabetIndexerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('AlphabetIndexer'); - //创建AlphabetIndexerCreate组件 - await checkButtonAndClickWithID('AlphabetIndexerCreate'); - await driver.delayMs(1000); - await pressBack(); - //改变SelectedColor - await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); - await pressBack(); - //改变PopupColor - await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); - await pressBack(); - //改变SelectedBackgroundColor - await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); - await pressBack(); - // 改变PopupBackground - await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); - await pressBack(); - //改变SelectedFont - await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); - await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); - await pressBack(); - //改变popupFont - await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); - await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页Menu - it(`MenuBenchMarkTest`, 0, async () => { - await driver.delayMs(3000); - await checkButtonAndClickWithID('Menu'); - //创建Menu组件 - await checkButtonAndClickWithID('MenuCreate'); - await pressBack(); - //改变Font - await checkButtonAndClickWithID('MenuFont'); - await checkButtonAndClickWithID('MenuChangeFont'); - await pressBack(); - //改变FontColor - await checkButtonAndClickWithID('MenuFontColor'); - await checkButtonAndClickWithID('MenuChangeFontColor'); - await pressBack(); - //改变Width - await checkButtonAndClickWithID('MenuWidth'); - await checkButtonAndClickWithID('MenuChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('MenuHeight'); - await checkButtonAndClickWithID('MenuChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('MenuPadding'); - await checkButtonAndClickWithID('MenuChangePadding'); - await pressBack(); - // 变Margin - await checkButtonAndClickWithID('MenuMargin'); - await checkButtonAndClickWithID('MenuChangeMargin'); - await pressBack(); - // Menu展开菜单Expend - await checkButtonAndClickWithID('MenuFirstExpend'); - await checkButtonAndClickWithID('MenuFirstChangeExpend'); - await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); - await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); - await pressBack(); - await pressBack(); - // Menu收起后再次展开菜单Expend - await checkButtonAndClickWithID('MenuSecondExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - await pressBack(); - await checkButtonAndClickWithID('MenuSecondChangeExpend'); - await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); - await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); - await pressBack(); - await pressBack(); - // Menu收起后多次关闭 - await checkButtonAndClickWithID('MenuMoreClose'); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await checkButtonAndClickWithID('MenuMoreCloseSencond'); - await checkButtonAndClickWithID('MenuMoreCloseThird'); - await pressBack(); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await pressBack(); - await checkButtonAndClickWithID('MenuMoreCloseFirst'); - await pressBack(); - await pressBack(); - // Group收起后再次展开 - await checkButtonAndClickWithID('MenuGroupCloseExpand'); - await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); - await pressBack(); - await pressBack(); - // Group多次关闭 - await checkButtonAndClickWithID('MenuGroupMoreClose'); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); - await pressBack(); - await pressBack(); - - await pressBack(); //返回首页 - }) - - //点击首页TextPicker - it(`TextPickerBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('TextPicker'); - //创建TextPicker组件 - await checkButtonAndClickWithID('TextPickerCreate'); - await pressBack(); - //改变TextStyle - await checkButtonAndClickWithID('TextPickerTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeTextStyle'); - await pressBack(); - //改变SelectedTextStyle - await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); - await pressBack(); - //改变DisappearTextStyle - await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); - await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); - await pressBack(); - //改变width - await checkButtonAndClickWithID('TextPickerWidth'); - await checkButtonAndClickWithID('TextPickerChangeWidth'); - await pressBack(); - //改变Height - await checkButtonAndClickWithID('TextPickerHeight'); - await checkButtonAndClickWithID('TextPickerChangeHeight'); - await pressBack(); - //改变Padding - await checkButtonAndClickWithID('TextPickerPadding'); - await checkButtonAndClickWithID('TextPickerChangePadding'); - await pressBack(); - //改变Margin - await checkButtonAndClickWithID('TextPickerMargin'); - await checkButtonAndClickWithID('TextPickerChangeMargin'); - await pressBack(); - //手指滑动 - await checkButtonAndClickWithID('TextPickerFingerSwip'); - await driver.swipe(150, 300, 150, 150) - await pressBack(); - //手指点击 - await checkButtonAndClickWithID('TextPickerClick'); - await driver.click(150, 150) - await driver.delayMs(1000); - await pressBack(); - //鼠标滚轮MouseScroll - await checkButtonAndClickWithID('TextPickerMouseScroll'); - await driver.mouseScroll({ x: 150, y: 200 }, true, 5); - await driver.delayMs(1000); - await pressBack(); - //键盘Scroll - await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); - // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); - await driver.swipe(150, 300, 150, 150) - await driver.delayMs(1000); - await pressBack(); - await pressBack(); //返回首页 - }) - - //点击首页ScrollBar - it(`ScrollBarBenchMarkTest`, 0, async () => { - await driver.delayMs(1000); - await checkButtonAndClickWithID('ScrollBar'); - await checkButtonAndClickWithID('ScrollBarCreateSample'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarWidthSample'); - await checkButtonAndClickWithID('change width 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarHeightSample'); - await checkButtonAndClickWithID('change height 100 to 200'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarPaddingSample'); - await checkButtonAndClickWithID('change padding 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarMarginSample'); - await checkButtonAndClickWithID('change margin 20 to 30'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarDirectionSample'); - await checkButtonAndClickWithID('change direction'); - await pressBack(); - await checkButtonAndClickWithID('ScrollBarStateSample'); - await checkButtonAndClickWithID('change state to On'); - await checkButtonAndClickWithID('change state to Auto'); - await pressBack(); - await pressBack(); - }) - - - }) -} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/tool/1.bat b/performance/arkui/benchMark_Component/tool/1.bat new file mode 100644 index 0000000000000000000000000000000000000000..ace92830065fc64a19ef3f2044af6b5288f4e85b --- /dev/null +++ b/performance/arkui/benchMark_Component/tool/1.bat @@ -0,0 +1,17 @@ + +set ymd=%date:~0,4%%date:~5,2%% +for /f "tokens=* delims= " %%a in ("%ymd%") do set ymd=%%a +set hms=%time:~0,2%%time:~3,2%% +for /f "tokens=* delims= " %%a in ("%hms%") do set hms=%%a +set filename=benchmark_next.ftrace +hdc_std wait-for-device shell mount -o remount,rw / +hdc_std shell "setenforce 0" +hdc_std shell "bytrace -t 360 -b 204800 --overwrite ace > /data/%filename%" +hdc_std shell "sed -i '1,2d' /data/%filename%" +hdc_std file recv /data/%filename% +python trace.py -p D://BenchMark/%filename% + +python BenchMark_file.py +python BenchMark.py + +pause \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/tool/2.bat b/performance/arkui/benchMark_Component/tool/2.bat new file mode 100644 index 0000000000000000000000000000000000000000..0d103d6ec5be3aea9c47a397dba2291c5282ff2a --- /dev/null +++ b/performance/arkui/benchMark_Component/tool/2.bat @@ -0,0 +1,7 @@ + +hdc_std app install -r entry-default-signed.hap +hdc_std app install -r entry-ohosTest-signed.hap +hdc_std shell aa test -b cn.openharmony.benchmarksample -m entry_test -s unittest /ets/testrunner/OpenHarmonyTestRunner -s class ActsAbilityTest -s timeout 6000000 + + +pause \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/tool/BenchMark.py b/performance/arkui/benchMark_Component/tool/BenchMark.py new file mode 100644 index 0000000000000000000000000000000000000000..59fa3046ea22e797bc5f5cd70077018174bd41d9 --- /dev/null +++ b/performance/arkui/benchMark_Component/tool/BenchMark.py @@ -0,0 +1,202 @@ +import openpyxl +from openpyxl.styles import Alignment + +samples = [] +components = [] +file_contents = [] +file_path = 'D:/BenchMark/benchmark_next.ftrace' +content = "LoadJsWithModule Execute Page code : pages" +last_line_content = 'tracing_mark_write: trace_event_clock_sync: parent_ts' + +workbook = openpyxl.Workbook() # 创建工作簿 +# worksheet = workbook.create_sheet(title='BenchMark') # 创建工作表 +worksheet = workbook.active # 选择默认的表单 +worksheet['A1'] = '组件名称' +worksheet['B1'] = '页面名称' +worksheet['C1'] = '创建时间(单位ms)' +worksheet['D1'] = '布局时间(单位ms)' +worksheet.column_dimensions['A'].width = 15 +worksheet.column_dimensions['B'].width = 30 +worksheet.column_dimensions['C'].width = 20 +worksheet.column_dimensions['D'].width = 20 + +# 获取sample +def find_samples(file_path, target): + with open(file_path, 'r', encoding='ISO-8859-1') as file: + lines = file.readlines() + for i, line in enumerate(lines): + file_contents.append(line) + if target in line and 'Sample.abc' in line: + line_split = line.split(': pages')[1].split('/') + str = '' + sample = '' + if len(line_split) == 2: + str = 'text' + sample = line_split[1].strip() # 删除末尾空格 + else: + str = line_split[2] + sample = line_split[3].strip() # 删除末尾空格 + component = str[0].upper() + str[1:] # 首字母大写 + print("sample:", sample) + print("component:", component) + samples.append(sample) + components.append(component) + +find_samples(file_path, content) +# print("components.len:", len(components)) +# print("samples.len:", len(samples)) + + +# 返回内容所在的行数 +def find_line_number(target): + for i, line in enumerate(file_contents): + if target in line: + return i + 1 + return -1 # 返回-1表示未找到目标内容 + +# 返回内容所在的行数 +def find_endline_number(target, num): + for i, line in enumerate(file_contents): + if target in line and i > num: + return i + 1 + return -1 # 返回-1表示未找到目标内容 + +# 返回内容所在的行的完整内容 +def find_line_str(target): + for i, line in enumerate(file_contents): + if target in line: + return line + return '' # 返回''表示未找到目标内容 + +# 返回起始行到结束行之间的内容 +def find_line_start_end(start, end): + result = file_contents[start:end] # 获取从第start行到第end行的数据 + result_line = [] + for index,res in enumerate(result): + if 'tracing_mark_write: B' in res: + result_line.append(res) + if 'tracing_mark_write: E' in res: + result_line.append(res) + return result_line + +# 循环过滤数据开始 +for index,sample in enumerate(samples): + print("sample:", sample) + startLine = find_line_number('/' + samples[index]) + # print("startLine:", str(startLine)) + + if index == (len(samples) - 1): + endLine = find_line_number(last_line_content) + else: + endLine = find_endline_number('JsiDeclarativeEngine::LoadPageSource', startLine) + # print("endLine:", endLine) + + result = find_line_start_end(startLine, endLine) + # print('result长度:', len(result)) + + def find_create(): # create的内容 + create = [] + for line in result: + if 'Create[%s]' % components[index] in line: + create.append(line) + return create + + def find_measure(): # measure的内容 + measure = [] + for line in result: + if 'Measure[%s]' % components[index] in line: + measure.append(line) + return measure + + def find_layout(): # layout的内容 + layout = [] + for line in result: + if 'Layout[%s]' % components[index] in line: + layout.append(line) + return layout + + # print('create.len:', len(find_create())) + # print('measure.len:', len(find_measure())) + # print('layout.len:', len(find_layout())) + + # create数据 + createTimeTotal = 0 #create总时间 + for create_line_b in find_create(): + # print('create create_line_b:', create_line_b) + create_line_e = '' + result_e = result[result.index(create_line_b):] + for indexRes, res in enumerate(result_e): + # if indexRes > result.index(create_line_b) and 'tracing_mark_write: E|' in res: + if 'tracing_mark_write: E|' in res: + create_line_e = res + break + # print('create create_line_e:', create_line_e) + start_index_b = str(create_line_b).find("....") + 4 + end_index_b = str(create_line_b).find(": tracing_mark_write") + begin_time = float(create_line_b[start_index_b:end_index_b]) + start_index_e = str(create_line_e).find("....") + 4 + end_index_e = str(create_line_e).find(": tracing_mark_write") + end_time = float(create_line_e[start_index_e:end_index_e]) + createTimeC = end_time*1000000 - begin_time*1000000 + createTimeTotal += createTimeC + if samples[index] .find('Home') == -1 and samples[index] .find('Index.abc') == -1 and samples[index] .find('EntryView.abc') == -1 and samples[index] .find('RecentView.abc') == -1: + worksheet['A%s' % str(index+2)] = components[index] + worksheet['B%s' % str(index+2)] = samples[index] + if createTimeTotal != 0: + worksheet['C%s' % str(index+2)] = createTimeTotal / len(find_create()) / 1000 + print('%s create 平均时间:' % samples[index], createTimeTotal / len(find_create())) + + # measure数据begin + measureTimeTotal = 0 # measure总时间 + measureTimeP = 0 # measure平均时间 + for measure_line_b in find_measure(): + # print('%s measure measure_line_b :', measure_line_b) + measure_line_e = '' + result_e = result[result.index(measure_line_b):] + for indexRes, res in enumerate(result_e): + if 'tracing_mark_write: E|' in res: + measure_line_e = res + break + # print('measure measure_line_e:', measure_line_e) + start_index_b = str(measure_line_b).find("....") + 4 + end_index_b = str(measure_line_b).find(": tracing_mark_write") + begin_time = float(measure_line_b[start_index_b:end_index_b]) + start_index_e = str(measure_line_e).find("....") + 4 + end_index_e = str(measure_line_e).find(": tracing_mark_write") + end_time = float(measure_line_e[start_index_e:end_index_e]) + measureTimeC = end_time*1000000 - begin_time*1000000 + measureTimeTotal += measureTimeC + if measureTimeTotal != 0 and len(find_measure()) != 0: + measureTimeP = measureTimeTotal / len(find_measure()) + print('%s measure 平均时间:' % samples[index], measureTimeP) + # measure数据end + + # layout数据begin + layoutTimeTotal = 0 # layout总时间 + layoutTimeP = 0 # layout平均时间 + for layout_line_b in find_layout(): + # print('layout layout_line_b:', layout_line_b) + layout_line_e = '' + result_e = result[result.index(layout_line_b):] + for indexRes, res in enumerate(result_e): + if 'tracing_mark_write: E|' in res: + layout_line_e = res + break + # print('layout layout_line_e: ', layout_line_e) + start_index_b = str(layout_line_b).find("....") + 4 + end_index_b = str(layout_line_b).find(": tracing_mark_write") + begin_time = float(layout_line_b[start_index_b:end_index_b]) + start_index_e = str(layout_line_e).find("....") + 4 + end_index_e = str(layout_line_e).find(": tracing_mark_write") + end_time = float(layout_line_e[start_index_e:end_index_e]) + layoutTimeC = end_time*1000000 - begin_time*1000000 + layoutTimeTotal += layoutTimeC + if layoutTimeTotal != 0 and len(find_layout()) != 0: + layoutTimeP = layoutTimeTotal / len(find_layout()) + print('%s layout 平均时间:' % samples[index], layoutTimeP) + # layout数据end + worksheet['D%s' % str(index+2)] = (measureTimeP + layoutTimeP) / 1000 # measure时间加layout时间 + + print('--------------------------------------------------------------------------') +# 循环过滤数据结束 +workbook.save(filename='BenchMark.xlsx') # 保存工作簿 diff --git a/performance/arkui/benchMark_Component/tool/BenchMark_file.py b/performance/arkui/benchMark_Component/tool/BenchMark_file.py new file mode 100644 index 0000000000000000000000000000000000000000..0c4e80e1b6f5f03df8c0b5bdae9737b65e6eb76f --- /dev/null +++ b/performance/arkui/benchMark_Component/tool/BenchMark_file.py @@ -0,0 +1,15 @@ +import openpyxl + +file_path = 'D:/BenchMark/benchmark_next.ftrace' +with open(file_path, 'r+', encoding='ISO-8859-1') as file: + content = file.read() # 读取文件内容 + new_content = content.replace(".N..", "....") + new_content = new_content.replace(".n..", "....") + # f.seek(0) # 将文件指针移动到文件开头 + file.close() + +with open(file_path, 'w+',encoding='ISO-8859-1') as file: + file.truncate() + # file.seek(0) # 将文件指针移动到文件开头 + file.write(new_content) # 写入替换后的内容 + file.close() diff --git a/performance/arkui/benchMark_Component/tool/trace.py b/performance/arkui/benchMark_Component/tool/trace.py new file mode 100644 index 0000000000000000000000000000000000000000..12dec30753b595c2033ee4b4cd46e33e28d49d70 --- /dev/null +++ b/performance/arkui/benchMark_Component/tool/trace.py @@ -0,0 +1,132 @@ +#!/usr/bin/bin/env python3 +# -*- coding: UTF-8 -*- + +import sys +import os +import re +import time +import errno +import optparse +import threading +import subprocess +import codecs + +options_dict = {} +device_filenames = [] +host_filenames = {} +merget_filenames = [] +trace_command = [] +time_sync_pairs = {} +time_sync_dev = {} +TRACE_REGEX = "\s*(.*?)-(\d+?)\s+\(\s*(.*?)\)\s+\[\d+\]\s+(.*?)\s+(.*?):\s+(.*?):\s+[SFC]\|\d+\|(.*?)\s+(\d+)\s+" +DEBUG_ON = False + +def parse_options(): + usage = "Usage: %prog [options] [category1 [category2 ...]]" + desc = "Example: %prog -e sn0,sn1 -b 32768 -t 15 gfx input view ohos\n" \ + "Example: %prog -p my_trace_file.data" + + parser = optparse.OptionParser(usage=usage, description=desc) + parser.add_option('-b', '--buffer-size', dest='buffer_size', type='int', + help='trace buffer size of N KB, default 102400, no more than 300MB', + metavar = 'N') + parser.add_option('-t', '--time', dest='trace_time', type='int', + help='trace for N seconds, default 10s', metavar = 'N') + parser.add_option('-o', '--output_file', dest='output_file', + help='given merged trace filename', + metavar = 'FILE') + parser.add_option('-l', '--list_categories', dest='list_categories', + help='use bytrace command to listcategories') + parser.add_option('-e', '--serial', dest='device_serials', type='string', + help='device serials numbers, none this option for all devices') + parser.add_option('--trace_clock', dest='trace_clock', + help='only use the boot clock') + parser.add_option('--overwrite', dest='overwrite', + help='not support overwrite mode') + parser.add_option('-p', '--process_file', dest='process_file', + help='given trace file name to post process', metavar='FILE') + + options, args = parser.parse_args() + + if options.list_categories: + print("use bytrace command to list categories") + exit(0) + elif options.trace_clock: + print("only support the boot clock now") + exit(0) + elif options.overwrite: + print("the script not support overwrite mode") + exit(0) + else: + options_dict['categories'] = args + if options.trace_time is not None: + if options.trace_time > 0: + options_dict['trace_time'] = options.trace_time + else: + parser.error('trace_time must be positive') + if options.buffer_size is not None: + if options.buffer_size > 0: + options_dict['buffer_size'] = options.buffer_size + else: + parser.error('trace buffer size must be positive') + if options.output_file is not None: + options_dict['has_out_file'] = True + options_dict['out_file'] = options.output_file + if options.device_serials is not None: + options_dict['has_devices'] = True + options_dict['devices'] = options.device_serials.split(',') + if options.process_file is not None: + options_dict['process_file'] = options.process_file + +def init_options(): + options_dict['buffer_size'] = 102400 + options_dict['trace_time'] = 10 + options_dict['has_out_file'] = False + options_dict['out_file'] = '' + options_dict['has_devices'] = False + options_dict['devices'] =[] + options_dict['process_file'] = '' + +def process_trace_file(in_file): + lineno = 0 + dirname, filename = os.path.split(in_file) + basename, suffix = os.path.splitext(filename) + out_name = "{}_o{}".format(basename, suffix) + out_file = os.path.join(dirname, out_name) + + print("start processing trace file") + with open(in_file, 'r', encoding='ISO-8859-1') as infile, open(out_file, "w+", encoding='ISO-8859-1') as outfile: + for line in infile: + lineno += 1 + if lineno == 1 and line.find("capturing trace...") > -1: + continue + if lineno == 2 and line.find("TRACE:") > -1: + continue + if line.find("tracing_mark_write") > -1: + trace_match = re.match(TRACE_REGEX, line) + if trace_match: + if DEBUG_ON == True: + ts_str = trace_match.group(5) + ts_mark = trace_match.group(6) + ts_lable = trace_match.group(7) + ts_num = trace_match.group(8) + print("{} {} {}\t{}".format(ts_str, ts_mark, ts_lable, ts_num)) + line = line.rstrip(' ') + pos = line.rfind(' ') + line = line[:pos] + '|' + line[pos+1:] + outfile.write(line) + print("process trace data finished to file {}".format(out_name)) + + +def main(): + init_options() + parse_options() + + if options_dict['process_file'] is not None: + process_trace_file(options_dict['process_file']) + return + + +if __name__ == '__main__': + main() +