提交 5e7d07f4 编写于 作者: M mahaifeng

[audio]修改测试用例

上级 62dd96ad
describe('inner-audio', () => { describe('inner-audio', () => {
if (!process.env.uniTestPlatformInfo.startsWith('web')) { if (!(process.env.uniTestPlatformInfo.startsWith('web')||process.env.uniTestPlatformInfo.startsWith('android'))) {
it('app', () => { it('app', () => {
expect(1).toBe(1) expect(1).toBe(1)
}) })
return return
} }
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/API/create-inner-audio-context/create-inner-audio-context') page = await program.reLaunch('/pages/API/create-inner-audio-context/create-inner-audio-context')
await page.waitFor('view'); await page.waitFor('view');
...@@ -31,10 +32,18 @@ describe('inner-audio', () => { ...@@ -31,10 +32,18 @@ describe('inner-audio', () => {
}); });
it('seek-onSeeking-onSeeked', async () => { 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 const waitTime = process.env.uniTestPlatformInfo.includes('chrome') ? 1500:500
await page.waitFor(waitTime) await page.waitFor(waitTime)
console.log("seek-onSeeking-onSeeked:",await page.data()) 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('onSeekingTest')).toBeTruthy();
// expect(await page.data('onWaitingTest')).toBeTruthy(); // expect(await page.data('onWaitingTest')).toBeTruthy();
// expect(await page.data('onSeekedTest')).toBeTruthy(); // expect(await page.data('onSeekedTest')).toBeTruthy();
...@@ -60,7 +69,7 @@ describe('inner-audio', () => { ...@@ -60,7 +69,7 @@ describe('inner-audio', () => {
}); });
it('onEnded', async () => { it('onEnded', async () => {
await page.callMethod('onchange',173) await page.callMethod('onchangeValue',173)
await page.waitFor(500); await page.waitFor(500);
await page.callMethod('play') await page.callMethod('play')
await page.waitFor(3000); await page.waitFor(3000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册