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

fix: request、uploadfile、downloadfile的cookie自动化测试版本限制为Android9以上

上级 df7c17c2
......@@ -22,15 +22,27 @@ describe('ExtApi-DownloadFile', () => {
expect(res).toBe(true);
});
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
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')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
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(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
});
......@@ -82,16 +82,28 @@ describe('ExtApi-Request', () => {
if (process.env.uniTestPlatformInfo.indexOf('web') === -1) {
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(500);
res = await page.data('jest_result');
expect(res).toBe(true)
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')
await page.waitFor(500);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
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(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
}
});
......@@ -23,16 +23,28 @@ describe('ExtApi-UploadFile', () => {
});
it('Check Set Cookie', async () => {
res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
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')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check Delete Cookie', async () => {
res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
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(1000);
res = await page.data('jest_result');
expect(res).toBe(true)
}
}
});
it('Check files upload', async () => {
res = await page.callMethod('jest_files_upload')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册