From 29276fe091eb8191418d3423d74d0ab2bd734404 Mon Sep 17 00:00:00 2001 From: mahaifeng Date: Wed, 13 Nov 2024 11:37:18 +0800 Subject: [PATCH] =?UTF-8?q?[audio]=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-inner-audio-context.test.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pages/API/create-inner-audio-context/create-inner-audio-context.test.js b/pages/API/create-inner-audio-context/create-inner-audio-context.test.js index a5d737da..e465c28f 100644 --- a/pages/API/create-inner-audio-context/create-inner-audio-context.test.js +++ b/pages/API/create-inner-audio-context/create-inner-audio-context.test.js @@ -1,10 +1,11 @@ describe('inner-audio', () => { - if (!process.env.uniTestPlatformInfo.startsWith('web')) { + if (!(process.env.uniTestPlatformInfo.startsWith('web')||process.env.uniTestPlatformInfo.startsWith('android'))) { it('app', () => { expect(1).toBe(1) }) return } + beforeAll(async () => { page = await program.reLaunch('/pages/API/create-inner-audio-context/create-inner-audio-context') await page.waitFor('view'); @@ -31,10 +32,18 @@ describe('inner-audio', () => { }); it('seek-onSeeking-onSeeked', async () => { - await page.callMethod('onchange',20) + if (process.env.uniTestPlatformInfo.indexOf('android') > -1 ) { + expect(1).toBe(1) + return false + } + + await page.callMethod('onchangeValue',20) const waitTime = process.env.uniTestPlatformInfo.includes('chrome') ? 1500:500 await page.waitFor(waitTime) console.log("seek-onSeeking-onSeeked:",await page.data()) + let isDone = await page.waitFor(async () => { + return await page.data('onSeekingTest') + }) expect(await page.data('onSeekingTest')).toBeTruthy(); // expect(await page.data('onWaitingTest')).toBeTruthy(); // expect(await page.data('onSeekedTest')).toBeTruthy(); @@ -60,7 +69,7 @@ describe('inner-audio', () => { }); it('onEnded', async () => { - await page.callMethod('onchange',173) + await page.callMethod('onchangeValue',173) await page.waitFor(500); await page.callMethod('play') await page.waitFor(3000); -- GitLab