提交 3a2eaa50 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新web-view自动化测试用例

上级 36e1ba15
...@@ -19,7 +19,7 @@ describe('API-compressVideo', () => { ...@@ -19,7 +19,7 @@ describe('API-compressVideo', () => {
expect(await page.data('videoInfoForTest')).toEqual({ expect(await page.data('videoInfoForTest')).toEqual({
width: 640, width: 640,
height: 360, height: 360,
// isSizeReduce: true isSizeReduce: true
}); });
}); });
}); });
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
this.videoInfoForTest = { this.videoInfoForTest = {
"width": __res.width, "width": __res.width,
"height": __res.height, "height": __res.height,
// "isSizeReduce": afterComoressSize < beforeCompressSize "isSizeReduce": afterComoressSize < beforeCompressSize
}; };
} }
}); });
......
...@@ -42,15 +42,29 @@ describe('component-native-web-view', () => { ...@@ -42,15 +42,29 @@ describe('component-native-web-view', () => {
}); });
return; return;
} }
expect(await page.data('eventDownload')).toEqual({ const infos = process.env.uniTestPlatformInfo.split(' ');
tagName: 'WEB-VIEW', const version = parseInt(infos[infos.length - 1]);
type: 'download', if (version > 8) {
url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk', expect(await page.data('eventDownload')).toEqual({
userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`, tagName: 'WEB-VIEW',
contentDisposition: `attachment; filename="hello-uniappx.apk"; filename*=utf-8''hello-uniappx.apk`, type: 'download',
mimetype: 'application/vnd.android.package-archive', url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk',
contentLength: 27317517 userAgent: `uni-app-x/${process.env.HX_Version.split('-')[0].split('.').slice(0, 2).join('.')}`,
}); contentDisposition: `attachment; filename="hello-uniappx.apk"; filename*=utf-8''hello-uniappx.apk`,
mimetype: 'application/vnd.android.package-archive',
contentLength: 27317517
});
} else { // 低版本webview内核,部分属性无有效值
expect(await page.data('eventDownload')).toEqual({
tagName: 'WEB-VIEW',
type: 'download',
url: 'https://web-ext-storage.dcloud.net.cn/uni-app-x/pkg/hello-uniappx.apk',
userAgent: '',
contentDisposition: '',
mimetype: '',
contentLength: -1
});
}
}); });
it('test event message', async () => { it('test event message', async () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册