Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b5b0ac17
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看板
提交
b5b0ac17
编写于
9月 01, 2023
作者:
W
wangguan
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Grid XTS 用例修复
Signed-off-by:
N
wangguan
<
wangguan27@huawei.com
>
上级
630f5f2b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
18 deletion
+22
-18
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/GridCallbackPage.ets
...entry/src/main/ets/MainAbility/pages/GridCallbackPage.ets
+17
-9
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridCallbackJsunit.test.ets
...nt_ui/entry/src/main/ets/test/GridCallbackJsunit.test.ets
+5
-9
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/GridCallbackPage.ets
浏览文件 @
b5b0ac17
...
@@ -178,10 +178,10 @@ struct GridCallbackPage {
...
@@ -178,10 +178,10 @@ struct GridCallbackPage {
Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%')
Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%')
Grid(this.scroller) {
Grid(this.scroller) {
ForEach(this.Number, (
day
: string) => {
ForEach(this.Number, (
row
: string) => {
ForEach(this.Number, (
day
: string) => {
ForEach(this.Number, (
column
: string) => {
GridItem() {
GridItem() {
Text(
day
)
Text(
row +"-"+ column
)
.fontSize(16)
.fontSize(16)
.backgroundColor(0xF9CF93)
.backgroundColor(0xF9CF93)
.width('100%')
.width('100%')
...
@@ -235,12 +235,20 @@ struct GridCallbackPage {
...
@@ -235,12 +235,20 @@ struct GridCallbackPage {
return { offsetRemain: offset }
return { offsetRemain: offset }
})
})
Button(this.buttonName)
Row(){
.key('button')
Button("scoll to bottom")
.onClick(() => { // 点击后滑到下一页
.key("bottom")
this.buttonName = 'clicked'
.onClick(() => { // 滑动到底部
this.scroller.scrollPage({ next: true })
console.log("滑动到底部")
})
this.scroller.scrollTo({xOffset:0,yOffset:2000})
})
Button(this.buttonName)
.key('button')
.onClick(() => { // 点击后滑到下一页
this.buttonName = 'clicked'
this.scroller.scrollPage({ next: true })
})
}
Text('onScrollIndex:' + this.onScrollIndex).key('onScrollIndex')
Text('onScrollIndex:' + this.onScrollIndex).key('onScrollIndex')
Text(this.onItemDragStart).key('onItemDragStart')
Text(this.onItemDragStart).key('onItemDragStart')
Text(this.onItemDragEnter).key('onItemDragEnter')
Text(this.onItemDragEnter).key('onItemDragEnter')
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridCallbackJsunit.test.ets
浏览文件 @
b5b0ac17
...
@@ -52,6 +52,7 @@ export default function GridCallbackJsunit() {
...
@@ -52,6 +52,7 @@ export default function GridCallbackJsunit() {
let bottom = grid2.bottom
let bottom = grid2.bottom
let left = grid2.left
let left = grid2.left
let right = grid2.right
let right = grid2.right
console.log('[GridCallbackJsunit_1000] grid 2 top:' + top +" bottom:" + bottom + "left: " + left + " right:" + right)
let driver = await UiDriver.create()
let driver = await UiDriver.create()
await driver.swipe(Math.round((right - left)), Math.round(bottom - 60), Math.round((right - left)), Math.round(top + 60));
await driver.swipe(Math.round((right - left)), Math.round(bottom - 60), Math.round((right - left)), Math.round(top + 60));
await CommonFunc.sleep(200);
await CommonFunc.sleep(200);
...
@@ -91,18 +92,13 @@ export default function GridCallbackJsunit() {
...
@@ -91,18 +92,13 @@ export default function GridCallbackJsunit() {
expect(text7).assertEqual('onScrollFrameBegin:succ');
expect(text7).assertEqual('onScrollFrameBegin:succ');
await CommonFunc.sleep(200);
await CommonFunc.sleep(200);
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
let bottomButton = await driver.findComponent(BY.key('bottom'));
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
await bottomButton.click()
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
await CommonFunc.sleep(2000)
await CommonFunc.sleep(1000);
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
await driver.swipe(Math.round((right - left)), Math.round(top + 60), Math.round((right - left)), Math.round(bottom - 60));
await CommonFunc.sleep(1000);
let onReachEndText = await driver.findComponent(BY.key('onReachEndText'));
let onReachEndText = await driver.findComponent(BY.key('onReachEndText'));
let text9 = await onReachEndText.getText();
let text9 = await onReachEndText.getText();
console.info("[GridCallbackJsunit_1000] onReachEndText: " + text9);
console.info("[GridCallbackJsunit_1000] onReachEndText: " + text9);
expect(text9).assertEqual('onReachEnd:succ');
expect(text9).assertEqual('onReachEnd:succ');
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
e3e97b04
·
9月 03, 2023
mentioned in commit
e3e97b04
mentioned in commit e3e97b04917a8910dd75281b470d2c87985b0014
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录