提交 df06ae71 编写于 作者: A Anne_LXM

test:优化waitFor等待时间

上级 e622f6eb
......@@ -6,7 +6,7 @@ describe('pages/grid/grid.vue', () => {
beforeAll(async () => {
try{
page = await program.switchTab('/pages/grid/grid')
await page.waitFor(500)
await page.waitFor('view')
}catch(err){
console.log("err: ",err);
}
......@@ -24,7 +24,7 @@ describe('pages/grid/grid.vue', () => {
}
if (process.env.UNI_PLATFORM === "mp-weixin") {
const uniGrid = await page.$('uni-grid')
await page.waitFor(300)
await page.waitFor('uni-grid')
await uniGrid.callMethod('change')
await page.waitFor(500)
}
......
......@@ -3,7 +3,7 @@ describe('pages/list/list.vue', () => {
let page
beforeAll(async () => {
page = await program.switchTab('/pages/list/list')
await page.waitFor(500)
await page.waitFor('view')
})
it('检测标题', async () => {
......
......@@ -5,7 +5,7 @@ describe('pages/list/search/search.vue', () => {
let page
beforeAll(async () => {
page = await program.navigateTo('/pages/list/search/search')
await page.waitFor(500)
await page.waitFor('view')
})
it('搜索发现-显示-隐藏', async () => {
expect.assertions(2);
......
......@@ -8,7 +8,7 @@ describe('pages/ucenter/about/about.vue', () => {
isWX = process.env.UNI_PLATFORM === "mp-weixin"
if(!isWX){
page = await program.reLaunch('/pages/ucenter/about/about')
await page.waitFor(500)
await page.waitFor('view')
}
} catch (err) {
console.log("err: ",err);
......@@ -18,7 +18,7 @@ describe('pages/ucenter/about/about.vue', () => {
if(isWX){return}
expect.assertions(1);
expect((await page.data('about')).appName).toBe('uni-starter')
await page.waitFor(500)
// await page.waitFor(500)
await page.callMethod('navigateTo', {
url: "https://ask.dcloud.net.cn/protocol.html",
title: "用户服务条款"
......
......@@ -5,7 +5,7 @@ describe('pages/ucenter/settings/settings', () => {
beforeAll(async () => {
try {
page = await program.navigateTo('/pages/ucenter/settings/settings')
await page.waitFor(1000)
await page.waitFor('view')
uniToken = await page.data('uniToken')
console.log('uniToken:',uniToken);
} catch (err) {
......
......@@ -4,7 +4,7 @@ describe('pages/ucenter/ucenter.vue', () => {
beforeAll(async () => {
try{
page = await program.switchTab('/pages/ucenter/ucenter')
await page.waitFor(300)
await page.waitFor('view')
uniToken = await page.data('uniToken')
platform = process.env.UNI_PLATFORM
console.log("uniToken: ",platform,uniToken);
......
......@@ -5,7 +5,7 @@ describe('uni_modules/uni-id-pages/pages/login/login-withpwd.vue', () => {
let page;
beforeAll(async () => {
page = await program.navigateTo('/uni_modules/uni-id-pages/pages/login/login-withpwd')
await page.waitFor(500)
await page.waitFor('view')
page = await program.currentPage()
});
......
......@@ -3,7 +3,7 @@ describe('uni_modules/uni-id-pages/pages/register/register.vue', () => {
let page
beforeAll(async () => {
page = await program.navigateTo('/uni_modules/uni-id-pages/pages/register/register')
await page.waitFor(500)
await page.waitFor('view')
})
it('注册账号', async () => {
......@@ -39,7 +39,7 @@ describe('uni_modules/uni-id-pages/pages/register/register.vue', () => {
isAgree: true
})
}
await page.waitFor(800)
await page.waitFor(300)
const resLogin = await page.callMethod('submit')
console.log("resLogin: ", resLogin);
......@@ -57,7 +57,6 @@ describe('uni_modules/uni-id-pages/pages/register/register.vue', () => {
break;
case "FunctionTimeout":
expect(resLogin.errMsg).toBe("[uni-id-co]: 请求云函数超时");
await page.waitFor(300)
const captchaEl = await page.$('.captcha-box')
await captchaEl.callMethod('getImageCaptcha')
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册