Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
6656ee24
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6018
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6656ee24
编写于
8月 14, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(picker-view.test.js): 调整测试截图名称
上级
7c08d86c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
pages/component/picker-view/picker-view.test.js
pages/component/picker-view/picker-view.test.js
+13
-13
未找到文件。
pages/component/picker-view/picker-view.test.js
浏览文件 @
6656ee24
...
@@ -8,11 +8,11 @@ describe('PickerView.uvue', () => {
...
@@ -8,11 +8,11 @@ describe('PickerView.uvue', () => {
await
page
.
callMethod
(
'
setEventCallbackNum
'
,
0
)
await
page
.
callMethod
(
'
setEventCallbackNum
'
,
0
)
pickerViewEl
=
await
page
.
$
(
'
.picker-view
'
)
pickerViewEl
=
await
page
.
$
(
'
.picker-view
'
)
})
})
afterEach
(
async
()
=>
{
afterEach
(
async
()
=>
{
await
page
.
callMethod
(
'
setEventCallbackNum
'
,
0
)
await
page
.
callMethod
(
'
setEventCallbackNum
'
,
0
)
})
})
async
function
toScreenshot
(
imgName
)
{
async
function
toScreenshot
(
imgName
)
{
const
image
=
await
program
.
screenshot
();
const
image
=
await
program
.
screenshot
();
expect
(
image
).
toSaveImageSnapshot
({
customSnapshotIdentifier
()
{
expect
(
image
).
toSaveImageSnapshot
({
customSnapshotIdentifier
()
{
...
@@ -20,7 +20,7 @@ describe('PickerView.uvue', () => {
...
@@ -20,7 +20,7 @@ describe('PickerView.uvue', () => {
}})
}})
await
page
.
waitFor
(
500
);
await
page
.
waitFor
(
500
);
}
}
it
(
'
value
'
,
async
()
=>
{
it
(
'
value
'
,
async
()
=>
{
await
page
.
callMethod
(
'
setValue
'
)
await
page
.
callMethod
(
'
setValue
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
1000
)
...
@@ -46,7 +46,7 @@ describe('PickerView.uvue', () => {
...
@@ -46,7 +46,7 @@ describe('PickerView.uvue', () => {
const
els1
=
await
page
.
$$
(
'
.picker-view-column
'
)
const
els1
=
await
page
.
$$
(
'
.picker-view-column
'
)
expect
(
els1
.
length
).
toBe
(
3
)
expect
(
els1
.
length
).
toBe
(
3
)
})
})
it
(
'
indicator-style
'
,
async
()
=>
{
it
(
'
indicator-style
'
,
async
()
=>
{
// App端动态设置indicatorStyle无效
// App端动态设置indicatorStyle无效
const
indicatorStyle
=
"
height: 50px;border:#ff5500 solid 1px;background:rgba(182, 179, 255, 0.4);
"
const
indicatorStyle
=
"
height: 50px;border:#ff5500 solid 1px;background:rgba(182, 179, 255, 0.4);
"
...
@@ -55,9 +55,9 @@ describe('PickerView.uvue', () => {
...
@@ -55,9 +55,9 @@ describe('PickerView.uvue', () => {
})
})
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
expect
(
await
pickerViewEl
.
attribute
(
'
indicatorStyle
'
)).
toBe
(
indicatorStyle
)
expect
(
await
pickerViewEl
.
attribute
(
'
indicatorStyle
'
)).
toBe
(
indicatorStyle
)
await
toScreenshot
(
'
indicator-style
'
)
await
toScreenshot
(
'
picker-view-
indicator-style
'
)
})
})
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
)){
// indicator-class、mask-style、mask-class 仅web支持
// indicator-class、mask-style、mask-class 仅web支持
it
(
'
indicator-class
'
,
async
()
=>
{
it
(
'
indicator-class
'
,
async
()
=>
{
...
@@ -66,7 +66,7 @@ describe('PickerView.uvue', () => {
...
@@ -66,7 +66,7 @@ describe('PickerView.uvue', () => {
indicatorClass
:
"
indicator-test
"
,
//设置indicatorClass为indicator-test
indicatorClass
:
"
indicator-test
"
,
//设置indicatorClass为indicator-test
})
})
expect
(
await
pickerViewEl
.
attribute
(
'
indicatorClass
'
)).
toBe
(
"
indicator-test
"
)
expect
(
await
pickerViewEl
.
attribute
(
'
indicatorClass
'
)).
toBe
(
"
indicator-test
"
)
await
toScreenshot
(
'
indicator-class
'
)
await
toScreenshot
(
'
picker-view-web-
indicator-class
'
)
await
page
.
setData
({
await
page
.
setData
({
indicatorClass
:
""
,
//清空indicatorClass
indicatorClass
:
""
,
//清空indicatorClass
})
})
...
@@ -75,17 +75,17 @@ describe('PickerView.uvue', () => {
...
@@ -75,17 +75,17 @@ describe('PickerView.uvue', () => {
const
maskStyle
=
"
background-image: linear-gradient(to bottom, #d8e5ff, rgba(216, 229, 255, 0));
"
const
maskStyle
=
"
background-image: linear-gradient(to bottom, #d8e5ff, rgba(216, 229, 255, 0));
"
await
page
.
setData
({
maskStyle
})
await
page
.
setData
({
maskStyle
})
expect
(
await
pickerViewEl
.
attribute
(
'
maskStyle
'
)).
toBe
(
maskStyle
)
expect
(
await
pickerViewEl
.
attribute
(
'
maskStyle
'
)).
toBe
(
maskStyle
)
await
toScreenshot
(
'
mask-style
'
)
await
toScreenshot
(
'
picker-view-web-
mask-style
'
)
})
})
it
(
'
mask-class
'
,
async
()
=>
{
it
(
'
mask-class
'
,
async
()
=>
{
await
page
.
setData
({
maskClass
:
"
mask-test
"
})
await
page
.
setData
({
maskClass
:
"
mask-test
"
})
expect
(
await
pickerViewEl
.
attribute
(
'
maskClass
'
)).
toBe
(
"
mask-test
"
)
expect
(
await
pickerViewEl
.
attribute
(
'
maskClass
'
)).
toBe
(
"
mask-test
"
)
await
toScreenshot
(
'
mask-class
'
)
await
toScreenshot
(
'
picker-view-web-
mask-class
'
)
})
})
return
return
}
}
it
(
'
mask-top-bottom-style
'
,
async
()
=>
{
it
(
'
mask-top-bottom-style
'
,
async
()
=>
{
// App端动态设置mask-top-style、mask-bottom-style无效
// App端动态设置mask-top-style、mask-bottom-style无效
const
linearToTop
=
"
background-image: linear-gradient(to bottom, #f4ff73, rgba(216, 229, 255, 0));
"
const
linearToTop
=
"
background-image: linear-gradient(to bottom, #f4ff73, rgba(216, 229, 255, 0));
"
...
@@ -98,9 +98,9 @@ describe('PickerView.uvue', () => {
...
@@ -98,9 +98,9 @@ describe('PickerView.uvue', () => {
expect
(
await
pickerViewEl
.
attribute
(
'
mask-top-style
'
)).
toBe
(
linearToTop
)
expect
(
await
pickerViewEl
.
attribute
(
'
mask-top-style
'
)).
toBe
(
linearToTop
)
expect
(
await
pickerViewEl
.
attribute
(
'
mask-bottom-style
'
)).
toBe
(
linearToBottom
)
expect
(
await
pickerViewEl
.
attribute
(
'
mask-bottom-style
'
)).
toBe
(
linearToBottom
)
await
page
.
waitFor
(
2000
)
await
page
.
waitFor
(
2000
)
await
toScreenshot
(
'
mask-top-bottom-style
'
)
await
toScreenshot
(
'
picker-view-app-
mask-top-bottom-style
'
)
})
})
it
(
'
reopen-picker-view-page
'
,
async
()
=>
{
it
(
'
reopen-picker-view-page
'
,
async
()
=>
{
page
=
await
program
.
switchTab
(
'
/pages/tabBar/component
'
)
page
=
await
program
.
switchTab
(
'
/pages/tabBar/component
'
)
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
500
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录