Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
cb7f78de
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5998
Star
91
Fork
163
代码
文件
提交
分支
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看板
提交
cb7f78de
编写于
3月 26, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 调整 toMatchImageSnapshot 为 toSaveImageSnapshot,只截图,不对比
上级
53eb552f
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
157 addition
and
157 deletion
+157
-157
pages/API/action-sheet/action-sheet.test.js
pages/API/action-sheet/action-sheet.test.js
+26
-26
pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js
...lement-by-id/get-element-by-id-multiple-root-node.test.js
+3
-3
pages/API/get-element-by-id/get-element-by-id.test.js
pages/API/get-element-by-id/get-element-by-id.test.js
+1
-1
pages/API/load-font-face/load-font-face.test.js
pages/API/load-font-face/load-font-face.test.js
+2
-2
pages/API/modal/modal.test.js
pages/API/modal/modal.test.js
+36
-36
pages/API/navigator/new-page/onLoad.test.js
pages/API/navigator/new-page/onLoad.test.js
+5
-5
pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js
...set-navigation-bar-color/set-navigation-bar-color.test.js
+2
-2
pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js
...set-navigation-bar-title/set-navigation-bar-title.test.js
+2
-2
pages/API/toast/toast.test.js
pages/API/toast/toast.test.js
+12
-12
pages/CSS/overflow/overflow.test.js
pages/CSS/overflow/overflow.test.js
+1
-1
pages/CSS/text/font-family.test.js
pages/CSS/text/font-family.test.js
+1
-1
pages/CSS/text/font-size.test.js
pages/CSS/text/font-size.test.js
+1
-1
pages/CSS/variable/variable.test.js
pages/CSS/variable/variable.test.js
+1
-1
pages/component/general-attribute/general-attribute.test.js
pages/component/general-attribute/general-attribute.test.js
+2
-2
pages/component/image/image.test.js
pages/component/image/image.test.js
+2
-2
pages/component/input/input.test.js
pages/component/input/input.test.js
+2
-2
pages/component/list-view/list-view-multiplex.test.js
pages/component/list-view/list-view-multiplex.test.js
+16
-16
pages/component/list-view/list-view-refresh.test.js
pages/component/list-view/list-view-refresh.test.js
+9
-9
pages/component/nested-scroll-body/nested-scroll-body.test.js
...s/component/nested-scroll-body/nested-scroll-body.test.js
+12
-12
pages/component/nested-scroll-header/nested-scroll-header.test.js
...mponent/nested-scroll-header/nested-scroll-header.test.js
+2
-2
pages/component/scroll-view/scroll-view-props.test.js
pages/component/scroll-view/scroll-view-props.test.js
+1
-1
pages/component/scroll-view/scroll-view-refresher.test.js
pages/component/scroll-view/scroll-view-refresher.test.js
+1
-1
pages/component/scroll-view/scroll-view.test.js
pages/component/scroll-view/scroll-view.test.js
+3
-3
pages/component/sticky-header/sticky-header.test.js
pages/component/sticky-header/sticky-header.test.js
+2
-2
pages/component/sticky-section/sticky-section.test.js
pages/component/sticky-section/sticky-section.test.js
+2
-2
pages/component/text/text-props.test.js
pages/component/text/text-props.test.js
+1
-1
pages/component/web-view-local/web-view-local.test.js
pages/component/web-view-local/web-view-local.test.js
+1
-1
pages/pages.test.js
pages/pages.test.js
+4
-4
pages/template/list-news/list-news.test.js
pages/template/list-news/list-news.test.js
+1
-1
pages/template/navbar-lite/navbar-lite.test.js
pages/template/navbar-lite/navbar-lite.test.js
+2
-2
pages/webview-screenshot/webview-screenshot.test.js
pages/webview-screenshot/webview-screenshot.test.js
+1
-1
未找到文件。
pages/API/action-sheet/action-sheet.test.js
浏览文件 @
cb7f78de
...
@@ -27,13 +27,13 @@ describe('API-loading', () => {
...
@@ -27,13 +27,13 @@ describe('API-loading', () => {
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -67,13 +67,13 @@ describe('API-loading', () => {
...
@@ -67,13 +67,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -109,13 +109,13 @@ describe('API-loading', () => {
...
@@ -109,13 +109,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -150,13 +150,13 @@ describe('API-loading', () => {
...
@@ -150,13 +150,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -191,13 +191,13 @@ describe('API-loading', () => {
...
@@ -191,13 +191,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -232,13 +232,13 @@ describe('API-loading', () => {
...
@@ -232,13 +232,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -276,13 +276,13 @@ describe('API-loading', () => {
...
@@ -276,13 +276,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -317,13 +317,13 @@ describe('API-loading', () => {
...
@@ -317,13 +317,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -358,13 +358,13 @@ describe('API-loading', () => {
...
@@ -358,13 +358,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -399,13 +399,13 @@ describe('API-loading', () => {
...
@@ -399,13 +399,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -441,13 +441,13 @@ describe('API-loading', () => {
...
@@ -441,13 +441,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -482,13 +482,13 @@ describe('API-loading', () => {
...
@@ -482,13 +482,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
...
@@ -523,13 +523,13 @@ describe('API-loading', () => {
...
@@ -523,13 +523,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
...
pages/API/get-element-by-id/get-element-by-id-multiple-root-node.test.js
浏览文件 @
cb7f78de
...
@@ -2,7 +2,7 @@ const PAGE_PATH =
...
@@ -2,7 +2,7 @@ const PAGE_PATH =
"
/pages/API/get-element-by-id/get-element-by-id-multiple-root-node
"
;
"
/pages/API/get-element-by-id/get-element-by-id-multiple-root-node
"
;
let
page
;
let
page
;
describe
(
"
getElementByIdForMultipleRootNode
"
,
()
=>
{
describe
(
"
getElementByIdForMultipleRootNode
"
,
()
=>
{
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
);
page
=
await
program
.
reLaunch
(
PAGE_PATH
);
await
page
.
waitFor
(
'
view
'
);
await
page
.
waitFor
(
'
view
'
);
...
@@ -17,6 +17,6 @@ describe("getElementByIdForMultipleRootNode", () => {
...
@@ -17,6 +17,6 @@ describe("getElementByIdForMultipleRootNode", () => {
await
page
.
callMethod
(
"
changeViewStyle
"
);
await
page
.
callMethod
(
"
changeViewStyle
"
);
await
page
.
waitFor
(
500
);
await
page
.
waitFor
(
500
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/API/get-element-by-id/get-element-by-id.test.js
浏览文件 @
cb7f78de
...
@@ -16,6 +16,6 @@ describe("getElementById", () => {
...
@@ -16,6 +16,6 @@ describe("getElementById", () => {
await
page
.
callMethod
(
"
changeViewStyle
"
);
await
page
.
callMethod
(
"
changeViewStyle
"
);
await
page
.
waitFor
(
500
);
await
page
.
waitFor
(
500
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/API/load-font-face/load-font-face.test.js
浏览文件 @
cb7f78de
...
@@ -8,12 +8,12 @@ describe("loadFontFace", () => {
...
@@ -8,12 +8,12 @@ describe("loadFontFace", () => {
});
});
it
(
"
parent screenshot
"
,
async
()
=>
{
it
(
"
parent screenshot
"
,
async
()
=>
{
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
it
(
"
child screenshot
"
,
async
()
=>
{
it
(
"
child screenshot
"
,
async
()
=>
{
const
page
=
await
program
.
navigateTo
(
CHILD_PAGE_PATH
);
const
page
=
await
program
.
navigateTo
(
CHILD_PAGE_PATH
);
await
page
.
waitFor
(
3000
);
await
page
.
waitFor
(
3000
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/API/modal/modal.test.js
浏览文件 @
cb7f78de
...
@@ -28,13 +28,13 @@ describe('API-loading', () => {
...
@@ -28,13 +28,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -68,13 +68,13 @@ describe('API-loading', () => {
...
@@ -68,13 +68,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -109,13 +109,13 @@ describe('API-loading', () => {
...
@@ -109,13 +109,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -150,13 +150,13 @@ describe('API-loading', () => {
...
@@ -150,13 +150,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -191,13 +191,13 @@ describe('API-loading', () => {
...
@@ -191,13 +191,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -231,13 +231,13 @@ describe('API-loading', () => {
...
@@ -231,13 +231,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -271,13 +271,13 @@ describe('API-loading', () => {
...
@@ -271,13 +271,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -311,13 +311,13 @@ describe('API-loading', () => {
...
@@ -311,13 +311,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -351,13 +351,13 @@ describe('API-loading', () => {
...
@@ -351,13 +351,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -392,13 +392,13 @@ describe('API-loading', () => {
...
@@ -392,13 +392,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -433,13 +433,13 @@ describe('API-loading', () => {
...
@@ -433,13 +433,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -474,13 +474,13 @@ describe('API-loading', () => {
...
@@ -474,13 +474,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -515,13 +515,13 @@ describe('API-loading', () => {
...
@@ -515,13 +515,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -556,13 +556,13 @@ describe('API-loading', () => {
...
@@ -556,13 +556,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -597,13 +597,13 @@ describe('API-loading', () => {
...
@@ -597,13 +597,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -638,13 +638,13 @@ describe('API-loading', () => {
...
@@ -638,13 +638,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -679,13 +679,13 @@ describe('API-loading', () => {
...
@@ -679,13 +679,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -719,13 +719,13 @@ describe('API-loading', () => {
...
@@ -719,13 +719,13 @@ describe('API-loading', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
...
pages/API/navigator/new-page/onLoad.test.js
浏览文件 @
cb7f78de
...
@@ -11,7 +11,7 @@ describe("onLoad", () => {
...
@@ -11,7 +11,7 @@ describe("onLoad", () => {
await
page
.
callMethod
(
"
navigateToOnLoadWithType
"
,
"
adjustData
"
);
await
page
.
callMethod
(
"
navigateToOnLoadWithType
"
,
"
adjustData
"
);
await
page
.
waitFor
(
1000
);
await
page
.
waitFor
(
1000
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
it
(
"
navigateTo
"
,
async
()
=>
{
it
(
"
navigateTo
"
,
async
()
=>
{
page
=
await
program
.
reLaunch
(
INTERMEDIATE_PAGE_PATH
);
page
=
await
program
.
reLaunch
(
INTERMEDIATE_PAGE_PATH
);
...
@@ -68,7 +68,7 @@ describe("onLoad", () => {
...
@@ -68,7 +68,7 @@ describe("onLoad", () => {
height
:
2140
,
height
:
2140
,
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
({
expect
(
image
).
to
Save
ImageSnapshot
({
failureThreshold
:
0.05
,
failureThreshold
:
0.05
,
failureThresholdType
:
"
percent
"
,
failureThresholdType
:
"
percent
"
,
});
});
...
@@ -86,7 +86,7 @@ describe("onLoad", () => {
...
@@ -86,7 +86,7 @@ describe("onLoad", () => {
height
:
2140
,
height
:
2140
,
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
({
expect
(
image
).
to
Save
ImageSnapshot
({
failureThreshold
:
0.05
,
failureThreshold
:
0.05
,
failureThresholdType
:
"
percent
"
,
failureThresholdType
:
"
percent
"
,
});
});
...
@@ -104,7 +104,7 @@ describe("onLoad", () => {
...
@@ -104,7 +104,7 @@ describe("onLoad", () => {
height
:
2140
,
height
:
2140
,
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
({
expect
(
image
).
to
Save
ImageSnapshot
({
failureThreshold
:
0.05
,
failureThreshold
:
0.05
,
failureThresholdType
:
"
percent
"
,
failureThresholdType
:
"
percent
"
,
});
});
...
@@ -122,7 +122,7 @@ describe("onLoad", () => {
...
@@ -122,7 +122,7 @@ describe("onLoad", () => {
height
:
2140
,
height
:
2140
,
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
({
expect
(
image
).
to
Save
ImageSnapshot
({
failureThreshold
:
0.05
,
failureThreshold
:
0.05
,
failureThresholdType
:
"
percent
"
,
failureThresholdType
:
"
percent
"
,
});
});
...
...
pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js
浏览文件 @
cb7f78de
...
@@ -19,14 +19,14 @@ describe('setNavigationBarColor', () => {
...
@@ -19,14 +19,14 @@ describe('setNavigationBarColor', () => {
it
(
"
setNavigationBarColor1
"
,
async
()
=>
{
it
(
"
setNavigationBarColor1
"
,
async
()
=>
{
await
page
.
callMethod
(
"
setNavigationBarColor1
"
);
await
page
.
callMethod
(
"
setNavigationBarColor1
"
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
});
});
it
(
"
setNavigationBarColor2
"
,
async
()
=>
{
it
(
"
setNavigationBarColor2
"
,
async
()
=>
{
await
page
.
callMethod
(
"
setNavigationBarColor2
"
);
await
page
.
callMethod
(
"
setNavigationBarColor2
"
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
4
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
4
);
});
});
...
...
pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js
浏览文件 @
cb7f78de
...
@@ -19,13 +19,13 @@ describe("setNavigationBarColor", () => {
...
@@ -19,13 +19,13 @@ describe("setNavigationBarColor", () => {
it
(
"
setNavigationBarNewTitle
"
,
async
()
=>
{
it
(
"
setNavigationBarNewTitle
"
,
async
()
=>
{
await
page
.
callMethod
(
"
setNavigationBarNewTitle
"
);
await
page
.
callMethod
(
"
setNavigationBarNewTitle
"
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
});
});
it
(
"
setNavigationBarLongTitle
"
,
async
()
=>
{
it
(
"
setNavigationBarLongTitle
"
,
async
()
=>
{
await
page
.
callMethod
(
"
setNavigationBarLongTitle
"
);
await
page
.
callMethod
(
"
setNavigationBarLongTitle
"
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/API/toast/toast.test.js
浏览文件 @
cb7f78de
...
@@ -31,13 +31,13 @@ describe('API-toast', () => {
...
@@ -31,13 +31,13 @@ describe('API-toast', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -62,13 +62,13 @@ describe('API-toast', () => {
...
@@ -62,13 +62,13 @@ describe('API-toast', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -91,13 +91,13 @@ describe('API-toast', () => {
...
@@ -91,13 +91,13 @@ describe('API-toast', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -118,13 +118,13 @@ describe('API-toast', () => {
...
@@ -118,13 +118,13 @@ describe('API-toast', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -151,13 +151,13 @@ describe('API-toast', () => {
...
@@ -151,13 +151,13 @@ describe('API-toast', () => {
width
:
windowWidth
width
:
windowWidth
},
},
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
else
{
}
else
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
}
}
})
})
...
@@ -178,13 +178,13 @@ describe('API-toast', () => {
...
@@ -178,13 +178,13 @@ describe('API-toast', () => {
// width:windowWidth
// width:windowWidth
// },
// },
// });
// });
// expect(image).to
Match
ImageSnapshot();
// expect(image).to
Save
ImageSnapshot();
// }else{
// }else{
// const image = await program.screenshot({
// const image = await program.screenshot({
// deviceShot: true,
// deviceShot: true,
// fullPage: true
// fullPage: true
// });
// });
// expect(image).to
Match
ImageSnapshot()
// expect(image).to
Save
ImageSnapshot()
// }
// }
// })
// })
...
...
pages/CSS/overflow/overflow.test.js
浏览文件 @
cb7f78de
...
@@ -20,6 +20,6 @@ describe('component-native-overflow', () => {
...
@@ -20,6 +20,6 @@ describe('component-native-overflow', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
,
fullPage
:
true
,
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/CSS/text/font-family.test.js
浏览文件 @
cb7f78de
...
@@ -11,6 +11,6 @@ describe('css-font-family', () => {
...
@@ -11,6 +11,6 @@ describe('css-font-family', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
});
});
});
});
pages/CSS/text/font-size.test.js
浏览文件 @
cb7f78de
...
@@ -8,6 +8,6 @@ describe('css-font-size', () => {
...
@@ -8,6 +8,6 @@ describe('css-font-size', () => {
await
page
.
callMethod
(
"
setFontSize
"
);
await
page
.
callMethod
(
"
setFontSize
"
);
await
page
.
waitFor
(
100
);
await
page
.
waitFor
(
100
);
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
const
image
=
await
program
.
screenshot
({
fullPage
:
true
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/CSS/variable/variable.test.js
浏览文件 @
cb7f78de
...
@@ -9,6 +9,6 @@ describe('css-variable', () => {
...
@@ -9,6 +9,6 @@ describe('css-variable', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
});
});
});
});
pages/component/general-attribute/general-attribute.test.js
浏览文件 @
cb7f78de
...
@@ -9,7 +9,7 @@ describe('general attribute', () => {
...
@@ -9,7 +9,7 @@ describe('general attribute', () => {
})
})
it
(
"
class & style
"
,
async
()
=>
{
it
(
"
class & style
"
,
async
()
=>
{
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
it
(
'
validateGeneralAttributes
'
,
async
()
=>
{
it
(
'
validateGeneralAttributes
'
,
async
()
=>
{
const
button
=
await
page
.
$
(
"
.btn-style
"
);
const
button
=
await
page
.
$
(
"
.btn-style
"
);
...
@@ -22,6 +22,6 @@ describe('general attribute', () => {
...
@@ -22,6 +22,6 @@ describe('general attribute', () => {
await
button
.
tap
();
await
button
.
tap
();
await
page
.
waitFor
(
500
);
await
page
.
waitFor
(
500
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
})
})
pages/component/image/image.test.js
浏览文件 @
cb7f78de
...
@@ -55,7 +55,7 @@ describe('component-native-image', () => {
...
@@ -55,7 +55,7 @@ describe('component-native-image', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
});
});
it
(
'
mode-screenshot
'
,
async
()
=>
{
it
(
'
mode-screenshot
'
,
async
()
=>
{
...
@@ -65,6 +65,6 @@ describe('component-native-image', () => {
...
@@ -65,6 +65,6 @@ describe('component-native-image', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
});
});
});
});
pages/component/input/input.test.js
浏览文件 @
cb7f78de
...
@@ -12,7 +12,7 @@ describe('component-native-input', () => {
...
@@ -12,7 +12,7 @@ describe('component-native-input', () => {
// const image = await program.screenshot({
// const image = await program.screenshot({
// fullPage: true
// fullPage: true
// })
// })
// expect(image).to
Match
ImageSnapshot()
// expect(image).to
Save
ImageSnapshot()
// })
// })
// 测试焦点及键盘弹起
// 测试焦点及键盘弹起
it
(
'
focus
'
,
async
()
=>
{
it
(
'
focus
'
,
async
()
=>
{
...
@@ -176,6 +176,6 @@ describe('component-native-input', () => {
...
@@ -176,6 +176,6 @@ describe('component-native-input', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
})
})
});
});
pages/component/list-view/list-view-multiplex.test.js
浏览文件 @
cb7f78de
describe
(
'
component-native-list-view
'
,
()
=>
{
describe
(
'
component-native-list-view
'
,
()
=>
{
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
//打开list-view-multiplex测试页
//打开list-view-multiplex测试页
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-multiplex
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-multiplex
'
)
await
page
.
waitFor
(
'
list-view
'
)
await
page
.
waitFor
(
'
list-view
'
)
})
})
//滚动list-view到底部 加载更多 如果异常则直接闪退
//滚动list-view到底部 加载更多 如果异常则直接闪退
it
(
'
check_list_item_multiplex
'
,
async
()
=>
{
it
(
'
check_list_item_multiplex
'
,
async
()
=>
{
await
page
.
callMethod
(
'
listViewScrollByY
'
,
5000
)
await
page
.
callMethod
(
'
listViewScrollByY
'
,
5000
)
await
page
.
waitFor
(
400
)
await
page
.
waitFor
(
400
)
await
page
.
callMethod
(
'
listViewScrollByY
'
,
100
)
await
page
.
callMethod
(
'
listViewScrollByY
'
,
100
)
})
})
//检测延迟显示listv-view后list-item是否正常显示
//检测延迟显示listv-view后list-item是否正常显示
...
@@ -21,7 +21,7 @@ describe('component-native-list-view', () => {
...
@@ -21,7 +21,7 @@ describe('component-native-list-view', () => {
});
});
await
page
.
waitFor
(
200
)
await
page
.
waitFor
(
200
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
//检测修改item子元素后,item是否正常调整高度
//检测修改item子元素后,item是否正常调整高度
...
@@ -32,6 +32,6 @@ describe('component-native-list-view', () => {
...
@@ -32,6 +32,6 @@ describe('component-native-list-view', () => {
});
});
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/list-view/list-view-refresh.test.js
浏览文件 @
cb7f78de
describe
(
'
component-native-list-view-refresh
'
,
()
=>
{
describe
(
'
component-native-list-view-refresh
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
it
(
'
dummyTest
'
,
async
()
=>
{
it
(
'
dummyTest
'
,
async
()
=>
{
expect
(
1
).
toBe
(
1
)
expect
(
1
).
toBe
(
1
)
})
})
return
return
}
}
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
//打开list-view测试页
//打开list-view测试页
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-refresh
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/list-view/list-view-refresh
'
)
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
})
})
it
(
'
check_list_view_refresh
'
,
async
()
=>
{
it
(
'
check_list_view_refresh
'
,
async
()
=>
{
...
@@ -19,6 +19,6 @@ describe('component-native-list-view-refresh', () => {
...
@@ -19,6 +19,6 @@ describe('component-native-list-view-refresh', () => {
//等待下拉刷新结束
//等待下拉刷新结束
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/nested-scroll-body/nested-scroll-body.test.js
浏览文件 @
cb7f78de
describe
(
'
component-native-nested-scroll-body
'
,
()
=>
{
describe
(
'
component-native-nested-scroll-body
'
,
()
=>
{
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
||
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
||
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
==
'
true
'
)
{
it
(
'
dummyTest
'
,
()
=>
{
it
(
'
dummyTest
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
expect
(
1
).
toBe
(
1
)
})
})
return
return
}
}
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
//打开lnested-scroll-body测试页
//打开lnested-scroll-body测试页
page
=
await
program
.
reLaunch
(
'
/pages/component/nested-scroll-body/nested-scroll-body
'
)
page
=
await
program
.
reLaunch
(
'
/pages/component/nested-scroll-body/nested-scroll-body
'
)
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
})
})
//检测横向scroll_into_view属性赋值
//检测横向scroll_into_view属性赋值
...
@@ -18,6 +18,6 @@ describe('component-native-nested-scroll-body', () => {
...
@@ -18,6 +18,6 @@ describe('component-native-nested-scroll-body', () => {
await
page
.
callMethod
(
'
testBodyScrollBy
'
,
400
)
await
page
.
callMethod
(
'
testBodyScrollBy
'
,
400
)
await
page
.
waitFor
(
300
)
await
page
.
waitFor
(
300
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/nested-scroll-header/nested-scroll-header.test.js
浏览文件 @
cb7f78de
...
@@ -16,6 +16,6 @@ describe('component-native-nested-scroll-header', () => {
...
@@ -16,6 +16,6 @@ describe('component-native-nested-scroll-header', () => {
it
(
'
check_nested-scroll-header
'
,
async
()
=>
{
it
(
'
check_nested-scroll-header
'
,
async
()
=>
{
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/scroll-view/scroll-view-props.test.js
浏览文件 @
cb7f78de
...
@@ -90,7 +90,7 @@ describe('component-native-scroll-view-props', () => {
...
@@ -90,7 +90,7 @@ describe('component-native-scroll-view-props', () => {
})
})
await
page
.
waitFor
(
300
);
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
});
});
pages/component/scroll-view/scroll-view-refresher.test.js
浏览文件 @
cb7f78de
...
@@ -15,7 +15,7 @@ describe('component-native-scroll-view-refresher', () => {
...
@@ -15,7 +15,7 @@ describe('component-native-scroll-view-refresher', () => {
})
})
await
page
.
waitFor
(
300
);
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
it
(
'
check_refresher
'
,
async
()
=>
{
it
(
'
check_refresher
'
,
async
()
=>
{
...
...
pages/component/scroll-view/scroll-view.test.js
浏览文件 @
cb7f78de
describe
(
'
component-native-scroll-view
'
,
()
=>
{
describe
(
'
component-native-scroll-view
'
,
()
=>
{
let
page
;
let
page
;
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view
'
);
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view
'
);
...
@@ -13,6 +13,6 @@ describe('component-native-scroll-view', () => {
...
@@ -13,6 +13,6 @@ describe('component-native-scroll-view', () => {
})
})
await
page
.
waitFor
(
300
);
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
});
});
});
});
pages/component/sticky-header/sticky-header.test.js
浏览文件 @
cb7f78de
...
@@ -9,6 +9,6 @@ describe('component-native-sticky-header', () => {
...
@@ -9,6 +9,6 @@ describe('component-native-sticky-header', () => {
it
(
'
check_sticky_header
'
,
async
()
=>
{
it
(
'
check_sticky_header
'
,
async
()
=>
{
await
page
.
callMethod
(
'
confirm_scroll_top_input
'
,
600
)
await
page
.
callMethod
(
'
confirm_scroll_top_input
'
,
600
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/sticky-section/sticky-section.test.js
浏览文件 @
cb7f78de
...
@@ -9,7 +9,7 @@ describe('component-native-sticky-section', () => {
...
@@ -9,7 +9,7 @@ describe('component-native-sticky-section', () => {
it
(
'
check_sticky_section
'
,
async
()
=>
{
it
(
'
check_sticky_section
'
,
async
()
=>
{
await
page
.
callMethod
(
'
listViewScrollByY
'
,
1000
)
await
page
.
callMethod
(
'
listViewScrollByY
'
,
1000
)
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
it
(
'
check_goto_sticky_header
'
,
async
()
=>
{
it
(
'
check_goto_sticky_header
'
,
async
()
=>
{
...
@@ -27,6 +27,6 @@ describe('component-native-sticky-section', () => {
...
@@ -27,6 +27,6 @@ describe('component-native-sticky-section', () => {
return
await
page
.
data
(
'
scrolling
'
)
===
false
;
return
await
page
.
data
(
'
scrolling
'
)
===
false
;
});
});
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
})
})
})
})
pages/component/text/text-props.test.js
浏览文件 @
cb7f78de
...
@@ -9,7 +9,7 @@ describe('text-props', () => {
...
@@ -9,7 +9,7 @@ describe('text-props', () => {
it
(
'
screenshot
'
,
async
()
=>
{
it
(
'
screenshot
'
,
async
()
=>
{
const
image
=
await
program
.
screenshot
({
fullPage
:
true
})
const
image
=
await
program
.
screenshot
({
fullPage
:
true
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
})
})
it
(
'
empty text
'
,
async
()
=>
{
it
(
'
empty text
'
,
async
()
=>
{
...
...
pages/component/web-view-local/web-view-local.test.js
浏览文件 @
cb7f78de
...
@@ -19,7 +19,7 @@ describe('component-native-web-view', () => {
...
@@ -19,7 +19,7 @@ describe('component-native-web-view', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
}
});
});
});
});
\ No newline at end of file
pages/pages.test.js
浏览文件 @
cb7f78de
...
@@ -169,10 +169,10 @@ describe("page screenshot test", () => {
...
@@ -169,10 +169,10 @@ describe("page screenshot test", () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
fullPage
fullPage
:
fullPage
});
});
expect
(
image
).
to
MatchImageSnapshot
({
expect
(
image
).
to
SaveImageSnapshot
({
customSnapshotIdentifier
()
{
customSnapshotIdentifier
()
{
return
`__pages_test__/
${
pages
[
pageIndex
].
replace
(
/
\/
/g
,
"
-
"
).
substring
(
1
)}
`
return
`__pages_test__/
${
pages
[
pageIndex
].
replace
(
/
\/
/g
,
"
-
"
).
substring
(
1
)}
`
}
}
})
})
await
page
.
waitFor
(
500
);
await
page
.
waitFor
(
500
);
});
});
...
...
pages/template/list-news/list-news.test.js
浏览文件 @
cb7f78de
...
@@ -11,6 +11,6 @@ describe('template-list-news', () => {
...
@@ -11,6 +11,6 @@ describe('template-list-news', () => {
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
fullPage
:
true
fullPage
:
true
})
})
expect
(
image
).
to
Match
ImageSnapshot
()
expect
(
image
).
to
Save
ImageSnapshot
()
});
});
});
});
pages/template/navbar-lite/navbar-lite.test.js
浏览文件 @
cb7f78de
...
@@ -40,7 +40,7 @@ describe("setCustomNavigationBarColor", () => {
...
@@ -40,7 +40,7 @@ describe("setCustomNavigationBarColor", () => {
deviceShot
:
true
,
deviceShot
:
true
,
area
:
adbScreenShotArea
,
area
:
adbScreenShotArea
,
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
}
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
2
);
...
@@ -54,7 +54,7 @@ describe("setCustomNavigationBarColor", () => {
...
@@ -54,7 +54,7 @@ describe("setCustomNavigationBarColor", () => {
deviceShot
:
true
,
deviceShot
:
true
,
area
:
adbScreenShotArea
,
area
:
adbScreenShotArea
,
});
});
expect
(
image
).
to
Match
ImageSnapshot
();
expect
(
image
).
to
Save
ImageSnapshot
();
}
}
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
const
lifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
4
);
expect
(
lifeCycleNum
-
originLifeCycleNum
).
toBe
(
4
);
...
...
pages/webview-screenshot/webview-screenshot.test.js
浏览文件 @
cb7f78de
...
@@ -328,7 +328,7 @@ describe("shot-compare", () => {
...
@@ -328,7 +328,7 @@ describe("shot-compare", () => {
...
screenshotParams
,
...
screenshotParams
,
offsetY
:
`
${
isCustomNavigation
?
0
:
headerHeight
}
`
offsetY
:
`
${
isCustomNavigation
?
0
:
headerHeight
}
`
});
});
expect
(
webSnapshot
).
to
Match
ImageSnapshot
({
expect
(
webSnapshot
).
to
Save
ImageSnapshot
({
customSnapshotIdentifier
()
{
customSnapshotIdentifier
()
{
return
screenshotPath
;
return
screenshotPath
;
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录