Skip to content

Commit

Permalink
调整测试例跳过vue3的nvue页面(不支持自动化测试)
Browse files Browse the repository at this point in the history
  • Loading branch information
anne-xml committed Nov 22, 2024
1 parent 968baab commit 7f9e6d8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 9 additions & 1 deletion pages/tabBar/component/component.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
describe('pages/tabBar/component/component.nvue', () => {
let page
let page, containsVite, isApp;
containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
isApp = process.env.UNI_PLATFORM.includes('app')
if (containsVite && isApp) {
it('vue3', async () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page = await program.reLaunch('/pages/tabBar/component/component')
Expand Down
10 changes: 9 additions & 1 deletion pages/tabBar/extUI/extUI.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
describe('pages/tabBar/extUI/extUI.nvue', () => {
let page
let page, containsVite, isApp;
containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
isApp = process.env.UNI_PLATFORM.includes('app')
if (containsVite && isApp) {
it('vue3', async () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page = await program.reLaunch('/pages/tabBar/extUI/extUI')
Expand Down
4 changes: 0 additions & 4 deletions pages/template/vuex-vue/vuex.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/

let page, nvuePath, vuepath,containsVite, isApp;
containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
isApp = process.env.UNI_PLATFORM.includes('app')

function createTests(pagePath, type) {
return describe(`测试页面路径: ${pagePath}`, () => {
async function toScreenshot(imgName) {
Expand Down Expand Up @@ -67,7 +64,6 @@ vuepath = '/pages/template/vuex-vue/vuex-vue'
if (containsVite) {
console.log('vue3: ', containsVite);
if(isApp){
createTests(nvuePath, 'vue3-App-nvue');
createTests(vuepath, 'vue3-App-vue');
}else if(process.env.UNI_PLATFORM == 'h5'){
createTests(vuepath, 'vue3-H5-vue');
Expand Down

0 comments on commit 7f9e6d8

Please sign in to comment.