Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
37761836
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
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看板
提交
37761836
编写于
3月 02, 2024
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
prompt 优化自动化测试截图区域,避免某些型号系统区域影响对比结果
上级
9394e36f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
103 addition
and
37 deletion
+103
-37
pages/API/action-sheet/action-sheet.test.js
pages/API/action-sheet/action-sheet.test.js
+13
-13
pages/API/modal/modal.test.js
pages/API/modal/modal.test.js
+54
-24
pages/API/toast/toast.test.js
pages/API/toast/toast.test.js
+32
-0
pages/API/toast/toast.uvue
pages/API/toast/toast.uvue
+4
-0
未找到文件。
pages/API/action-sheet/action-sheet.test.js
浏览文件 @
37761836
...
...
@@ -23,7 +23,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -64,7 +64,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -106,7 +106,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -147,7 +147,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -188,7 +188,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -229,7 +229,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -273,7 +273,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -314,7 +314,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -355,7 +355,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -396,7 +396,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -438,7 +438,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -479,7 +479,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
@@ -520,7 +520,7 @@ describe('API-loading', () => {
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
100
,
width
:
windowWidth
},
});
...
...
pages/API/modal/modal.test.js
浏览文件 @
37761836
...
...
@@ -16,13 +16,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -54,13 +56,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -93,13 +97,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -132,13 +138,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -171,13 +179,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -210,13 +220,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -249,13 +260,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -288,13 +300,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -327,13 +340,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -366,13 +380,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -405,13 +421,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -444,13 +462,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -483,13 +503,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -522,13 +544,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -561,13 +585,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -601,13 +627,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -640,13 +667,15 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -679,13 +708,14 @@ describe('API-loading', () => {
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
pages/API/toast/toast.test.js
浏览文件 @
37761836
...
...
@@ -5,6 +5,7 @@ describe('API-toast', () => {
let
page
;
const
isAndroid
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/API/toast/toast
'
)
await
page
.
waitFor
(
600
);
...
...
@@ -13,12 +14,21 @@ describe('API-toast', () => {
it
(
"
onload-toast-test
"
,
async
()
=>
{
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -38,11 +48,18 @@ describe('API-toast', () => {
await
btnToastDefaultButton
.
tap
()
await
page
.
waitFor
(
200
)
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -62,11 +79,16 @@ describe('API-toast', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
2000
)
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -84,11 +106,16 @@ describe('API-toast', () => {
await
btnToastErrorIconButton
.
tap
()
await
page
.
waitFor
(
200
)
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
@@ -112,11 +139,16 @@ describe('API-toast', () => {
await
page
.
waitFor
(
200
)
if
(
isAndroid
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
const
image
=
await
program
.
screenshot
({
adb
:
true
,
area
:
{
x
:
0
,
y
:
200
,
height
:
windowHeight
-
200
,
width
:
windowWidth
},
});
expect
(
image
).
toMatchImageSnapshot
();
...
...
pages/API/toast/toast.uvue
浏览文件 @
37761836
...
...
@@ -37,6 +37,10 @@
}, 2000);
},
methods: {
//自动化测试例专用
jest_getWindowInfo() : GetWindowInfoResult {
return uni.getWindowInfo();
},
toast1Tap: function () {
uni.showToast({
title: "默认",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录