Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
52796e55
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看板
提交
52796e55
编写于
3月 30, 2024
作者:
DCloud_iOS_WZT
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/hello-uni-app-x
into dev
上级
b36d493b
61d56089
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
101 addition
and
68 deletion
+101
-68
jest.config.js
jest.config.js
+7
-6
manifest.json
manifest.json
+1
-1
pages/API/action-sheet/action-sheet.test.js
pages/API/action-sheet/action-sheet.test.js
+14
-14
pages/API/modal/modal.test.js
pages/API/modal/modal.test.js
+19
-19
pages/API/pull-down-refresh/pull-down-refresh.uvue
pages/API/pull-down-refresh/pull-down-refresh.uvue
+3
-2
pages/API/toast/toast.test.js
pages/API/toast/toast.test.js
+7
-7
pages/CSS/background/background-image.test.js
pages/CSS/background/background-image.test.js
+21
-0
pages/CSS/background/background-image.uvue
pages/CSS/background/background-image.uvue
+8
-1
pages/component/list-view/list-view.test.js
pages/component/list-view/list-view.test.js
+9
-5
pages/component/sticky-section/sticky-section.test.js
pages/component/sticky-section/sticky-section.test.js
+1
-1
pages/pages.test.js
pages/pages.test.js
+0
-1
pages/template/half-screen/half-screen.uvue
pages/template/half-screen/half-screen.uvue
+2
-2
pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js
...reenshot-comparison/webview-screenshot-comparison.test.js
+4
-4
pages/webview-screenshot/webview-screenshot.test.js
pages/webview-screenshot/webview-screenshot.test.js
+4
-5
testCaseToSnapshotFilePath.json
testCaseToSnapshotFilePath.json
+1
-0
未找到文件。
jest.config.js
浏览文件 @
52796e55
// 自动化测试
// 自动化测试
module
.
exports
=
{
testTimeout
:
30000
,
reporters
:
[
'
default
'
],
...
...
@@ -6,11 +6,12 @@ module.exports = {
moduleFileExtensions
:
[
'
js
'
,
'
json
'
],
rootDir
:
__dirname
,
testMatch
:
[
"
<rootDir>/pages/**/*test.[jt]s?(x)
"
],
testPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
<rootDir>/pages/API/download-file/download-file.test.js
'
,
'
<rootDir>/pages/API/upload-file/upload-file.test.js
'
,
'
<rootDir>/pages/API/get-battery-info/get-battery-info.test.js
'
testPathIgnorePatterns
:
[
'
/node_modules/
'
,
'
<rootDir>/pages/API/download-file/download-file.test.js
'
,
'
<rootDir>/pages/API/upload-file/upload-file.test.js
'
,
'
<rootDir>/pages/API/get-battery-info/get-battery-info.test.js
'
,
'
<rootDir>/pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js
'
],
setupFilesAfterEnv
:
[
'
<rootDir>/jest-setup.js
'
],
}
manifest.json
浏览文件 @
52796e55
{
"name"
:
"
hello-uni
app x"
,
"name"
:
"
Hello uni-
app x"
,
"appid"
:
"__UNI__3584C99"
,
"description"
:
""
,
"versionName"
:
"1.0.23"
,
...
...
pages/API/action-sheet/action-sheet.test.js
浏览文件 @
52796e55
...
...
@@ -3,7 +3,7 @@
describe
(
'
API-loading
'
,
()
=>
{
let
page
;
const
isA
ndroid
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
;
const
isA
pp
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
||
process
.
env
.
UNI_OS_NAME
===
"
ios
"
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/API/action-sheet/action-sheet
'
)
...
...
@@ -12,7 +12,7 @@ describe('API-loading', () => {
it
(
"
onload-action-sheet-test
"
,
async
()
=>
{
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
await
page
.
waitFor
(
500
);
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
...
...
@@ -57,7 +57,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -99,7 +99,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -140,7 +140,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -181,7 +181,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -222,7 +222,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -266,7 +266,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -307,7 +307,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -348,7 +348,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -389,7 +389,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -431,7 +431,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -472,7 +472,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
@@ -513,7 +513,7 @@ describe('API-loading', () => {
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
area
:
{
...
...
pages/API/modal/modal.test.js
浏览文件 @
52796e55
...
...
@@ -3,7 +3,7 @@
describe
(
'
API-loading
'
,
()
=>
{
let
page
;
const
isA
ndroid
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
;
const
isA
pp
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
||
process
.
env
.
UNI_OS_NAME
===
"
ios
"
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/API/modal/modal
'
)
...
...
@@ -13,7 +13,7 @@ describe('API-loading', () => {
it
(
"
onload-modal-test
"
,
async
()
=>
{
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
await
page
.
waitFor
(
500
);
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
...
...
@@ -54,7 +54,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -95,7 +95,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -136,7 +136,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -177,7 +177,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -218,7 +218,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -258,7 +258,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -298,7 +298,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -338,7 +338,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -378,7 +378,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -419,7 +419,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -460,7 +460,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -501,7 +501,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -542,7 +542,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -583,7 +583,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -625,7 +625,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -665,7 +665,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -706,7 +706,7 @@ describe('API-loading', () => {
await
btnModalButton
.
tap
()
await
page
.
waitFor
(
500
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
pages/API/pull-down-refresh/pull-down-refresh.uvue
浏览文件 @
52796e55
...
...
@@ -17,7 +17,8 @@
max: 0
}
},
onLoad() {
onReady() {
uni.startPullDownRefresh();
this.initData();
},
onReachBottom() {
...
...
@@ -47,7 +48,7 @@
}
this.data = this.data.concat(data);
uni.stopPullDownRefresh();
},
3
00);
},
10
00);
},
setListData() {
let data:Array<number> = [];
...
...
pages/API/toast/toast.test.js
浏览文件 @
52796e55
...
...
@@ -3,7 +3,7 @@
describe
(
'
API-toast
'
,
()
=>
{
let
page
;
const
isA
ndroid
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
;
const
isA
pp
=
process
.
env
.
UNI_OS_NAME
===
"
android
"
||
process
.
env
.
UNI_OS_NAME
===
"
ios
"
;
beforeAll
(
async
()
=>
{
...
...
@@ -16,7 +16,7 @@ describe('API-toast', () => {
it
(
"
onload-toast-test
"
,
async
()
=>
{
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
await
page
.
waitFor
(
500
);
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
...
...
@@ -47,7 +47,7 @@ describe('API-toast', () => {
const
btnToastDefaultButton
=
await
page
.
$
(
'
#btn-toast-default
'
)
await
btnToastDefaultButton
.
tap
()
await
page
.
waitFor
(
200
)
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
...
...
@@ -78,7 +78,7 @@ describe('API-toast', () => {
const
btnToastDurationButton
=
await
page
.
$
(
'
#btn-toast-duration
'
)
await
btnToastDurationButton
.
tap
()
await
page
.
waitFor
(
2000
)
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -105,7 +105,7 @@ describe('API-toast', () => {
const
btnToastErrorIconButton
=
await
page
.
$
(
'
#btn-toast-errorIcon
'
)
await
btnToastErrorIconButton
.
tap
()
await
page
.
waitFor
(
200
)
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -138,7 +138,7 @@ describe('API-toast', () => {
await
btnToastHideButton
.
tap
()
await
page
.
waitFor
(
1000
)
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
const
windowHeight
=
res
.
windowHeight
*
res
.
pixelRatio
;
const
windowWidth
=
res
.
windowWidth
*
res
.
pixelRatio
;
...
...
@@ -166,7 +166,7 @@ describe('API-toast', () => {
// const btnToastButton = await page.$('#btn-toast-postion-bottom')
// await btnToastButton.tap()
// await page.waitFor(200)
// if (isA
ndroid
) {
// if (isA
pp
) {
// const windowHeight = uni.getWindowInfo().windowHeight;
// const windowWidth = uni.getWindowInfo().windowWidth;
// const image = await program.screenshot({
...
...
pages/CSS/background/background-image.test.js
0 → 100644
浏览文件 @
52796e55
describe
(
'
background-image-test
'
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/CSS/background/background-image
'
);
await
page
.
waitFor
(
600
);
});
it
(
'
background-image-screenshot
'
,
async
()
=>
{
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toSaveImageSnapshot
();
});
it
(
'
background-image-select
'
,
async
()
=>
{
await
page
.
callMethod
(
'
updateBackgroundSelect
'
)
await
page
.
waitFor
(
300
);
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toSaveImageSnapshot
();
});
});
pages/CSS/background/background-image.uvue
浏览文件 @
52796e55
...
...
@@ -6,7 +6,7 @@
<text>不支持背景图片,仅支持linear-gradient方法</text>
<view v-for="(direction) in directionData">
<text>background-image: linear-gradient({{direction}}, red, yellow)</text>
<view class="common" :style="{'background-image':
'linear-gradient('+direction+', red, yellow)
'}"></view>
<view class="common" :style="{'background-image':
backgroundSelect ?'linear-gradient('+direction+', red, yellow)':'
'}"></view>
</view>
</view>
<!-- #ifdef APP -->
...
...
@@ -18,8 +18,15 @@
export default {
data(){
return {
backgroundSelect : true,
directionData: ['to right', 'to left', 'to bottom', 'to top', 'to bottom left', 'to bottom right', 'to top left', 'to top right']
}
},
methods: {
//供自动化测试使用
updateBackgroundSelect() {
this.backgroundSelect = !this.backgroundSelect
}
}
}
</script>
...
...
pages/component/list-view/list-view.test.js
浏览文件 @
52796e55
...
...
@@ -26,7 +26,7 @@ describe('component-native-list-view', () => {
})
//检测横向scrollLeft属性赋值
//检测横向scrollLeft属性赋值
备注:iOS不支持list-view横向滚动
it
(
'
check_scroll_left
'
,
async
()
=>
{
if
(
await
page
.
data
(
'
scroll_x_boolean
'
)
===
false
)
{
await
page
.
callMethod
(
'
change_scroll_x_boolean
'
,
true
)
...
...
@@ -44,8 +44,12 @@ describe('component-native-list-view', () => {
if
(
process
.
env
.
uniTestPlatformInfo
.
indexOf
(
'
web
'
)
>
-
1
)
{
return
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
IOS_SIMULATOR
'
))
{
return
}
//检测横向可滚动区域
//检测横向可滚动区域
备注:iOS不支持list-view横向滚动
it
(
'
check_scroll_width
'
,
async
()
=>
{
if
(
await
page
.
data
(
'
scroll_x_boolean
'
)
===
false
)
{
await
page
.
callMethod
(
'
change_scroll_x_boolean
'
,
true
)
...
...
@@ -59,7 +63,7 @@ describe('component-native-list-view', () => {
expect
(
value
).
toBe
(
true
)
})
//检测下拉刷新
//检测下拉刷新
备注:iOS本地测试结果正确,但是自动化测试结果错误
it
(
'
check_refresher
'
,
async
()
=>
{
if
(
await
page
.
data
(
'
scroll_y_boolean
'
)
===
false
)
{
await
page
.
callMethod
(
'
change_scroll_y_boolean
'
,
true
)
...
...
@@ -74,7 +78,7 @@ describe('component-native-list-view', () => {
expect
(
await
page
.
data
(
'
refresherrefresh
'
)).
toBe
(
true
)
})
//检测竖向scroll_into_view属性赋值
//检测竖向scroll_into_view属性赋值
备注:iOS本地测试结果正确,但是自动化测试结果错误
it
(
'
check_scroll_into_view_top
'
,
async
()
=>
{
if
(
await
page
.
data
(
'
scroll_y_boolean
'
)
===
false
)
{
await
page
.
callMethod
(
'
change_scroll_y_boolean
'
,
true
)
...
...
@@ -90,7 +94,7 @@ describe('component-native-list-view', () => {
expect
(
scrollTop
-
690
).
toBeGreaterThanOrEqual
(
0
)
})
//检测横向scroll_into_view属性赋值
//检测横向scroll_into_view属性赋值
备注:iOS不支持list-view横向滚动
it
(
'
check_scroll_into_view_left
'
,
async
()
=>
{
if
(
await
page
.
data
(
'
scroll_x_boolean
'
)
===
false
)
{
await
page
.
callMethod
(
'
change_scroll_x_boolean
'
,
true
)
...
...
pages/component/sticky-section/sticky-section.test.js
浏览文件 @
52796e55
...
...
@@ -23,7 +23,7 @@ describe('component-native-sticky-section', () => {
await
page
.
setData
({
scrolling
:
'
true
'
})
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
//跳转到id为C的StickyHeader位置
await
page
.
callMethod
(
'
gotoStickyHeader
'
,
'
C
'
)
}
...
...
pages/pages.test.js
浏览文件 @
52796e55
...
...
@@ -38,7 +38,6 @@ const pages = [
// CSS
'
/pages/CSS/background/background-color
'
,
'
/pages/CSS/background/background-image
'
,
'
/pages/CSS/border/complex-border/complex-border
'
,
'
/pages/CSS/border/border-bottom
'
,
'
/pages/CSS/border/border-color
'
,
...
...
pages/template/half-screen/half-screen.uvue
浏览文件 @
52796e55
...
...
@@ -134,7 +134,7 @@
this.halfNode?.style?.setProperty('transition-duration', 0);
this.halfNode?.style?.setProperty('transform', '');
}
this.halfNode?.style?.setProperty('transition-property', '');
this.halfNode?.style?.setProperty('transition-property', '
none
');
this.bAnimation = false;
}, time)
this.bAnimation = true;
...
...
@@ -157,7 +157,7 @@
this.halfOffset = 0;
setTimeout(() => {
this.bAnimation = false;
this.halfNode?.style?.setProperty('transition-property', '');
this.halfNode?.style?.setProperty('transition-property', '
none
');
}, time)
this.bAnimation = true;
}
...
...
pages/webview-screenshot-comparison/webview-screenshot-comparison.test.js
浏览文件 @
52796e55
...
...
@@ -237,13 +237,13 @@ const PAGE_PATH =
describe
(
"
shot-compare
"
,
()
=>
{
let
shouldCompareScreenShot
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
const
uniTestPlatformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
if
(
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
version
=
parseInt
(
uniTestPlatformInfo
.
split
(
"
"
)[
1
])
shouldCompareScreenShot
=
version
>
9
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
IOS
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
if
(
uniTestPlatformInfo
.
startsWith
(
'
ios
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
shouldCompareScreenShot
=
true
}
...
...
pages/webview-screenshot/webview-screenshot.test.js
浏览文件 @
52796e55
...
...
@@ -235,13 +235,13 @@ const PAGE_PATH =
describe
(
"
shot-compare
"
,
()
=>
{
let
shouldCompareScreenShot
=
false
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
let
version
=
process
.
env
.
uniTestPlatformInfo
version
=
parseInt
(
version
.
split
(
"
"
)[
1
])
const
uniTestPlatformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
if
(
uniTestPlatformInfo
.
startsWith
(
'
android
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
version
=
parseInt
(
uniTestPlatformInfo
.
split
(
"
"
)[
1
])
shouldCompareScreenShot
=
version
>
9
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
IOS
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
if
(
uniTestPlatformInfo
.
startsWith
(
'
ios
'
)
&&
!
process
.
env
.
UNI_AUTOMATOR_APP_WEBVIEW
)
{
shouldCompareScreenShot
=
true
}
...
...
@@ -275,7 +275,6 @@ describe("shot-compare", () => {
});
beforeEach
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
);
await
page
.
waitFor
(
500
);
});
afterEach
(()
=>
{
...
...
testCaseToSnapshotFilePath.json
0 → 100644
浏览文件 @
52796e55
{}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录