提交 f7de525f 编写于 作者: 雪洛's avatar 雪洛

test: 低版本安卓不再进行截图对比

上级 c1674640
...@@ -25,26 +25,23 @@ describe('ExtApi-DownloadFile', () => { ...@@ -25,26 +25,23 @@ describe('ExtApi-DownloadFile', () => {
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1] version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9 shouldTestCookie = version > 9
} else if (process.env.uniTestPlatformInfo.startsWith('web')) { } else if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO 测试网址调整后放开此测试 // TODO 测试网址调整后放开此测试
shouldTestCookie = false shouldTestCookie = false
} }
it('Check Set Cookie', async () => {
if (!shouldTestCookie) { if (!shouldTestCookie) {
return return
} }
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie') res = await page.callMethod('jest_set_cookie')
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 Delete Cookie', async () => { it('Check Delete Cookie', async () => {
if (!shouldTestCookie) {
return
}
res = await page.callMethod('jest_delete_cookie') res = await page.callMethod('jest_delete_cookie')
await page.waitFor(2000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
......
...@@ -79,31 +79,27 @@ describe('ExtApi-Request', () => { ...@@ -79,31 +79,27 @@ describe('ExtApi-Request', () => {
await request(page, 'HEAD'); await request(page, 'HEAD');
}); });
let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.indexOf('web') === -1) {
it('Check Set Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1] version = parseInt(version.split(" ")[1])
if(version > 9){ shouldTestCookie = version > 9
}
if (!shouldTestCookie) {
return
}
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie') res = await page.callMethod('jest_set_cookie')
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 Delete Cookie', async () => { it('Check Delete Cookie', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_delete_cookie') res = await page.callMethod('jest_delete_cookie')
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)
}
}
}); });
}
}); });
const PAGE_PATH = '/pages/API/upload-file/upload-file' const PAGE_PATH = '/pages/API/upload-file/upload-file'
describe('ExtApi-UploadFile', () => { describe('ExtApi-UploadFile', () => {
if(process.env.uniTestPlatformInfo.startsWith('web')){ if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO: web 端暂不支持测试 // TODO: web 端暂不支持测试
it('web', async () => { it('web', async () => {
expect(1).toBe(1) expect(1).toBe(1)
...@@ -29,32 +29,32 @@ describe('ExtApi-UploadFile', () => { ...@@ -29,32 +29,32 @@ describe('ExtApi-UploadFile', () => {
expect(res).toBe(true); expect(res).toBe(true);
}); });
it('Check Set Cookie', async () => { it('Check files upload', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { res = await page.callMethod('jest_files_upload')
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
res = await page.callMethod('jest_set_cookie')
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 Delete Cookie', async () => {
let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1] version = parseInt(version.split(" ")[1])
if(version > 9){ shouldTestCookie = version > 9
res = await page.callMethod('jest_delete_cookie') }
if (!shouldTestCookie) {
return
}
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
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 files upload', async () => { it('Check Delete Cookie', async () => {
res = await page.callMethod('jest_files_upload') res = await page.callMethod('jest_delete_cookie')
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)
......
...@@ -235,7 +235,20 @@ const PAGE_PATH = ...@@ -235,7 +235,20 @@ const PAGE_PATH =
"/pages/webview-screenshot-comparison/webview-screenshot-comparison"; "/pages/webview-screenshot-comparison/webview-screenshot-comparison";
describe("shot-compare", () => { describe("shot-compare", () => {
if (process.env.uniTestPlatformInfo.startsWith("android")) { let shouldCompareScreenShot = false
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1])
shouldCompareScreenShot = version > 9
}
if (!shouldCompareScreenShot) {
it("other platform not support", async () => {
expect(1).toBe(1);
});
return
}
let page = null; let page = null;
let pageIndex = 0; let pageIndex = 0;
let baseSrc = ""; let baseSrc = "";
...@@ -341,9 +354,4 @@ describe("shot-compare", () => { ...@@ -341,9 +354,4 @@ describe("shot-compare", () => {
}, },
}); });
}); });
} else {
it("other platform not support", async () => {
expect(1).toBe(1);
});
}
}); });
...@@ -235,7 +235,19 @@ const PAGE_PATH = ...@@ -235,7 +235,19 @@ const PAGE_PATH =
"/pages/webview-screenshot/webview-screenshot"; "/pages/webview-screenshot/webview-screenshot";
describe("shot-compare", () => { describe("shot-compare", () => {
if (process.env.uniTestPlatformInfo.startsWith("android")) { let shouldCompareScreenShot = false
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1])
shouldCompareScreenShot = version > 9
}
if (!shouldCompareScreenShot) {
it("other platform not support", async () => {
expect(1).toBe(1);
});
return
}
let page = null; let page = null;
let pageIndex = 0; let pageIndex = 0;
let baseSrc = ""; let baseSrc = "";
...@@ -318,9 +330,4 @@ describe("shot-compare", () => { ...@@ -318,9 +330,4 @@ describe("shot-compare", () => {
}, },
}); });
}); });
} else {
it("other platform not support", async () => {
expect(1).toBe(1);
});
}
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册