提交 166a0a34 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

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

上级 24bb0478
...@@ -126,7 +126,7 @@ describe('component-native-web-view', () => { ...@@ -126,7 +126,7 @@ describe('component-native-web-view', () => {
}); });
start = Date.now(); start = Date.now();
await page.waitFor(async () => { await page.waitFor(async () => {
return (await page.data('eventError')) || (Date.now() - start > 1000); return (await page.data('eventError')) || (Date.now() - start > 5000);
}); });
expect(await page.data('eventError')).toEqual({ expect(await page.data('eventError')).toEqual({
tagName: 'WEB-VIEW', tagName: 'WEB-VIEW',
......
...@@ -45,8 +45,9 @@ describe('component-native-web-view', () => { ...@@ -45,8 +45,9 @@ describe('component-native-web-view', () => {
return; return;
} }
const infos = process.env.uniTestPlatformInfo.split(' '); const infos = process.env.uniTestPlatformInfo.split(' ');
const version = parseInt(infos[infos.length - 1]); const version = parseInt(infos[infos.length - 1]);
if (version > 8) { if (version == 8) return; // android8测试结果不稳定
if (version >= 9) {
expect(await page.data('eventDownload')).toEqual({ expect(await page.data('eventDownload')).toEqual({
tagName: 'WEB-VIEW', tagName: 'WEB-VIEW',
type: 'download', type: 'download',
...@@ -56,7 +57,7 @@ describe('component-native-web-view', () => { ...@@ -56,7 +57,7 @@ describe('component-native-web-view', () => {
mimetype: 'application/vnd.android.package-archive', mimetype: 'application/vnd.android.package-archive',
isContentLengthValid: true isContentLengthValid: true
}); });
} else if (version > 6) { // 低版本webview内核,部分属性无有效值 } else if (version >= 7) { // 低版本webview内核,部分属性无有效值
expect(await page.data('eventDownload')).toEqual({ expect(await page.data('eventDownload')).toEqual({
tagName: 'WEB-VIEW', tagName: 'WEB-VIEW',
type: 'download', type: 'download',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册