提交 354384a3 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

test: 修改插件中访问网络api的自动化测试例,屏蔽14及以下模拟器

上级 3ca1ca4b
...@@ -20,24 +20,30 @@ describe('ExtApi-DownloadFile', () => { ...@@ -20,24 +20,30 @@ describe('ExtApi-DownloadFile', () => {
it('Check ', async () => { it('Check ', async () => {
expect(res).toBe(true); expect(res).toBe(true);
}); });
if (!process.env.uniTestPlatformInfo.startsWith('web')) { if (!process.env.uniTestPlatformInfo.startsWith('web')) {
it('Check uni.env', async () => { it('Check uni.env', async () => {
await page.callMethod('jest_downloadFile_with_uni_env'); await page.callMethod('jest_downloadFile_with_uni_env');
await page.waitFor(2000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true); expect(res).toBe(true);
}); });
it('Check Download File In UTS Module', async () => { // 15以下的模拟器所对应的xcode不能编译自定义插件
res = await page.callMethod('jest_uts_module_invoked') let version = process.env.uniTestPlatformInfo
await page.waitFor(2000); let split = version.split(" ")
res = await page.data('jest_result'); version = parseInt(split[split.length - 1])
expect(res).toBe(true) if(!process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios') || version > 14) {
}) it('Check Download File In UTS Module', async () => {
} res = await page.callMethod('jest_uts_module_invoked')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
})
}
}
let shouldTestCookie = false let shouldTestCookie = false
...@@ -65,4 +71,4 @@ describe('ExtApi-DownloadFile', () => { ...@@ -65,4 +71,4 @@ describe('ExtApi-DownloadFile', () => {
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
}); });
...@@ -98,7 +98,7 @@ describe('ExtApi-Request', () => { ...@@ -98,7 +98,7 @@ describe('ExtApi-Request', () => {
shouldTestCookie = version > 9 shouldTestCookie = version > 9
} }
if (process.env.uniTestPlatformInfo.startsWith('IOS') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) { if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
shouldTestCookie = true shouldTestCookie = true
} }
...@@ -130,10 +130,17 @@ describe('ExtApi-Request', () => { ...@@ -130,10 +130,17 @@ describe('ExtApi-Request', () => {
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}) })
it('Check Post In UTS Module', async () => {
res = await page.callMethod('jest_uts_module_invoked') // 15以下的模拟器所对应的xcode不能编译自定义插件
await page.waitFor(2000); let version = process.env.uniTestPlatformInfo
res = await page.data('jest_result'); let split = version.split(" ")
expect(res).toBe(true) version = parseInt(split[split.length - 1])
}) if(!process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios') || version > 14) {
it('Check Post In UTS Module', async () => {
res = await page.callMethod('jest_uts_module_invoked')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
})
}
}); });
...@@ -34,14 +34,20 @@ describe('ExtApi-UploadFile', () => { ...@@ -34,14 +34,20 @@ describe('ExtApi-UploadFile', () => {
await page.waitFor(2000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
it('Check Upload File In UTS Module', async () => { // 15以下的模拟器所对应的xcode不能编译自定义插件
res = await page.callMethod('jest_uts_module_invoked') let version = process.env.uniTestPlatformInfo
await page.waitFor(2000); let split = version.split(" ")
res = await page.data('jest_result'); version = parseInt(split[split.length - 1])
expect(res).toBe(true) if(!process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios') || version > 14) {
}) it('Check Upload File In UTS Module', async () => {
res = await page.callMethod('jest_uts_module_invoked')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
})
}
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
...@@ -66,4 +72,4 @@ describe('ExtApi-UploadFile', () => { ...@@ -66,4 +72,4 @@ describe('ExtApi-UploadFile', () => {
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册