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

test: 调整测试例兼容web端

上级 1dbba57c
......@@ -73,7 +73,7 @@
jest_set_cookie(){
uni.request({
url: "http://request.dcloud.net.cn/api/http/header/setCookie",
url: "https://request.dcloud.net.cn/api/http/header/setCookie",
method: "GET",
timeout: 6000,
sslVerify: false,
......@@ -90,7 +90,7 @@
jest_delete_cookie(){
uni.request({
url: "http://request.dcloud.net.cn/api/http/header/deleteCookie",
url: "https://request.dcloud.net.cn/api/http/header/deleteCookie",
method: "GET",
timeout: 6000,
sslVerify: false,
......@@ -106,7 +106,7 @@
},
jest_cookie_download(needCookie: boolean){
uni.downloadFile({
url: "http://request.dcloud.net.cn/api/http/header/download",
url: "https://request.dcloud.net.cn/api/http/header/download",
success: () => {
this.jest_result = needCookie ? true : false;
},
......
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 res;
......
......@@ -87,7 +87,7 @@
title: 'request',
res: '',
task: null as RequestTask | null,
host: "http://request.dcloud.net.cn",
host: "https://request.dcloud.net.cn",
url: "/api/http/method/get",
method: "GET" as RequestMethod | null,
data: null as any | null,
......@@ -287,4 +287,4 @@
},
}
}
</script>
</script>
......@@ -97,7 +97,7 @@
},
jest_set_cookie() {
uni.request({
url: "http://request.dcloud.net.cn/api/http/header/setCookie",
url: "https://request.dcloud.net.cn/api/http/header/setCookie",
method: "GET",
timeout: 6000,
sslVerify: false,
......@@ -114,7 +114,7 @@
jest_delete_cookie() {
uni.request({
url: "http://request.dcloud.net.cn/api/http/header/deleteCookie",
url: "https://request.dcloud.net.cn/api/http/header/deleteCookie",
method: "GET",
timeout: 6000,
sslVerify: false,
......@@ -131,7 +131,7 @@
jest_cookie_upload(needCookie : boolean) {
const imageSrc = "/static/uni.png";
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,
name: 'file',
success: (res : UploadFileSuccess) => {
......@@ -196,4 +196,4 @@
font-size: 19px;
color: #808080;
}
</style>
</style>
......@@ -4,7 +4,13 @@ const PAGE_PATH_REDIRECT = '/pages/component/navigator/redirect'
describe('navigator', () => {
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 () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册