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

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

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