Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
27f83eec
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6004
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看板
提交
27f83eec
编写于
10月 26, 2023
作者:
Y
yurj26
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 优化waitfor 时间
上级
9a487ea3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
14 addition
and
32 deletion
+14
-32
pages/component/button/button.test.js
pages/component/button/button.test.js
+2
-7
pages/component/checkbox/checkbox.test.js
pages/component/checkbox/checkbox.test.js
+1
-4
pages/component/picker-view/picker-view.test.js
pages/component/picker-view/picker-view.test.js
+4
-6
pages/component/progress/progress.test.js
pages/component/progress/progress.test.js
+6
-11
pages/component/radio/radio.test.js
pages/component/radio/radio.test.js
+1
-4
未找到文件。
pages/component/button/button.test.js
浏览文件 @
27f83eec
...
...
@@ -4,7 +4,7 @@ describe('Button.uvue', () => {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
500
)
await
page
.
waitFor
(
'
view
'
)
})
it
(
'
click
'
,
async
()
=>
{
// TODO 待测试框架支持text的dispatchEvent
...
...
@@ -41,12 +41,10 @@ describe('Button.uvue', () => {
await
page
.
setData
({
type_enum_current
:
1
,
})
await
page
.
waitFor
(
500
)
expect
(
await
btn
.
property
(
'
type
'
)).
toBe
(
'
primary
'
)
await
page
.
setData
({
type_enum_current
:
2
,
})
await
page
.
waitFor
(
500
)
expect
(
await
btn
.
property
(
'
type
'
)).
toBe
(
'
warn
'
)
})
it
(
'
size
'
,
async
()
=>
{
...
...
@@ -55,7 +53,6 @@ describe('Button.uvue', () => {
await
page
.
setData
({
size_enum_current
:
1
,
})
await
page
.
waitFor
(
500
)
expect
(
await
btn
.
property
(
'
size
'
)).
toBe
(
'
mini
'
)
})
it
(
'
plain
'
,
async
()
=>
{
...
...
@@ -64,7 +61,6 @@ describe('Button.uvue', () => {
await
page
.
setData
({
plain_boolean
:
true
,
})
await
page
.
waitFor
(
500
)
expect
(
await
btn
.
property
(
'
plain
'
)).
toBe
(
true
)
})
it
(
'
disabled
'
,
async
()
=>
{
...
...
@@ -73,7 +69,6 @@ describe('Button.uvue', () => {
await
page
.
setData
({
disabled_boolean
:
true
,
})
await
page
.
waitFor
(
500
)
expect
(
await
btn
.
property
(
'
disabled
'
)).
toBe
(
true
)
})
})
pages/component/checkbox/checkbox.test.js
浏览文件 @
27f83eec
...
...
@@ -8,7 +8,7 @@ function getData(key = '') {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/checkbox/checkbox
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
'
view
'
)
})
describe
(
'
Checkbox.uvue
'
,
()
=>
{
...
...
@@ -46,7 +46,6 @@ describe('Checkbox.uvue', () => {
await
page
.
setData
({
checked
:
false
,
})
await
page
.
waitFor
(
500
)
expect
(
await
cb
.
property
(
'
checked
'
)).
toBe
(
false
)
})
it
(
'
color
'
,
async
()
=>
{
...
...
@@ -55,7 +54,6 @@ describe('Checkbox.uvue', () => {
await
page
.
setData
({
color
:
'
#63acfc
'
,
})
await
page
.
waitFor
(
500
)
expect
(
await
cb
.
property
(
'
color
'
)).
toBe
(
'
#63acfc
'
)
})
it
(
'
disabled
'
,
async
()
=>
{
...
...
@@ -64,7 +62,6 @@ describe('Checkbox.uvue', () => {
await
page
.
setData
({
disabled
:
false
,
})
await
page
.
waitFor
(
500
)
expect
(
await
cb
.
property
(
'
disabled
'
)).
toBe
(
false
)
})
})
pages/component/picker-view/picker-view.test.js
浏览文件 @
27f83eec
...
...
@@ -8,7 +8,7 @@ function getData(key = '') {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/picker-view/picker-view
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
'
view
'
)
})
describe
(
'
PickerView.uvue
'
,
()
=>
{
...
...
@@ -44,7 +44,6 @@ describe('PickerView.uvue', () => {
await
page
.
setData
({
maskTopStyle
:
'
background: #ffffff;
'
,
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
mask-top-style
'
)).
toBe
(
'
background: #ffffff;
'
)
})
it
(
'
mask-bottom-style
'
,
async
()
=>
{
...
...
@@ -52,7 +51,6 @@ describe('PickerView.uvue', () => {
await
page
.
setData
({
maskBottomStyle
:
'
background: #ffffff;
'
,
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
mask-bottom-style
'
)).
toBe
(
'
background: #ffffff;
'
)
})
})
pages/component/progress/progress.test.js
浏览文件 @
27f83eec
...
...
@@ -8,7 +8,7 @@ function getData(key = '') {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/progress/progress
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
'
view
'
)
})
describe
(
'
Progress.uvue
'
,
()
=>
{
...
...
@@ -18,14 +18,14 @@ describe('Progress.uvue', () => {
const
p2
=
await
page
.
$
(
'
.p2
'
)
const
p3
=
await
page
.
$
(
'
.p3
'
)
page
.
callMethod
(
'
setProgress
'
)
await
page
.
waitFor
(
10
00
)
await
page
.
waitFor
(
5
00
)
expect
(
await
p
.
property
(
'
percent
'
)).
toEqual
(
20
)
expect
(
await
p1
.
property
(
'
percent
'
)).
toEqual
(
40
)
expect
(
await
p2
.
property
(
'
percent
'
)).
toEqual
(
60
)
expect
(
await
p3
.
property
(
'
percent
'
)).
toEqual
(
80
)
expect
(
await
getData
(
'
curPercent
'
)).
toEqual
(
20
)
page
.
callMethod
(
'
clearProgress
'
)
await
page
.
waitFor
(
10
00
)
await
page
.
waitFor
(
5
00
)
expect
(
await
p
.
property
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p1
.
property
(
'
percent
'
)).
toEqual
(
0
)
expect
(
await
p2
.
property
(
'
percent
'
)).
toEqual
(
0
)
...
...
@@ -42,7 +42,6 @@ describe('Progress.uvue', () => {
await
page
.
setData
({
showInfo
:
false
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
show-info
'
)).
toEqual
(
false
)
})
it
(
'
border-radius
'
,
async
()
=>
{
...
...
@@ -51,7 +50,6 @@ describe('Progress.uvue', () => {
await
page
.
setData
({
borderRadius
:
5
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
border-radius
'
)).
toEqual
(
5
)
})
it
(
'
font-size
'
,
async
()
=>
{
...
...
@@ -60,7 +58,6 @@ describe('Progress.uvue', () => {
await
page
.
setData
({
fontSize
:
18
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
font-size
'
)).
toEqual
(
18
)
})
it
(
'
stroke-width
'
,
async
()
=>
{
...
...
@@ -69,7 +66,6 @@ describe('Progress.uvue', () => {
await
page
.
setData
({
strokeWidth
:
6
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
stroke-width
'
)).
toEqual
(
6
)
})
it
(
'
backgroundColor
'
,
async
()
=>
{
...
...
@@ -78,7 +74,6 @@ describe('Progress.uvue', () => {
await
page
.
setData
({
backgroundColor
:
"
#007aff
"
})
await
page
.
waitFor
(
500
)
expect
(
await
el
.
property
(
'
background-color
'
)).
toEqual
(
'
#007aff
'
)
})
})
pages/component/radio/radio.test.js
浏览文件 @
27f83eec
...
...
@@ -8,7 +8,7 @@ function getData(key = '') {
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/radio/radio
'
)
await
page
.
waitFor
(
1000
)
await
page
.
waitFor
(
'
view
'
)
})
describe
(
'
Radio.uvue
'
,
()
=>
{
...
...
@@ -44,7 +44,6 @@ describe('Radio.uvue', () => {
await
page
.
setData
({
checked
:
false
,
})
await
page
.
waitFor
(
500
)
expect
(
await
radio
.
property
(
'
checked
'
)).
toBe
(
false
)
})
it
(
'
color
'
,
async
()
=>
{
...
...
@@ -53,7 +52,6 @@ describe('Radio.uvue', () => {
await
page
.
setData
({
color
:
'
#63acfc
'
,
})
await
page
.
waitFor
(
500
)
expect
(
await
radio
.
property
(
'
color
'
)).
toBe
(
'
#63acfc
'
)
})
it
(
'
disabled
'
,
async
()
=>
{
...
...
@@ -62,7 +60,6 @@ describe('Radio.uvue', () => {
await
page
.
setData
({
disabled
:
false
,
})
await
page
.
waitFor
(
500
)
expect
(
await
radio
.
property
(
'
disabled
'
)).
toBe
(
false
)
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录