提交 d6a87ef3 编写于 作者: L limeng

xts文件名修改

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