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 a5d737dad48a9646f00be46e488ca39359e6ead1..e465c28f19e4caa74a46f2d662377a7b4b9cb26b 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);