save-video-to-photos-album.test.js 908 字节
Newer Older
1 2 3 4 5
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isIos = platformInfo.startsWith('ios')
const isWeb = platformInfo.startsWith('web')
const isMp = platformInfo.startsWith('mp')

6
describe('API-saveVideoToPhotosAlbum', () => {
7
  if (isIos || isWeb || isMp) {
8 9 10 11 12 13
    it('pass', async () => {
      expect(1).toBe(1);
    });
    return;
  }

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
  let page;
  beforeAll(async () => {
    page = await program.reLaunch('/pages/API/save-video-to-photos-album/save-video-to-photos-album');
    await page.waitFor(500);
  });

  it('test saveVideoToPhotosAlbum', async () => {
    if (process.env.uniTestPlatformInfo.startsWith('android')) {
      await program.adbCommand(
        'pm grant io.dcloud.uniappx android.permission.WRITE_EXTERNAL_STORAGE');
      await page.waitFor(500);
    }
    await page.callMethod('saveVideo');
    expect(await page.data('success')).toBe(true);
  });
});