提交 84e919c0 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 修复自动化测试 vue 版本兼容

上级 c7121fbc
......@@ -18,7 +18,7 @@ describe('pages/grid/grid.vue', () => {
})
it('点击宫格', async () => {
if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM === "app-plus") {
if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM.startsWith("app")) {
const perPage = await page.$('.uni-grid-wrap')
await perPage.callMethod('change')
}
......
......@@ -17,23 +17,23 @@ describe('pages/ucenter/about/about.vue', () => {
})
it('screenshot', async () => {
if(isWX){
return
}
console.log("process.env.UNI_PLATFORM: ",process.env.UNI_PLATFORM);
expect.assertions(1);
expect((await page.data('about')).appName).toBe('uni-starter')
await page.waitFor(1000)
if (process.env.UNI_PLATFORM === "app-plus") {
if (process.env.UNI_PLATFORM.startsWith("app")) {
await program.screenshot({
path: "static/screenshot/about-app.png" // 默认项目根目录
})
await page.waitFor(1000)
await page.callMethod('navigateTo', {
url: "https://ask.dcloud.net.cn/protocol.html",
title: "用户服务条款"
})
}else if(process.env.UNI_PLATFORM === "mp-weixin"){
await program.screenshot({
path: "static/screenshot/about-weixin.png" // 默认项目根目录
})
}else if(process.env.UNI_PLATFORM === "h5"){
await program.screenshot({
path: "static/screenshot/about-h5.png" // 默认项目根目录
......
......@@ -15,7 +15,7 @@ describe('pages/ucenter/settings/settings', () => {
})
it('settings', async () => {
if (process.env.UNI_PLATFORM == "app-plus") {
if (process.env.UNI_PLATFORM.startsWith("app")) {
await page.callMethod('clearTmp')
// console.log(await page.data('pushIsOn'), "pushIsOn-------------");
const pushRes = await page.data('pushIsOn')
......
......@@ -24,7 +24,7 @@ describe('pages/ucenter/ucenter.vue', () => {
it('列表', async () => {
const getUcenterList = await page.data('ucenterList')
console.log("getUcenterList: ",getUcenterList);
if(process.env.UNI_PLATFORM === "app-plus"){
if(process.env.UNI_PLATFORM.startsWith("app")){
expect(getUcenterList.length).toBe(3)
}
......@@ -34,7 +34,7 @@ describe('pages/ucenter/ucenter.vue', () => {
it('普通签到', async () => {
if(uniToken){
if(process.env.UNI_PLATFORM === "app-plus"){
if(process.env.UNI_PLATFORM.startsWith("app")){
console.log('app-plus----普通签到');
const signInByAdRes = await page.callMethod('signInByAd')
console.log("signInByAdRes: ",signInByAdRes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册