提交 30b06434 编写于 作者: A Anne_LXM

update test

上级 ab93fe52
......@@ -83,5 +83,8 @@
},
"dependencies": {
"qrcodejs2": "^0.0.2"
},
"devDependencies": {
"jest-image-snapshot": "^6.4.0"
}
}
......@@ -14,7 +14,6 @@ describe('pages/grid/grid.vue', () => {
})
it('点击宫格', async () => {
const perPage = await page.$$('.grid-item-box')
// console.log('perPage: ',perPage);
expect(perPage.length).toBe(3)
for (var i = 0; i < perPage.length; i++) {
await perPage[i].tap()
......
......@@ -6,10 +6,10 @@ describe('pages/list/list.vue', () => {
if(process.env.UNI_PLATFORM === "mp-weixin"){await page.waitFor(2000)}
})
it('检测标题', async () => {
// expect.assertions(1);
expect.assertions(1);
const getTitle = await page.data('dataList')
console.log('getTitle: ',getTitle);
// expect((await page.data('dataList')).title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务')
expect((await page.data('dataList')).title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务')
})
it('点击搜索跳转', async () => {
await page.callMethod('searchClick')
......
let pageIndex = 0
const pages = [
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd',
'/pages/ucenter/settings/settings',
'/pages/ucenter/ucenter',
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd'
'/uni_modules/uni-id-pages/pages/userinfo/userinfo',
]
let page;
......
......@@ -57,13 +57,12 @@ describe('pages/ucenter/ucenter.vue', () => {
it('我的积分', async () => {
if(!uniToken)return;
const getScoreRes = await page.callMethod('getScore')
let scoreInfo = getScoreRes && getScoreRes.result.data[0]
console.log('scoreInfo: ',scoreInfo);
console.log('getScoreRes: ',getScoreRes);
await page.waitFor(500)
if (scoreInfo) {
if (getScoreRes.score) {
expect.assertions(2);
expect(scoreInfo.score).not.toBeUndefined();
expect(scoreInfo.balance).toBeGreaterThanOrEqual(scoreInfo.score);
expect(getScoreRes.score).not.toBeUndefined();
expect(getScoreRes.balance).toBeGreaterThanOrEqual(getScoreRes.score);
} else {
console.log("签到失败");
}
......
......@@ -269,7 +269,7 @@
title: msg,
icon: 'none'
});
return res
return res.result.data[0]
}).finally((err) => {
uni.hideLoading()
return err
......
......@@ -6,11 +6,11 @@ describe('uni_modules/uni-id-pages/pages/login/login-withpwd.vue', () => {
page = await program.navigateTo('/uni_modules/uni-id-pages/pages/login/login-withpwd')
await page.waitFor('view')
});
it('screenshot',async()=>{
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
await page.waitFor(500);
})
// it('screenshot',async()=>{
// const image = await program.screenshot();
// expect(image).toMatchImageSnapshot();
// await page.waitFor(500);
// })
it('账号密码登录', async () => {
await page.setData({
"username": "DCloud",
......@@ -28,8 +28,6 @@ describe('uni_modules/uni-id-pages/pages/login/login-withpwd.vue', () => {
const resLogin = await page.callMethod('pwdLogin')
console.log("resLogin: ", resLogin);
switch (resLogin.errCode){
case 0:
console.log('登录成功')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册