Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3a526d50
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3a526d50
编写于
7月 21, 2022
作者:
Z
zhouke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify.Signed-off-by: <zhouke35@huawei.com>.
Signed-off-by:
N
zhouke
<
zhouke35@huawei.com
>
上级
85f992fe
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
502 addition
and
310 deletion
+502
-310
arkXtest/BUILD.gn
arkXtest/BUILD.gn
+1
-1
arkXtest/uitest/src/main/config.json
arkXtest/uitest/src/main/config.json
+1
-4
arkXtest/uitest/src/main/ets/MainAbility/app.ets
arkXtest/uitest/src/main/ets/MainAbility/app.ets
+12
-0
arkXtest/uitest/src/main/ets/MainAbility/pages/index.ets
arkXtest/uitest/src/main/ets/MainAbility/pages/index.ets
+91
-63
arkXtest/uitest/src/main/ets/TestAbility/app.ets
arkXtest/uitest/src/main/ets/TestAbility/app.ets
+0
-10
arkXtest/uitest/src/main/ets/TestAbility/pages/fourth.ets
arkXtest/uitest/src/main/ets/TestAbility/pages/fourth.ets
+0
-45
arkXtest/uitest/src/main/ets/TestAbility/pages/index.ets
arkXtest/uitest/src/main/ets/TestAbility/pages/index.ets
+77
-63
arkXtest/uitest/src/main/ets/TestAbility/pages/second.ets
arkXtest/uitest/src/main/ets/TestAbility/pages/second.ets
+0
-43
arkXtest/uitest/src/main/ets/TestAbility/pages/third.ets
arkXtest/uitest/src/main/ets/TestAbility/pages/third.ets
+0
-43
arkXtest/uitest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...t/uitest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+1
-1
arkXtest/uitest/src/main/ets/test/uitest.test.ets
arkXtest/uitest/src/main/ets/test/uitest.test.ets
+319
-37
未找到文件。
arkXtest/BUILD.gn
浏览文件 @
3a526d50
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Copyright (C) 202
2
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
...
...
arkXtest/uitest/src/main/config.json
浏览文件 @
3a526d50
...
...
@@ -89,10 +89,7 @@
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/second"
,
"pages/third"
,
"pages/fourth"
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
...
...
arkXtest/uitest/src/main/ets/MainAbility/app.ets
浏览文件 @
3a526d50
...
...
@@ -12,11 +12,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
abilityDelegatorArguments.parameters['-s timeout'] = 3000000
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
arkXtest/uitest/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
3a526d50
/**
* Copyright (c) 2022 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 router from '@system.router';
import prompt from '@ohos.prompt';
...
...
@@ -8,72 +22,86 @@ struct ScrollExample {
private arr: number[] = [1,2,3,4]
build() {
Stack({ alignContent: Alignment.TopStart
}) {
Scroll(this.scroller) {
Column() {
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.key('my-key')
.type(ButtonType.Capsule
)
.margin({ top: 20 }
)
.onClick(() => {
router.push({ uri: 'pages/second' })
}
)
.gesture(
LongPressGesture({repeat:false
})
.onAction((event: GestureEvent)=>
{
router.push({ uri: 'pages/fourth
' })
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center
}) {
Text('MainPage')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Stack({ alignContent: Alignment.TopStart }) {
Scroll(this.scroller) {
Column() {
Button() {
Text('next page'
)
.fontSize(25
)
.fontWeight(FontWeight.Bold)
}
.key('my-key'
)
.type(ButtonType.Capsule)
.margin({ top: 20
})
.onClick(() =>
{
router.push({ uri: 'pages/second
' })
})
)
Button() {
Text('Click twice')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.type(ButtonType.Capsule)
.margin({top:20})
.gesture(
TapGesture({ count: 2 })
.onAction(() => {
router.push({ uri: 'pages/third' })
})
LongPressGesture({ repeat: false })
.onAction((event: GestureEvent) => {
router.push({ uri: 'pages/fourth' })
})
)
Button() {
Text('Click twice')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.type(ButtonType.Capsule)
.margin({ top: 20 })
.gesture(
TapGesture({ count: 1 })
.onAction(() => {
router.push({ uri: 'pages/third' })
})
)
Checkbox({name:'hi'})
.size({width:30,height:30})
TextInput({ placeholder: 'welcome', text: 'Hello World'})
.type(InputType.Normal)
.width(300)
.height(50)
.fontSize(40)
.enabled(true)
.margin({ top: 20 })
ForEach(this.arr, (item) => {
Text(item.toString())
.width('100%').height('30%').backgroundColor(0xFFFFFF)
.borderRadius(75).fontSize(80).textAlign(TextAlign.Center)
.margin({ top: 10 })
}, item => item)
Button() {
Text('bottom')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20, left: 150
})
.onClick(() => {
router.push({ uri: 'pages/second' })
})
}.width('100%')
}
.scrollable(ScrollDirection.Vertical).scrollBar(BarState.On)
.scrollBarColor(Color.Gray).scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
}.width('100%').height('100%').backgroundColor(0xDCDCDC)
Checkbox({ name: 'hi' })
.size({ width: 30, height: 30 })
TextInput({ placeholder: 'welcome', text: 'Hello World' })
.type(InputType.Normal)
.width(300)
.height(50)
.fontSize(40)
.enabled(true)
.margin({ top: 20 })
ForEach(this.arr, (item) => {
Text(item.toString())
.width('100%')
.height('30%')
.backgroundColor(0xFFFFFF)
.borderRadius(75)
.fontSize(80)
.textAlign(TextAlign.Center)
.margin({ top: 10 })
}, item => item)
Button() {
Text('bottom')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20, left: 150
})
.onClick(() => {
router.push({ uri: 'pages/second' })
})
}.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.On)
.scrollBarColor(Color.Gray)
.scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
}.width('100%').height('100%').backgroundColor(0xDCDCDC)
}
}
}
arkXtest/uitest/src/main/ets/TestAbility/app.ets
浏览文件 @
3a526d50
...
...
@@ -12,20 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
abilityDelegatorArguments.parameters['timeout'] = 3000000
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
...
...
arkXtest/uitest/src/main/ets/TestAbility/pages/fourth.ets
已删除
100644 → 0
浏览文件 @
85f992fe
/**
* Copyright (c) 2022 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 router from '@system.router';
@Entry
@Component
struct Fourth
{
private content: string = "Fourth Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('longClick')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkXtest/uitest/src/main/ets/TestAbility/pages/index.ets
浏览文件 @
3a526d50
...
...
@@ -22,72 +22,86 @@ struct ScrollExample {
private arr: number[] = [1,2,3,4]
build() {
Stack({ alignContent: Alignment.TopStart
}) {
Scroll(this.scroller) {
Column() {
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.key('my-key')
.type(ButtonType.Capsule
)
.margin({ top: 20 }
)
.onClick(() => {
router.push({ uri: 'pages/second' })
}
)
.gesture(
LongPressGesture({repeat:false
})
.onAction((event: GestureEvent)=>
{
router.push({ uri: 'pages/fourth
' })
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center
}) {
Text('MainPage')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Stack({ alignContent: Alignment.TopStart }) {
Scroll(this.scroller) {
Column() {
Button() {
Text('next page'
)
.fontSize(25
)
.fontWeight(FontWeight.Bold)
}
.key('my-key'
)
.type(ButtonType.Capsule)
.margin({ top: 20
})
.onClick(() =>
{
router.push({ uri: 'pages/second
' })
})
)
Button() {
Text('Click twice')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.type(ButtonType.Capsule)
.margin({top:20})
.gesture(
TapGesture({ count: 2 })
.onAction(() => {
router.push({ uri: 'pages/third' })
})
LongPressGesture({ repeat: false })
.onAction((event: GestureEvent) => {
router.push({ uri: 'pages/fourth' })
})
)
Button() {
Text('Click twice')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.type(ButtonType.Capsule)
.margin({ top: 20 })
.gesture(
TapGesture({ count: 1 })
.onAction(() => {
router.push({ uri: 'pages/third' })
})
)
Checkbox({name:'hi'})
.size({width:30,height:30})
TextInput({ placeholder: 'welcome', text: 'Hello World'})
.type(InputType.Normal)
.width(300)
.height(50)
.fontSize(40)
.enabled(true)
.margin({ top: 20 })
ForEach(this.arr, (item) => {
Text(item.toString())
.width('100%').height('30%').backgroundColor(0xFFFFFF)
.borderRadius(75).fontSize(80).textAlign(TextAlign.Center)
.margin({ top: 10 })
}, item => item)
Button() {
Text('bottom')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20, left: 150
})
.onClick(() => {
router.push({ uri: 'pages/second' })
})
}.width('100%')
}
.scrollable(ScrollDirection.Vertical).scrollBar(BarState.On)
.scrollBarColor(Color.Gray).scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
}.width('100%').height('100%').backgroundColor(0xDCDCDC)
Checkbox({ name: 'hi' })
.size({ width: 30, height: 30 })
TextInput({ placeholder: 'welcome', text: 'Hello World' })
.type(InputType.Normal)
.width(300)
.height(50)
.fontSize(40)
.enabled(true)
.margin({ top: 20 })
ForEach(this.arr, (item) => {
Text(item.toString())
.width('100%')
.height('30%')
.backgroundColor(0xFFFFFF)
.borderRadius(75)
.fontSize(80)
.textAlign(TextAlign.Center)
.margin({ top: 10 })
}, item => item)
Button() {
Text('bottom')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20, left: 150
})
.onClick(() => {
router.push({ uri: 'pages/second' })
})
}.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.On)
.scrollBarColor(Color.Gray)
.scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
}.width('100%').height('100%').backgroundColor(0xDCDCDC)
}
}
}
arkXtest/uitest/src/main/ets/TestAbility/pages/second.ets
已删除
100644 → 0
浏览文件 @
85f992fe
/**
* Copyright (c) 2022 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 router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkXtest/uitest/src/main/ets/TestAbility/pages/third.ets
已删除
100644 → 0
浏览文件 @
85f992fe
/**
* Copyright (c) 2022 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 router from '@system.router';
@Entry
@Component
struct Third{
private content: string = "Third Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('doubleClick')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
arkXtest/uitest/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
3a526d50
...
...
@@ -58,7 +58,7 @@ export default class OpenHarmonyTestRunner implements TestRunner {
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.
Test
Ability
'
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.
Main
Ability
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
...
...
arkXtest/uitest/src/main/ets/test/uitest.test.ets
浏览文件 @
3a526d50
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录