提交 8b6f9db9 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 优化组件实例获取顺序

上级 119cdaf1
......@@ -13,14 +13,14 @@ beforeAll(async () => {
describe('Checkbox.uvue', () => {
it('change', async () => {
const cb = await page.$('.cb')
const cb1 = await page.$('.cb1')
const cb2 = await page.$('.cb2')
expect(await getData('value')).toEqual([])
const cb1 = await page.$('.cb1')
await cb1.tap()
expect(await getData('value')).toEqual(['cb', 'cb1'])
const cb = await page.$('.cb')
await cb.tap()
expect(await getData('value')).toEqual(['cb1'])
const cb2 = await page.$('.cb2')
await cb2.tap()
expect(await getData('value')).toEqual(['cb1'])
await cb1.tap()
......
......@@ -13,15 +13,15 @@ beforeAll(async () => {
describe('Progress.uvue', () => {
it('percent', async () => {
const p = await page.$('.p')
const p1 = await page.$('.p1')
const p2 = await page.$('.p2')
const p3 = await page.$('.p3')
await page.callMethod('setProgress')
await page.waitFor(2000);
await page.waitFor(1000);
const p = await page.$('.p')
expect(await p.property('percent')).toEqual(20)
const p1 = await page.$('.p1')
expect(await p1.property('percent')).toEqual(40)
const p2 = await page.$('.p2')
expect(await p2.property('percent')).toEqual(60)
const p3 = await page.$('.p3')
expect(await p3.property('percent')).toEqual(80)
expect(await getData('curPercent')).toEqual(20)
await page.callMethod('clearProgress')
......
......@@ -13,14 +13,14 @@ beforeAll(async () => {
describe('Radio.uvue', () => {
it('change', async () => {
const radio = await page.$('.r')
const radio1 = await page.$('.r1')
const radio2 = await page.$('.r2')
expect(await getData('value')).toEqual('')
const radio1 = await page.$('.r1')
await radio1.tap()
expect(await getData('value')).toEqual('r1')
const radio = await page.$('.r')
await radio.tap()
expect(await getData('value')).toEqual('r')
const radio2 = await page.$('.r2')
await radio2.tap()
expect(await getData('value')).toEqual('r')
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册