提交 d01a18fb 编写于 作者: M mahaifeng

[audio]添加audio asset目录测试用例

上级 01ce6b7c
......@@ -75,5 +75,16 @@ describe('inner-audio', () => {
await page.waitFor(3000);
// expect(await page.data('isPlayEnd')).toBeTruthy();
});
it('onEnded-android', async () => {
if (!process.env.uniTestPlatformInfo.startsWith('android')) {
expect(1).toBe(1)
return
}
await page.setData({
isPlayEnd: false
})
await page.callMethod('setSrc','/static/uni-autoTest/alert2s.mp3')
await page.waitFor(3000);
expect(await page.data('isPlayEnd')).toBeTruthy();
});
});
......@@ -280,6 +280,12 @@
this._audioContext!.playbackRate = parseFloat(e.detail.value)
// }
},
//just for test
setSrc(src:string){
if( this._audioContext!=null){
this._audioContext!.src = src
}
}
}
}
</script>
......
......@@ -1483,4 +1483,22 @@ describe('ExtApi-FileManagerTest', () => {
let arrayBufferRes = await getData("arrayBufferRes")
expect(arrayBufferRes).toEqual(1.2222222)
});
it('testReadAssetFile', async () => {
if (!isAndroid()) {
return
}
await page.setData({
basePath: '/static/uni-app-x/version.json',
logAble: false,
readFileRet: "",
readFile: '/version.json'
})
let btnReadFileButton = await page.$('#btn-read-file-sync')
await btnReadFileButton.tap()
await isDone()
let readFileRet = await getData('readFileRet')
expect(readFileRet.length>0).toBe(true)
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册