Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
403fa446
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
403fa446
编写于
9月 27, 2024
作者:
zhaofengliang920817
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新 overflow-visible-event 页面自动化脚本,支持iOS模拟点击手势。
上级
f26abe98
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
51 addition
and
13 deletion
+51
-13
pages/CSS/overflow/overflow-visible-event.test.js
pages/CSS/overflow/overflow-visible-event.test.js
+32
-6
pages/CSS/overflow/overflow-visible-event.uvue
pages/CSS/overflow/overflow-visible-event.uvue
+19
-7
未找到文件。
pages/CSS/overflow/overflow-visible-event.test.js
浏览文件 @
403fa446
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe
(
'
/pages/CSS/overflow/overflow-visible-event.uvue
'
,
()
=>
{
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
let
isAndroid
=
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
if
(
!
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
uniTestPlatformInfo
.
toLowerCase
().
includes
(
'
ios
'
))
{
it
(
'
dummyTest
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
...
...
@@ -27,7 +27,11 @@ describe('/pages/CSS/overflow/overflow-visible-event.uvue', () => {
res
=
await
page
.
callMethod
(
'
jest_getRect
'
)
const
point_x
=
await
page
.
data
(
'
jest_click_x
'
);
const
point_y
=
await
page
.
data
(
'
jest_click_y
'
);
if
(
isAndroid
){
await
program
.
adbCommand
(
"
input tap
"
+
"
"
+
point_x
+
"
"
+
point_y
)
}
else
{
await
program
.
tap
({
x
:
point_x
,
y
:
point_y
})
}
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
...
...
@@ -41,7 +45,21 @@ describe('/pages/CSS/overflow/overflow-visible-event.uvue', () => {
const
distance
=
100
;
const
destY
=
point_y
+
100
const
duration
=
1000
if
(
isAndroid
)
{
await
program
.
adbCommand
(
"
input swipe
"
+
"
"
+
point_x
+
"
"
+
point_y
+
"
"
+
point_x
+
"
"
+
destY
+
"
"
+
duration
)
}
else
{
await
program
.
swipe
({
startPoint
:
{
x
:
point_x
,
y
:
point_y
},
endPoint
:
{
x
:
point_x
,
y
:
destY
},
duration
:
duration
})
}
await
page
.
waitFor
(
1500
);
await
page
.
callMethod
(
'
jest_getParentRect
'
)
const
currentParentTop
=
await
page
.
data
(
'
jest_parent_top
'
);
...
...
@@ -57,7 +75,11 @@ describe('/pages/CSS/overflow/overflow-visible-event.uvue', () => {
const
point_x
=
await
page
.
data
(
'
jest_click_x
'
);
const
point_y
=
await
page
.
data
(
'
jest_click_y
'
);
console
.
log
(
"
input tap
"
+
"
"
+
point_x
+
"
"
+
point_y
);
if
(
isAndroid
)
{
await
program
.
adbCommand
(
"
input tap
"
+
"
"
+
point_x
+
"
"
+
point_y
)
}
else
{
await
program
.
tap
({
x
:
point_x
,
y
:
point_y
})
}
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
...
...
@@ -69,7 +91,11 @@ describe('/pages/CSS/overflow/overflow-visible-event.uvue', () => {
const
point_x
=
await
page
.
data
(
'
jest_click_x
'
);
const
point_y
=
await
page
.
data
(
'
jest_click_y
'
);
console
.
log
(
"
input tap
"
+
"
"
+
point_x
+
"
"
+
point_y
);
if
(
isAndroid
)
{
await
program
.
adbCommand
(
"
input tap
"
+
"
"
+
point_x
+
"
"
+
point_y
)
}
else
{
await
program
.
tap
({
x
:
point_x
,
y
:
point_y
})
}
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
...
...
pages/CSS/overflow/overflow-visible-event.uvue
浏览文件 @
403fa446
...
...
@@ -100,7 +100,10 @@
jest_getRect() {
const rect = uni.getElementById('child')?.getBoundingClientRect()
if (rect != null) {
const ratio = uni.getSystemInfoSync().devicePixelRatio
let ratio = 1
// #ifdef APP-ANDROID
ratio = uni.getSystemInfoSync().devicePixelRatio
// #endif
this.jest_click_x = rect.x * ratio + 10
this.jest_click_y = rect.bottom * ratio - 10
}
...
...
@@ -110,7 +113,10 @@
if (transform != null) {
let value = transform as string
value = value.split(",")[1].slice(0, -3)
const ratio = uni.getSystemInfoSync().devicePixelRatio
let ratio = 1
// #ifdef APP-ANDROID
ratio = uni.getSystemInfoSync().devicePixelRatio
// #endif
this.jest_parent_top = Math.round((parseFloat(value) * ratio))
}
},
...
...
@@ -119,7 +125,10 @@
if (rect != null) {
const systemInfo = uni.getSystemInfoSync()
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const ratio = systemInfo.devicePixelRatio
let ratio = 1
// #ifdef APP-ANDROID
ratio = systemInfo.devicePixelRatio
// #endif
this.jest_click_x = rect.x * ratio + 10
this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio
}
...
...
@@ -131,7 +140,10 @@
scrollView.scrollTo(0, rect.top)
setTimeout(() => {
const systemInfo = uni.getSystemInfoSync()
const ratio = systemInfo.devicePixelRatio
let ratio = 1
// #ifdef APP-ANDROID
ratio = systemInfo.devicePixelRatio
// #endif
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect()
if (afterRect != null) {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录