Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
14cd48c9
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看板
提交
14cd48c9
编写于
1月 03, 2024
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 调整部分测试例及实现适配web端
上级
02ba4efa
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
186 addition
and
186 deletion
+186
-186
pages/CSS/transition/transition.uvue
pages/CSS/transition/transition.uvue
+19
-19
pages/component/checkbox/checkbox.test.js
pages/component/checkbox/checkbox.test.js
+67
-67
pages/component/input/input.test.js
pages/component/input/input.test.js
+1
-1
pages/component/picker-view/picker-view.test.js
pages/component/picker-view/picker-view.test.js
+2
-2
pages/component/progress/progress.test.js
pages/component/progress/progress.test.js
+17
-17
pages/component/radio/radio.test.js
pages/component/radio/radio.test.js
+65
-65
pages/component/scroll-view/scroll-view-props.test.js
pages/component/scroll-view/scroll-view-props.test.js
+6
-6
pages/component/slider-100/slider-100.test.js
pages/component/slider-100/slider-100.test.js
+2
-2
pages/component/slider/slider.test.js
pages/component/slider/slider.test.js
+4
-4
pages/component/switch/switch.test.js
pages/component/switch/switch.test.js
+3
-3
未找到文件。
pages/CSS/transition/transition.uvue
浏览文件 @
14cd48c9
...
@@ -86,29 +86,29 @@
...
@@ -86,29 +86,29 @@
methods: {
methods: {
changeWidthOrHeight() {
changeWidthOrHeight() {
this.widthOrHeight?.style?.setProperty("width", this.isTranstionWidthOrHeight
this.widthOrHeight?.style?.setProperty("width", this.isTranstionWidthOrHeight
? '
400rpx
'
? '
60%
'
: '
600rpx
')
: '
100%
')
this.isTranstionWidthOrHeight = !this.isTranstionWidthOrHeight
this.isTranstionWidthOrHeight = !this.isTranstionWidthOrHeight
},
},
changeMargin() {
changeMargin() {
this.styleMargin?.style?.setProperty("margin-top", this.isTranstionChangeMargin
this.styleMargin?.style?.setProperty("margin-top", this.isTranstionChangeMargin
? '0
r
px'
? '0px'
: '
100r
px'
: '
50
px'
)
)
this.styleMargin?.style?.setProperty("margin-left", this.isTranstionChangeMargin
this.styleMargin?.style?.setProperty("margin-left", this.isTranstionChangeMargin
? '0
r
px'
? '0px'
: '
100r
px'
: '
50
px'
)
)
this.isTranstionChangeMargin = !this.isTranstionChangeMargin
this.isTranstionChangeMargin = !this.isTranstionChangeMargin
},
},
changePadding() {
changePadding() {
this.stylePadding?.style?.setProperty("padding-top", this.isTransitionStylePadding
this.stylePadding?.style?.setProperty("padding-top", this.isTransitionStylePadding
? '0
r
px'
? '0px'
: '
100r
px')
: '
50
px')
this.stylePadding?.style?.setProperty("padding-left", this.isTransitionStylePadding
this.stylePadding?.style?.setProperty("padding-left", this.isTransitionStylePadding
? '0
r
px'
? '0px'
: '
100r
px')
: '
50
px')
this.isTransitionStylePadding = !this.isTransitionStylePadding
this.isTransitionStylePadding = !this.isTransitionStylePadding
},
},
changeBackground() {
changeBackground() {
...
@@ -157,8 +157,8 @@
...
@@ -157,8 +157,8 @@
},
},
changestylePosition() {
changestylePosition() {
this.stylePosition?.style?.setProperty("left", this.isTransitionstylePosition
this.stylePosition?.style?.setProperty("left", this.isTransitionstylePosition
? '0
r
px'
? '0px'
: '1
50r
px'
: '1
00
px'
)
)
this.isTransitionstylePosition = !this.isTransitionstylePosition
this.isTransitionstylePosition = !this.isTransitionstylePosition
},
},
...
@@ -185,27 +185,27 @@
...
@@ -185,27 +185,27 @@
.transition-width {
.transition-width {
transition-property: width;
transition-property: width;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-margin {
.transition-margin {
transition-property: margin-left, margin-top;
transition-property: margin-left, margin-top;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-padding {
.transition-padding {
transition-property: padding-left, padding-top;
transition-property: padding-left, padding-top;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-background {
.transition-background {
transition-property: background-color, opacity;
transition-property: background-color, opacity;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-transform {
.transition-transform {
transition-property: transform;
transition-property: transform;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-border {
.transition-border {
...
@@ -213,11 +213,11 @@
...
@@ -213,11 +213,11 @@
border-color: brown;
border-color: brown;
border-style: solid;
border-style: solid;
transition-property: border-color;
transition-property: border-color;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
.transition-position {
.transition-position {
transition-property: left;
transition-property: left;
transition-duration: 1000;
transition-duration: 1000
ms
;
}
}
</style>
</style>
pages/component/checkbox/checkbox.test.js
浏览文件 @
14cd48c9
...
@@ -42,11 +42,11 @@ describe('Checkbox.uvue', () => {
...
@@ -42,11 +42,11 @@ describe('Checkbox.uvue', () => {
})
})
it
(
'
checked
'
,
async
()
=>
{
it
(
'
checked
'
,
async
()
=>
{
const
cb
=
await
page
.
$
(
'
.cb
'
)
const
cb
=
await
page
.
$
(
'
.cb
'
)
expect
(
await
cb
.
attribute
(
'
checked
'
)).
toBe
(
true
)
expect
(
await
cb
.
property
(
'
checked
'
)).
toBe
(
true
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
false
,
checked
:
false
,
})
})
expect
(
await
cb
.
attribute
(
'
checked
'
)).
toBe
(
false
)
expect
(
await
cb
.
property
(
'
checked
'
)).
toBe
(
false
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
cb
=
await
page
.
$
(
'
.cb
'
)
const
cb
=
await
page
.
$
(
'
.cb
'
)
...
@@ -58,10 +58,10 @@ describe('Checkbox.uvue', () => {
...
@@ -58,10 +58,10 @@ describe('Checkbox.uvue', () => {
})
})
it
(
'
disabled
'
,
async
()
=>
{
it
(
'
disabled
'
,
async
()
=>
{
const
cb
=
await
page
.
$
(
'
.cb2
'
)
const
cb
=
await
page
.
$
(
'
.cb2
'
)
expect
(
await
cb
.
attribute
(
'
disabled
'
)).
toBe
(
true
)
expect
(
await
cb
.
attribute
(
'
disabled
'
)).
toBe
(
true
+
''
)
await
page
.
setData
({
await
page
.
setData
({
disabled
:
false
,
disabled
:
false
,
})
})
expect
(
await
cb
.
attribute
(
'
disabled
'
)).
toBe
(
false
)
expect
(
await
cb
.
attribute
(
'
disabled
'
)).
toBe
(
false
+
''
)
})
})
})
})
pages/component/input/input.test.js
浏览文件 @
14cd48c9
...
@@ -43,7 +43,7 @@ describe('component-native-input', () => {
...
@@ -43,7 +43,7 @@ describe('component-native-input', () => {
// 测试修改value属性
// 测试修改value属性
it
(
"
value
"
,
async
()
=>
{
it
(
"
value
"
,
async
()
=>
{
const
input
=
await
page
.
$
(
'
#uni-input-default
'
);
const
input
=
await
page
.
$
(
'
#uni-input-default
'
);
expect
(
await
input
.
attribute
(
'
value
'
)).
toEqual
(
"
hello uni-app x
"
)
expect
(
await
input
.
property
(
'
value
'
)).
toEqual
(
"
hello uni-app x
"
)
})
})
//测试input的类型
//测试input的类型
...
...
pages/component/picker-view/picker-view.test.js
浏览文件 @
14cd48c9
...
@@ -16,14 +16,14 @@ describe('PickerView.uvue', () => {
...
@@ -16,14 +16,14 @@ describe('PickerView.uvue', () => {
const
el
=
await
page
.
$
(
'
.picker-view
'
)
const
el
=
await
page
.
$
(
'
.picker-view
'
)
await
page
.
callMethod
(
'
setValue
'
)
await
page
.
callMethod
(
'
setValue
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
1000
)
expect
(
await
el
.
attribute
(
'
value
'
)).
toEqual
([
0
,
0
,
0
])
expect
(
await
el
.
property
(
'
value
'
)).
toEqual
([
0
,
0
,
0
])
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
expect
(
await
getData
(
'
result
'
)).
toEqual
([
0
,
0
,
0
])
expect
(
await
getData
(
'
result
'
)).
toEqual
([
0
,
0
,
0
])
}
}
await
page
.
callMethod
(
'
setValue1
'
)
await
page
.
callMethod
(
'
setValue1
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
1000
)
expect
(
await
el
.
attribute
(
'
value
'
)).
toEqual
([
10
,
10
,
10
])
expect
(
await
el
.
property
(
'
value
'
)).
toEqual
([
10
,
10
,
10
])
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
expect
(
await
getData
(
'
result
'
)).
toEqual
([
10
,
10
,
10
])
expect
(
await
getData
(
'
result
'
)).
toEqual
([
10
,
10
,
10
])
}
}
...
...
pages/component/progress/progress.test.js
浏览文件 @
14cd48c9
...
@@ -16,22 +16,22 @@ describe('Progress.uvue', () => {
...
@@ -16,22 +16,22 @@ describe('Progress.uvue', () => {
await
page
.
callMethod
(
'
setProgress
'
)
await
page
.
callMethod
(
'
setProgress
'
)
await
page
.
waitFor
(
1000
);
await
page
.
waitFor
(
1000
);
const
p
=
await
page
.
$
(
'
.p
'
)
const
p
=
await
page
.
$
(
'
.p
'
)
expect
(
await
p
.
attribute
(
'
percent
'
)).
toEqual
(
20
)
expect
(
await
p
.
attribute
(
'
percent
'
)).
toEqual
(
20
+
''
)
const
p1
=
await
page
.
$
(
'
.p1
'
)
const
p1
=
await
page
.
$
(
'
.p1
'
)
expect
(
await
p1
.
attribute
(
'
percent
'
)).
toEqual
(
40
)
expect
(
await
p1
.
attribute
(
'
percent
'
)).
toEqual
(
40
+
''
)
const
p2
=
await
page
.
$
(
'
.p2
'
)
const
p2
=
await
page
.
$
(
'
.p2
'
)
expect
(
await
p2
.
attribute
(
'
percent
'
)).
toEqual
(
60
)
expect
(
await
p2
.
attribute
(
'
percent
'
)).
toEqual
(
60
+
''
)
const
p3
=
await
page
.
$
(
'
.p3
'
)
const
p3
=
await
page
.
$
(
'
.p3
'
)
expect
(
await
p3
.
attribute
(
'
percent
'
)).
toEqual
(
80
)
expect
(
await
p3
.
attribute
(
'
percent
'
)).
toEqual
(
80
+
''
)
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
expect
(
await
getData
(
'
curPercent
'
)).
toEqual
(
20
)
expect
(
await
getData
(
'
curPercent
'
)).
toEqual
(
20
)
}
}
await
page
.
callMethod
(
'
clearProgress
'
)
await
page
.
callMethod
(
'
clearProgress
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
1000
)
expect
(
await
p
.
attribute
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p
.
attribute
(
'
percent
'
)).
toEqual
(
0
+
''
)
expect
(
await
p1
.
attribute
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p1
.
attribute
(
'
percent
'
)).
toEqual
(
0
+
''
)
expect
(
await
p2
.
attribute
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p2
.
attribute
(
'
percent
'
)).
toEqual
(
0
+
''
)
expect
(
await
p3
.
attribute
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p3
.
attribute
(
'
percent
'
)).
toEqual
(
0
+
''
)
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-android
'
)
{
expect
(
await
getData
(
'
curPercent
'
)).
toEqual
(
0
)
expect
(
await
getData
(
'
curPercent
'
)).
toEqual
(
0
)
}
}
...
@@ -42,35 +42,35 @@ describe('Progress.uvue', () => {
...
@@ -42,35 +42,35 @@ describe('Progress.uvue', () => {
})
})
it
(
'
show-info
'
,
async
()
=>
{
it
(
'
show-info
'
,
async
()
=>
{
const
el
=
await
page
.
$
(
'
.p
'
)
const
el
=
await
page
.
$
(
'
.p
'
)
expect
(
await
el
.
attribute
(
'
show-info
'
)).
toEqual
(
true
)
expect
(
await
el
.
attribute
(
'
show-info
'
)).
toEqual
(
true
+
''
)
await
page
.
setData
({
await
page
.
setData
({
showInfo
:
false
showInfo
:
false
})
})
expect
(
await
el
.
attribute
(
'
show-info
'
)).
toEqual
(
false
)
expect
(
await
el
.
attribute
(
'
show-info
'
)).
toEqual
(
false
+
''
)
})
})
it
(
'
border-radius
'
,
async
()
=>
{
it
(
'
border-radius
'
,
async
()
=>
{
const
el
=
await
page
.
$
(
'
.p
'
)
const
el
=
await
page
.
$
(
'
.p
'
)
expect
(
await
el
.
attribute
(
'
border-radius
'
)).
toEqual
(
0
)
expect
(
await
el
.
attribute
(
'
border-radius
'
)).
toEqual
(
0
+
''
)
await
page
.
setData
({
await
page
.
setData
({
borderRadius
:
5
borderRadius
:
5
})
})
expect
(
await
el
.
attribute
(
'
border-radius
'
)).
toEqual
(
5
)
expect
(
await
el
.
attribute
(
'
border-radius
'
)).
toEqual
(
5
+
''
)
})
})
it
(
'
font-size
'
,
async
()
=>
{
it
(
'
font-size
'
,
async
()
=>
{
const
el
=
await
page
.
$
(
'
.p
'
)
const
el
=
await
page
.
$
(
'
.p
'
)
expect
(
await
el
.
attribute
(
'
font-size
'
)).
toEqual
(
16
)
expect
(
await
el
.
attribute
(
'
font-size
'
)).
toEqual
(
16
+
''
)
await
page
.
setData
({
await
page
.
setData
({
fontSize
:
18
fontSize
:
18
})
})
expect
(
await
el
.
attribute
(
'
font-size
'
)).
toEqual
(
18
)
expect
(
await
el
.
attribute
(
'
font-size
'
)).
toEqual
(
18
+
''
)
})
})
it
(
'
stroke-width
'
,
async
()
=>
{
it
(
'
stroke-width
'
,
async
()
=>
{
const
el
=
await
page
.
$
(
'
.p
'
)
const
el
=
await
page
.
$
(
'
.p
'
)
expect
(
await
el
.
attribute
(
'
stroke-width
'
)).
toEqual
(
3
)
expect
(
await
el
.
attribute
(
'
stroke-width
'
)).
toEqual
(
3
+
''
)
await
page
.
setData
({
await
page
.
setData
({
strokeWidth
:
6
strokeWidth
:
6
})
})
expect
(
await
el
.
attribute
(
'
stroke-width
'
)).
toEqual
(
6
)
expect
(
await
el
.
attribute
(
'
stroke-width
'
)).
toEqual
(
6
+
''
)
})
})
it
(
'
backgroundColor
'
,
async
()
=>
{
it
(
'
backgroundColor
'
,
async
()
=>
{
const
el
=
await
page
.
$
(
'
.p
'
)
const
el
=
await
page
.
$
(
'
.p
'
)
...
...
pages/component/radio/radio.test.js
浏览文件 @
14cd48c9
...
@@ -40,11 +40,11 @@ describe('Radio.uvue', () => {
...
@@ -40,11 +40,11 @@ describe('Radio.uvue', () => {
})
})
it
(
'
checked
'
,
async
()
=>
{
it
(
'
checked
'
,
async
()
=>
{
const
radio
=
await
page
.
$
(
'
.r
'
)
const
radio
=
await
page
.
$
(
'
.r
'
)
expect
(
await
radio
.
attribute
(
'
checked
'
)).
toBe
(
true
)
expect
(
await
radio
.
property
(
'
checked
'
)).
toBe
(
true
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
false
,
checked
:
false
,
})
})
expect
(
await
radio
.
attribute
(
'
checked
'
)).
toBe
(
false
)
expect
(
await
radio
.
property
(
'
checked
'
)).
toBe
(
false
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
radio
=
await
page
.
$
(
'
.r
'
)
const
radio
=
await
page
.
$
(
'
.r
'
)
...
@@ -56,10 +56,10 @@ describe('Radio.uvue', () => {
...
@@ -56,10 +56,10 @@ describe('Radio.uvue', () => {
})
})
it
(
'
disabled
'
,
async
()
=>
{
it
(
'
disabled
'
,
async
()
=>
{
const
radio
=
await
page
.
$
(
'
.r2
'
)
const
radio
=
await
page
.
$
(
'
.r2
'
)
expect
(
await
radio
.
attribute
(
'
disabled
'
)).
toBe
(
true
)
expect
(
await
radio
.
attribute
(
'
disabled
'
)).
toBe
(
true
+
''
)
await
page
.
setData
({
await
page
.
setData
({
disabled
:
false
,
disabled
:
false
,
})
})
expect
(
await
radio
.
attribute
(
'
disabled
'
)).
toBe
(
false
)
expect
(
await
radio
.
attribute
(
'
disabled
'
)).
toBe
(
false
+
''
)
})
})
})
})
pages/component/scroll-view/scroll-view-props.test.js
浏览文件 @
14cd48c9
...
@@ -25,7 +25,7 @@ describe('component-native-scroll-view', () => {
...
@@ -25,7 +25,7 @@ describe('component-native-scroll-view', () => {
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
scrollTop
=
await
element
.
attribute
(
"
scrollTop
"
)
const
scrollTop
=
await
element
.
property
(
"
scrollTop
"
)
console
.
log
(
"
check_scroll_top---
"
+
scrollTop
)
console
.
log
(
"
check_scroll_top---
"
+
scrollTop
)
expect
(
scrollTop
-
600
).
toBeGreaterThanOrEqual
(
0
)
expect
(
scrollTop
-
600
).
toBeGreaterThanOrEqual
(
0
)
})
})
...
@@ -37,7 +37,7 @@ describe('component-native-scroll-view', () => {
...
@@ -37,7 +37,7 @@ describe('component-native-scroll-view', () => {
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
element
=
await
page
.
$
(
'
#scrollViewY
'
)
const
scrollTop
=
await
element
.
attribute
(
"
scrollTop
"
)
const
scrollTop
=
await
element
.
property
(
"
scrollTop
"
)
console
.
log
(
"
check_scroll_into_view_top--
"
+
scrollTop
)
console
.
log
(
"
check_scroll_into_view_top--
"
+
scrollTop
)
await
page
.
setData
({
await
page
.
setData
({
scrollIntoView
:
""
scrollIntoView
:
""
...
@@ -62,7 +62,7 @@ describe('component-native-scroll-view', () => {
...
@@ -62,7 +62,7 @@ describe('component-native-scroll-view', () => {
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
scrollLeft
=
await
element
.
attribute
(
"
scrollLeft
"
)
const
scrollLeft
=
await
element
.
property
(
"
scrollLeft
"
)
console
.
log
(
"
check_scroll_left---
"
+
scrollLeft
)
console
.
log
(
"
check_scroll_left---
"
+
scrollLeft
)
expect
(
scrollLeft
-
600
).
toBeGreaterThanOrEqual
(
0
)
expect
(
scrollLeft
-
600
).
toBeGreaterThanOrEqual
(
0
)
})
})
...
@@ -74,7 +74,7 @@ describe('component-native-scroll-view', () => {
...
@@ -74,7 +74,7 @@ describe('component-native-scroll-view', () => {
})
})
await
page
.
waitFor
(
600
)
await
page
.
waitFor
(
600
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
element
=
await
page
.
$
(
'
#scrollViewX
'
)
const
scrollLeft
=
await
element
.
attribute
(
"
scrollLeft
"
)
const
scrollLeft
=
await
element
.
property
(
"
scrollLeft
"
)
console
.
log
(
"
check_scroll_into_view_left--
"
+
scrollLeft
)
console
.
log
(
"
check_scroll_into_view_left--
"
+
scrollLeft
)
await
page
.
setData
({
await
page
.
setData
({
scrollIntoView
:
""
scrollIntoView
:
""
...
...
pages/component/slider-100/slider-100.test.js
浏览文件 @
14cd48c9
...
@@ -15,12 +15,12 @@ describe('slider', () => {
...
@@ -15,12 +15,12 @@ describe('slider', () => {
// TODO 暂时仅获取第一个
// TODO 暂时仅获取第一个
const
slider1
=
await
page
.
$
(
'
.slider
'
)
const
slider1
=
await
page
.
$
(
'
.slider
'
)
expect
(
await
slider1
.
attribute
(
'
value
'
)).
toBe
(
sliderValue
)
expect
(
await
slider1
.
property
(
'
value
'
)).
toBe
(
sliderValue
)
// const slider100 = await page.$$('.slider')
// const slider100 = await page.$$('.slider')
// for (let i = 0; i < slider100.length; i++) {
// for (let i = 0; i < slider100.length; i++) {
// const slider = slider100[i];
// const slider = slider100[i];
// expect(await slider.
attribute
('value')).toBe(sliderValue)
// expect(await slider.
property
('value')).toBe(sliderValue)
// }
// }
})
})
})
})
pages/component/slider/slider.test.js
浏览文件 @
14cd48c9
...
@@ -15,7 +15,7 @@ describe('slider', () => {
...
@@ -15,7 +15,7 @@ describe('slider', () => {
sliderValue
:
sliderValue
,
sliderValue
:
sliderValue
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
slider
.
attribute
(
'
value
'
)).
toBe
(
sliderValue
)
expect
(
await
slider
.
property
(
'
value
'
)).
toBe
(
sliderValue
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
slider
=
await
page
.
$
(
'
.slider-custom-color-and-size
'
)
const
slider
=
await
page
.
$
(
'
.slider-custom-color-and-size
'
)
...
@@ -39,13 +39,13 @@ describe('slider', () => {
...
@@ -39,13 +39,13 @@ describe('slider', () => {
})
})
it
(
'
block-size
'
,
async
()
=>
{
it
(
'
block-size
'
,
async
()
=>
{
const
slider
=
await
page
.
$
(
'
.slider-custom-color-and-size
'
)
const
slider
=
await
page
.
$
(
'
.slider-custom-color-and-size
'
)
expect
(
await
slider
.
attribute
(
'
blockSize
'
)).
toBe
(
20
)
expect
(
await
slider
.
attribute
(
'
blockSize
'
)).
toBe
(
20
+
''
)
const
blockSize
=
18
const
blockSize
=
18
await
page
.
setData
({
await
page
.
setData
({
sliderBlockSize
:
blockSize
,
sliderBlockSize
:
blockSize
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
slider
.
attribute
(
'
blockSize
'
)).
toBe
(
blockSize
)
expect
(
await
slider
.
attribute
(
'
blockSize
'
)).
toBe
(
blockSize
+
''
)
})
})
})
})
pages/component/switch/switch.test.js
浏览文件 @
14cd48c9
...
@@ -29,13 +29,13 @@ describe('switch', () => {
...
@@ -29,13 +29,13 @@ describe('switch', () => {
checked
:
false
,
checked
:
false
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
switch_element
.
attribute
(
'
checked
'
)).
toBe
(
false
)
expect
(
await
switch_element
.
property
(
'
checked
'
)).
toBe
(
false
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
true
,
checked
:
true
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
switch_element
.
attribute
(
'
checked
'
)).
toBe
(
true
)
expect
(
await
switch_element
.
property
(
'
checked
'
)).
toBe
(
true
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
switch_element
=
await
page
.
$
(
'
.switch-color
'
)
const
switch_element
=
await
page
.
$
(
'
.switch-color
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录