提交 74436c54 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 优化测试例

上级 5b00b0ee
...@@ -8,7 +8,7 @@ function getData(key = '') { ...@@ -8,7 +8,7 @@ function getData(key = '') {
let page let page
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/checkbox/checkbox') page = await program.reLaunch('/pages/component/checkbox/checkbox')
await page.waitFor(1000) await page.waitFor(2000);
}) })
describe('Checkbox.uvue', () => { describe('Checkbox.uvue', () => {
......
...@@ -53,8 +53,8 @@ describe('event trigger sequence', () => { ...@@ -53,8 +53,8 @@ describe('event trigger sequence', () => {
], ],
}) })
const data = await page.data() const data = await page.data()
expect(data.onTouchStartTime).toBeLessThan(data.onTouchMoveTime) expect(data.onTouchStartTime).toBeLessThanOrEqual(data.onTouchMoveTime);
expect(data.onTouchMoveTime).toBeLessThan(data.onTouchEndTime) expect(data.onTouchMoveTime).toBeLessThanOrEqual(data.onTouchEndTime);
}) })
it('click', async () => { it('click', async () => {
......
...@@ -8,7 +8,7 @@ function getData(key = '') { ...@@ -8,7 +8,7 @@ function getData(key = '') {
let page let page
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/progress/progress') page = await program.reLaunch('/pages/component/progress/progress')
await page.waitFor(1000) await page.waitFor(2000);
}) })
describe('Progress.uvue', () => { describe('Progress.uvue', () => {
...@@ -17,14 +17,14 @@ describe('Progress.uvue', () => { ...@@ -17,14 +17,14 @@ describe('Progress.uvue', () => {
const p1 = await page.$('.p1') const p1 = await page.$('.p1')
const p2 = await page.$('.p2') const p2 = await page.$('.p2')
const p3 = await page.$('.p3') const p3 = await page.$('.p3')
await page.callMethod('setProgress') await page.callMethod('setProgress')
await page.waitFor(1000) await page.waitFor(1000)
expect(await p.property('percent')).toEqual(20) expect(await p.property('percent')).toEqual(20)
expect(await p1.property('percent')).toEqual(40) expect(await p1.property('percent')).toEqual(40)
expect(await p2.property('percent')).toEqual(60) expect(await p2.property('percent')).toEqual(60)
expect(await p3.property('percent')).toEqual(80) expect(await p3.property('percent')).toEqual(80)
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.property('percent')).toEqual(0) expect(await p.property('percent')).toEqual(0)
expect(await p1.property('percent')).toEqual(0) expect(await p1.property('percent')).toEqual(0)
...@@ -76,4 +76,4 @@ describe('Progress.uvue', () => { ...@@ -76,4 +76,4 @@ describe('Progress.uvue', () => {
}) })
expect(await el.property('background-color')).toEqual('#007aff') expect(await el.property('background-color')).toEqual('#007aff')
}) })
}) })
...@@ -8,7 +8,7 @@ function getData(key = '') { ...@@ -8,7 +8,7 @@ function getData(key = '') {
let page let page
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/radio/radio') page = await program.reLaunch('/pages/component/radio/radio')
await page.waitFor(1000) await page.waitFor(2000);
}) })
describe('Radio.uvue', () => { describe('Radio.uvue', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册