12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
- const isIOS = platformInfo.startsWith('ios')
- const isWeb = platformInfo.startsWith('web')
- const isMP = platformInfo.startsWith('mp')
- const isAndroid = platformInfo.startsWith('android')
- const isHarmony = platformInfo.startsWith('harmony')
- describe('API-compressVideo', () => {
- if (isWeb || isIOS || isMP || (isHarmony && platformInfo.includes('模拟器'))) {
- it('pass', async () => {
- expect(1).toBe(1);
- });
- return;
- }
- it('test compressVideo', async () => {
- const page = await program.reLaunch('/pages/API/compress-video/compress-video');
- await page.waitFor('view');
- await page.callMethod('testCompressVideo');
- await page.waitFor(5000);
- var width = await page.data('videoSrcForTestWidth')
- var height = await page.data('videoSrcForTestHeight')
- if (isAndroid) {
- width = 640
- height = 360
- const infos = process.env.uniTestPlatformInfo.split(' ');
- const version = parseInt(infos[infos.length - 1]);
- if (version == 5 || version == 7 || version == 9 || version == 10) return; // android5.1、android7、android9、android10存在兼容问题,待修复
- expect(await page.data('videoInfoForTest')).toEqual({
- width,
- height,
- // isSizeReduce: true
- isSizeReduce: false // android平台对测试视频进行压缩后存在视频变大的问题,待修复
- });
- return;
- }
- expect(await page.data('videoInfoForTest')).toEqual({
- width,
- height,
- isSizeReduce: true
- });
- });
- });
|