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

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

上级 bd6b3b80
......@@ -25,26 +25,23 @@ describe('ExtApi-DownloadFile', () => {
let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9
} else if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO 测试网址调整后放开此测试
shouldTestCookie = false
}
it('Check Set Cookie', async () => {
if (!shouldTestCookie) {
return
}
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
});
it('Check Delete Cookie', async () => {
if (!shouldTestCookie) {
return
}
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(2000);
res = await page.data('jest_result');
......
......@@ -79,31 +79,27 @@ describe('ExtApi-Request', () => {
await request(page, 'HEAD');
});
if (process.env.uniTestPlatformInfo.indexOf('web') === -1) {
it('Check Set Cookie', async () => {
let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let version = process.env.uniTestPlatformInfo
version = version.split(" ")[1]
if(version > 9){
version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9
}
if (!shouldTestCookie) {
return
}
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
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')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
}
});
const PAGE_PATH = '/pages/API/upload-file/upload-file'
describe('ExtApi-UploadFile', () => {
if(process.env.uniTestPlatformInfo.startsWith('web')){
if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO: web 端暂不支持测试
it('web', async () => {
expect(1).toBe(1)
......@@ -29,32 +29,32 @@ describe('ExtApi-UploadFile', () => {
expect(res).toBe(true);
});
it('Check Set 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_set_cookie')
it('Check files upload', async () => {
res = await page.callMethod('jest_files_upload')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
let shouldTestCookie = false
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')
version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9
}
if (!shouldTestCookie) {
return
}
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check files upload', async () => {
res = await page.callMethod('jest_files_upload')
it('Check Delete Cookie', async () => {
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
......
......@@ -235,7 +235,20 @@ const PAGE_PATH =
"/pages/webview-screenshot-comparison/webview-screenshot-comparison";
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 pageIndex = 0;
let baseSrc = "";
......@@ -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 =
"/pages/webview-screenshot/webview-screenshot";
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 pageIndex = 0;
let baseSrc = "";
......@@ -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.
先完成此消息的编辑!
想要评论请 注册