Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
1db31cc7
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看板
提交
1db31cc7
编写于
1月 26, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
component: 调整自动化测试用法
上级
caccd454
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
8 deletion
+23
-8
pages/component/checkbox/checkbox.test.js
pages/component/checkbox/checkbox.test.js
+6
-2
pages/component/radio/radio.test.js
pages/component/radio/radio.test.js
+5
-2
pages/component/slider-100/slider-100.test.js
pages/component/slider-100/slider-100.test.js
+3
-1
pages/component/slider/slider.test.js
pages/component/slider/slider.test.js
+3
-1
pages/component/switch/switch.test.js
pages/component/switch/switch.test.js
+6
-2
未找到文件。
pages/component/checkbox/checkbox.test.js
浏览文件 @
1db31cc7
...
@@ -42,11 +42,15 @@ describe('Checkbox.uvue', () => {
...
@@ -42,11 +42,15 @@ describe('Checkbox.uvue', () => {
})
})
it
(
'
checked
'
,
async
()
=>
{
it
(
'
checked
'
,
async
()
=>
{
const
cb
=
await
page
.
$
(
'
.cb
'
)
const
cb
=
await
page
.
$
(
'
.cb
'
)
expect
(
await
cb
.
property
(
'
checked
'
)).
toBe
(
true
)
// TODO
const
newValue1
=
await
cb
.
property
(
'
checked
'
)
expect
(
newValue1
.
toString
()).
toBe
(
true
+
''
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
false
,
checked
:
false
,
})
})
expect
(
await
cb
.
property
(
'
checked
'
)).
toBe
(
false
)
// TODO
const
newValue2
=
await
cb
.
property
(
'
checked
'
)
expect
(
newValue2
.
toString
()).
toBe
(
false
+
''
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
cb
=
await
page
.
$
(
'
.cb
'
)
const
cb
=
await
page
.
$
(
'
.cb
'
)
...
...
pages/component/radio/radio.test.js
浏览文件 @
1db31cc7
...
@@ -40,11 +40,14 @@ describe('Radio.uvue', () => {
...
@@ -40,11 +40,14 @@ describe('Radio.uvue', () => {
})
})
it
(
'
checked
'
,
async
()
=>
{
it
(
'
checked
'
,
async
()
=>
{
const
radio
=
await
page
.
$
(
'
.r
'
)
const
radio
=
await
page
.
$
(
'
.r
'
)
expect
(
await
radio
.
property
(
'
checked
'
)).
toBe
(
true
)
// TODO
const
newValue1
=
await
radio
.
property
(
'
checked
'
)
expect
(
newValue1
.
toString
()).
toBe
(
true
+
''
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
false
,
checked
:
false
,
})
})
expect
(
await
radio
.
property
(
'
checked
'
)).
toBe
(
false
)
const
newValue2
=
await
radio
.
property
(
'
checked
'
)
expect
(
newValue2
.
toString
()).
toBe
(
false
+
''
)
})
})
it
(
'
color
'
,
async
()
=>
{
it
(
'
color
'
,
async
()
=>
{
const
radio
=
await
page
.
$
(
'
.r
'
)
const
radio
=
await
page
.
$
(
'
.r
'
)
...
...
pages/component/slider-100/slider-100.test.js
浏览文件 @
1db31cc7
...
@@ -15,7 +15,9 @@ describe('slider', () => {
...
@@ -15,7 +15,9 @@ describe('slider', () => {
// TODO 暂时仅获取第一个
// TODO 暂时仅获取第一个
const
slider1
=
await
page
.
$
(
'
.slider
'
)
const
slider1
=
await
page
.
$
(
'
.slider
'
)
expect
(
await
slider1
.
property
(
'
value
'
)).
toBe
(
sliderValue
)
// TODO
const
newValue
=
await
slider1
.
property
(
'
value
'
)
expect
(
newValue
.
toString
()).
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++) {
...
...
pages/component/slider/slider.test.js
浏览文件 @
1db31cc7
...
@@ -15,7 +15,9 @@ describe('slider', () => {
...
@@ -15,7 +15,9 @@ describe('slider', () => {
sliderValue
:
sliderValue
,
sliderValue
:
sliderValue
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
slider
.
property
(
'
value
'
)).
toBe
(
sliderValue
)
// TODO
const
newValue
=
await
slider
.
property
(
'
value
'
)
expect
(
newValue
.
toString
()).
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
'
)
...
...
pages/component/switch/switch.test.js
浏览文件 @
1db31cc7
...
@@ -29,13 +29,17 @@ describe('switch', () => {
...
@@ -29,13 +29,17 @@ describe('switch', () => {
checked
:
false
,
checked
:
false
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
switch_element
.
property
(
'
checked
'
)).
toBe
(
false
)
// TODO
const
newValue1
=
await
switch_element
.
property
(
'
checked
'
)
expect
(
newValue1
.
toString
()).
toBe
(
false
+
''
)
await
page
.
setData
({
await
page
.
setData
({
checked
:
true
,
checked
:
true
,
})
})
await
page
.
waitFor
(
100
)
await
page
.
waitFor
(
100
)
expect
(
await
switch_element
.
property
(
'
checked
'
)).
toBe
(
true
)
// TODO
const
newValue2
=
await
switch_element
.
property
(
'
checked
'
)
expect
(
newValue2
.
toString
()).
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录