diff --git a/pages/API/download-file/download-file.test.js b/pages/API/download-file/download-file.test.js index 75aec1d7de326d5aaae573a506609df222fa03b0..fe16cecef1a034872ed7d587101548dfb6d155b4 100644 --- a/pages/API/download-file/download-file.test.js +++ b/pages/API/download-file/download-file.test.js @@ -20,24 +20,30 @@ describe('ExtApi-DownloadFile', () => { it('Check ', async () => { expect(res).toBe(true); - }); - - - if (!process.env.uniTestPlatformInfo.startsWith('web')) { - it('Check uni.env', async () => { - await page.callMethod('jest_downloadFile_with_uni_env'); - await page.waitFor(2000); - res = await page.data('jest_result'); - expect(res).toBe(true); - }); - - 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) - }) - } + }); + + + if (!process.env.uniTestPlatformInfo.startsWith('web')) { + it('Check uni.env', async () => { + await page.callMethod('jest_downloadFile_with_uni_env'); + await page.waitFor(2000); + res = await page.data('jest_result'); + expect(res).toBe(true); + }); + + // 15以下的模拟器所对应的xcode不能编译自定义插件 + let version = process.env.uniTestPlatformInfo + let split = version.split(" ") + version = parseInt(split[split.length - 1]) + 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 @@ -65,4 +71,4 @@ describe('ExtApi-DownloadFile', () => { res = await page.data('jest_result'); expect(res).toBe(true) }); -}); +}); diff --git a/pages/API/request/request.test.js b/pages/API/request/request.test.js index 3dfdafd9a99de89d815329a0035fc783fb259f6d..1931eac7fb2fc4571243a8afd8d0f540b6af7063 100644 --- a/pages/API/request/request.test.js +++ b/pages/API/request/request.test.js @@ -98,7 +98,7 @@ describe('ExtApi-Request', () => { 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 } @@ -130,10 +130,17 @@ describe('ExtApi-Request', () => { res = await page.data('jest_result'); expect(res).toBe(true) }) - 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) - }) + + // 15以下的模拟器所对应的xcode不能编译自定义插件 + let version = process.env.uniTestPlatformInfo + let split = version.split(" ") + 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) + }) + } }); diff --git a/pages/API/upload-file/upload-file.test.js b/pages/API/upload-file/upload-file.test.js index 981632660a72508dcf91fd2c30bab7129870633c..2789b9e9a16565ad3576dc2da7572aaa7b590347 100644 --- a/pages/API/upload-file/upload-file.test.js +++ b/pages/API/upload-file/upload-file.test.js @@ -34,14 +34,20 @@ describe('ExtApi-UploadFile', () => { await page.waitFor(2000); res = await page.data('jest_result'); expect(res).toBe(true) - }); - - 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) - }) + }); + + // 15以下的模拟器所对应的xcode不能编译自定义插件 + let version = process.env.uniTestPlatformInfo + let split = version.split(" ") + version = parseInt(split[split.length - 1]) + 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 if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) { @@ -66,4 +72,4 @@ describe('ExtApi-UploadFile', () => { res = await page.data('jest_result'); expect(res).toBe(true) }); -}); +});