提交 2ed80df6 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(saveImageToPhotosAlbum): 优化测试例

上级 0d242352
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
describe('API-saveImageToPhotosAlbum', () => { const isAndroid = platformInfo.startsWith('android')
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) {
it('pass', async () => {
expect(1).toBe(1); describe('API-saveImageToPhotosAlbum', () => {
}); if (!isAndroid) {
return; it('pass', async () => {
} expect(1).toBe(1);
});
let page; return;
beforeAll(async () => { }
page = await program.reLaunch('/pages/API/save-image-to-photos-album/save-image-to-photos-album');
await page.waitFor(500); let page;
}); beforeAll(async () => {
page = await program.reLaunch('/pages/API/save-image-to-photos-album/save-image-to-photos-album');
it('test saveImageToPhotosAlbum', async () => { await page.waitFor(500);
if (process.env.uniTestPlatformInfo.startsWith('android')) { });
await program.adbCommand(
'pm grant io.dcloud.uniappx android.permission.WRITE_EXTERNAL_STORAGE'); it('test saveImageToPhotosAlbum', async () => {
await page.waitFor(500); await program.adbCommand(
} 'pm grant io.dcloud.uniappx android.permission.WRITE_EXTERNAL_STORAGE');
await page.callMethod('saveImage'); await page.waitFor(500);
expect(await page.data('success')).toBe(true); await page.callMethod('saveImage');
}); expect(await page.data('success')).toBe(true);
});
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册