diff --git a/pages/component/swiper/swiper.test.js b/pages/component/swiper/swiper.test.js index 917e9f4da6aa4c5a007b6ee8b2edd4f55159f65d..32ac9e3fde7b2d64268bfe42d91e364a7c48d101 100644 --- a/pages/component/swiper/swiper.test.js +++ b/pages/component/swiper/swiper.test.js @@ -29,42 +29,24 @@ describe('test swiper', () => { */ }); - it('check autoplay loop', async () => { - // iOS平台此测试用例 等待时长不准确 导致用例过不了 - if (!process.env.uniTestPlatformInfo.startsWith('IOS_SIMULATOR')) { - await page.setData({ - autoplaySelect: true, - currentValChange: 0, - }) - await page.waitFor(600) - expect(await getData('currentValChange')).toEqual(0) - await page.waitFor(1600) - expect(await getData('currentValChange')).toEqual(1) - await page.waitFor(2000) - expect(await getData('currentValChange')).toEqual(2) - await page.waitFor(2000) - expect(await getData('currentValChange')).toEqual(0) - await page.setData({ - circularSelect: true, - currentValChange: 0, - }) - await page.waitFor(600) - expect(await getData('currentValChange')).toEqual(0) - await page.waitFor(1600) - expect(await getData('currentValChange')).toEqual(1) - await page.waitFor(2000) - expect(await getData('currentValChange')).toEqual(2) - await page.waitFor(2000) - expect(await getData('currentValChange')).toEqual(0) - await page.setData({ - circularSelect: false, - autoplaySelect: false - }) - await page.waitFor(300) - } + it('check autoplay loop', async () => { + await page.setData({ + currentValChange: 0, + autoplaySelect: true, + }) + await page.waitFor(2400) + expect(await getData('currentValChange')).toEqual(1) + await page.waitFor(2000) + expect(await getData('currentValChange')).toEqual(2) + await page.waitFor(2000) + expect(await getData('currentValChange')).toEqual(0) + + await page.setData({ + autoplaySelect: false + }) + await page.waitFor(300) }); - it('check current', async () => { await page.setData({ currentVal: 2,