Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
616d566b
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6372
Star
108
Fork
184
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
24
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
24
Issue
24
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
616d566b
编写于
4月 12, 2025
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 优化截图测试位置
上级
b523a15e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
16 deletion
+33
-16
pages/API/dialog-page/dialog-page.test.js
pages/API/dialog-page/dialog-page.test.js
+4
-3
pages/template/navbar-lite/navbar-lite.test.js
pages/template/navbar-lite/navbar-lite.test.js
+29
-13
未找到文件。
pages/API/dialog-page/dialog-page.test.js
浏览文件 @
616d566b
...
@@ -6,6 +6,7 @@ const isAndroid = platformInfo.startsWith('android')
...
@@ -6,6 +6,7 @@ const isAndroid = platformInfo.startsWith('android')
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
isMP
=
platformInfo
.
startsWith
(
'
mp
'
)
const
isHarmony
=
platformInfo
.
startsWith
(
'
harmony
'
)
const
isHarmony
=
platformInfo
.
startsWith
(
'
harmony
'
)
const
isApp
=
isAndroid
||
isIos
||
isHarmony
const
FIRST_PAGE_PATH
=
'
/pages/API/dialog-page/dialog-page
'
const
FIRST_PAGE_PATH
=
'
/pages/API/dialog-page/dialog-page
'
const
NEXT_PAGE_PATH
=
'
/pages/API/dialog-page/next-page
'
const
NEXT_PAGE_PATH
=
'
/pages/API/dialog-page/next-page
'
...
@@ -469,7 +470,7 @@ describe('dialog page', () => {
...
@@ -469,7 +470,7 @@ describe('dialog page', () => {
})
})
if
(
isA
ndroid
||
isIos
||
isHarmony
)
{
if
(
isA
pp
)
{
it
(
'
after closeDialogPage reset statusBar color
'
,
async
()
=>
{
it
(
'
after closeDialogPage reset statusBar color
'
,
async
()
=>
{
const
screenShotArea
=
{
const
screenShotArea
=
{
x
:
342
,
x
:
342
,
...
@@ -482,11 +483,11 @@ describe('dialog page', () => {
...
@@ -482,11 +483,11 @@ describe('dialog page', () => {
screenShotArea
.
y
=
20
screenShotArea
.
y
=
20
screenShotArea
.
width
=
40
screenShotArea
.
width
=
40
screenShotArea
.
height
=
20
screenShotArea
.
height
=
20
}
else
if
(
p
rocess
.
env
.
uniTestP
latformInfo
.
startsWith
(
'
android 6
'
))
{
}
else
if
(
platformInfo
.
startsWith
(
'
android 6
'
))
{
screenShotArea
.
x
=
204
screenShotArea
.
x
=
204
screenShotArea
.
width
=
34
screenShotArea
.
width
=
34
screenShotArea
.
height
=
16
screenShotArea
.
height
=
16
}
else
if
(
p
rocess
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android 12
'
))
{
}
else
if
(
p
latformInfo
.
startsWith
(
'
android 12
'
))
{
screenShotArea
.
x
=
336
screenShotArea
.
x
=
336
screenShotArea
.
y
=
3
screenShotArea
.
y
=
3
screenShotArea
.
width
=
50
screenShotArea
.
width
=
50
...
...
pages/template/navbar-lite/navbar-lite.test.js
浏览文件 @
616d566b
const
CURRENT_PAGE_PATH
=
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
"
/pages/template/navbar-lite/navbar-lite
"
;
const
isAndroid
=
platformInfo
.
startsWith
(
'
android
'
)
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
const
isHarmony
=
platformInfo
.
startsWith
(
'
harmony
'
)
const
isApp
=
isAndroid
||
isIos
||
isHarmony
const
CURRENT_PAGE_PATH
=
"
/pages/template/navbar-lite/navbar-lite
"
;
describe
(
"
setCustomNavigationBarColor
"
,
()
=>
{
describe
(
"
setCustomNavigationBarColor
"
,
()
=>
{
let
page
;
let
page
;
...
@@ -11,18 +16,29 @@ describe("setCustomNavigationBarColor", () => {
...
@@ -11,18 +16,29 @@ describe("setCustomNavigationBarColor", () => {
width
:
40
,
width
:
40
,
height
:
20
height
:
20
};
};
if
(
isIos
)
{
screenShotArea
.
x
=
310
screenShotArea
.
y
=
20
screenShotArea
.
width
=
40
screenShotArea
.
height
=
20
}
else
if
(
platformInfo
.
startsWith
(
'
android 6
'
))
{
screenShotArea
.
x
=
204
screenShotArea
.
width
=
34
screenShotArea
.
height
=
16
}
else
if
(
platformInfo
.
startsWith
(
'
android 12
'
))
{
screenShotArea
.
x
=
336
screenShotArea
.
y
=
3
screenShotArea
.
width
=
50
screenShotArea
.
height
=
20
}
else
if
(
isHarmony
)
{
screenShotArea
.
x
=
295
screenShotArea
.
y
=
14
screenShotArea
.
width
=
40
screenShotArea
.
height
=
20
}
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
CURRENT_PAGE_PATH
);
page
=
await
program
.
navigateTo
(
CURRENT_PAGE_PATH
);
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android 6
'
))
{
await
page
.
waitFor
(
'
view
'
);
screenShotArea
.
x
=
204
screenShotArea
.
width
=
34
screenShotArea
.
height
=
16
}
else
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android 12
'
))
{
screenShotArea
.
x
=
442
screenShotArea
.
width
=
27
screenShotArea
.
height
=
24
}
await
page
.
waitFor
(
1000
);
originLifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
originLifeCycleNum
=
await
page
.
callMethod
(
"
getLifeCycleNum
"
);
});
});
...
@@ -35,7 +51,7 @@ describe("setCustomNavigationBarColor", () => {
...
@@ -35,7 +51,7 @@ describe("setCustomNavigationBarColor", () => {
it
(
"
setNavigationBarColor2
"
,
async
()
=>
{
it
(
"
setNavigationBarColor2
"
,
async
()
=>
{
await
page
.
callMethod
(
"
setNavigationBarColor2
"
);
await
page
.
callMethod
(
"
setNavigationBarColor2
"
);
await
page
.
waitFor
(
1000
);
await
page
.
waitFor
(
1000
);
if
(
isA
ndroid
)
{
if
(
isA
pp
)
{
const
image
=
await
program
.
screenshot
({
const
image
=
await
program
.
screenshot
({
deviceShot
:
true
,
deviceShot
:
true
,
area
:
screenShotArea
,
area
:
screenShotArea
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录