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

test: 调整测试例兼容web端

上级 8f3c1133
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
jest_set_cookie(){ jest_set_cookie(){
uni.request({ uni.request({
url: "http://request.dcloud.net.cn/api/http/header/setCookie", url: "https://request.dcloud.net.cn/api/http/header/setCookie",
method: "GET", method: "GET",
timeout: 6000, timeout: 6000,
sslVerify: false, sslVerify: false,
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
jest_delete_cookie(){ jest_delete_cookie(){
uni.request({ uni.request({
url: "http://request.dcloud.net.cn/api/http/header/deleteCookie", url: "https://request.dcloud.net.cn/api/http/header/deleteCookie",
method: "GET", method: "GET",
timeout: 6000, timeout: 6000,
sslVerify: false, sslVerify: false,
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
}, },
jest_cookie_download(needCookie: boolean){ jest_cookie_download(needCookie: boolean){
uni.downloadFile({ uni.downloadFile({
url: "http://request.dcloud.net.cn/api/http/header/download", url: "https://request.dcloud.net.cn/api/http/header/download",
success: () => { success: () => {
this.jest_result = needCookie ? true : false; this.jest_result = needCookie ? true : false;
}, },
......
const PAGE_PATH = '/pages/API/get-system-setting/get-system-setting' const PAGE_PATH = '/pages/API/get-system-setting/get-system-setting'
describe('ExtApi-GetSystemSetting', () => { describe('ExtApi-GetSystemSetting', () => {
if (process.env.uniTestPlatformInfo.indexOf('web') > -1) {
it('web', () => {
expect(1).toBe(1)
})
return
}
let page; let page;
let res; let res;
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
title: 'request', title: 'request',
res: '', res: '',
task: null as RequestTask | null, task: null as RequestTask | null,
host: "http://request.dcloud.net.cn", host: "https://request.dcloud.net.cn",
url: "/api/http/method/get", url: "/api/http/method/get",
method: "GET" as RequestMethod | null, method: "GET" as RequestMethod | null,
data: null as any | null, data: null as any | null,
...@@ -287,4 +287,4 @@ ...@@ -287,4 +287,4 @@
}, },
} }
} }
</script> </script>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
}, },
jest_set_cookie() { jest_set_cookie() {
uni.request({ uni.request({
url: "http://request.dcloud.net.cn/api/http/header/setCookie", url: "https://request.dcloud.net.cn/api/http/header/setCookie",
method: "GET", method: "GET",
timeout: 6000, timeout: 6000,
sslVerify: false, sslVerify: false,
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
jest_delete_cookie() { jest_delete_cookie() {
uni.request({ uni.request({
url: "http://request.dcloud.net.cn/api/http/header/deleteCookie", url: "https://request.dcloud.net.cn/api/http/header/deleteCookie",
method: "GET", method: "GET",
timeout: 6000, timeout: 6000,
sslVerify: false, sslVerify: false,
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
jest_cookie_upload(needCookie : boolean) { jest_cookie_upload(needCookie : boolean) {
const imageSrc = "/static/uni.png"; const imageSrc = "/static/uni.png";
this.task = uni.uploadFile({ this.task = uni.uploadFile({
url: 'http://request.dcloud.net.cn/api/http/header/upload', url: 'https://request.dcloud.net.cn/api/http/header/upload',
filePath: imageSrc, filePath: imageSrc,
name: 'file', name: 'file',
success: (res : UploadFileSuccess) => { success: (res : UploadFileSuccess) => {
...@@ -196,4 +196,4 @@ ...@@ -196,4 +196,4 @@
font-size: 19px; font-size: 19px;
color: #808080; color: #808080;
} }
</style> </style>
...@@ -4,7 +4,13 @@ const PAGE_PATH_REDIRECT = '/pages/component/navigator/redirect' ...@@ -4,7 +4,13 @@ const PAGE_PATH_REDIRECT = '/pages/component/navigator/redirect'
describe('navigator', () => { describe('navigator', () => {
let page let page
beforeAll(async () => {}) beforeAll(async () => {
if(process.env.uniTestPlatformInfo.startsWith('web')) {
// 由于开发期间跳转页面需要编译,web端先跳转一次
await program.reLaunch(PAGE_PATH_NAVIGATE)
await program.reLaunch(PAGE_PATH_REDIRECT)
}
})
it('navigate', async () => { it('navigate', async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500) await page.waitFor(500)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册