From 8b6f9db9517faf9a14d272537ed50993e543dbac Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 20 Nov 2023 17:23:45 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E8=8E=B7=E5=8F=96=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/checkbox/checkbox.test.js | 6 +++--- pages/component/progress/progress.test.js | 10 +++++----- pages/component/radio/radio.test.js | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pages/component/checkbox/checkbox.test.js b/pages/component/checkbox/checkbox.test.js index e6df2c26..2bc0d00f 100644 --- a/pages/component/checkbox/checkbox.test.js +++ b/pages/component/checkbox/checkbox.test.js @@ -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() diff --git a/pages/component/progress/progress.test.js b/pages/component/progress/progress.test.js index ea70b1d8..6bf464c4 100644 --- a/pages/component/progress/progress.test.js +++ b/pages/component/progress/progress.test.js @@ -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') diff --git a/pages/component/radio/radio.test.js b/pages/component/radio/radio.test.js index 0ea3241c..aa14de52 100644 --- a/pages/component/radio/radio.test.js +++ b/pages/component/radio/radio.test.js @@ -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') }) -- GitLab