Skip to content

Commit

Permalink
test(vuex.test.js):规避某些ios设备
Browse files Browse the repository at this point in the history
  • Loading branch information
anne-xml committed Nov 22, 2024
1 parent 7f9e6d8 commit 2a37ccd
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions pages/template/vuex-vue/vuex.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
let page, nvuePath, vuepath,containsVite, isApp;
containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
isApp = process.env.UNI_PLATFORM.includes('app')
let page;
const containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite');
const isApp = process.env.UNI_PLATFORM.includes('app');
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase();

function createTests(pagePath, type) {
return describe(`测试页面路径: ${pagePath}`, () => {
async function toScreenshot(imgName) {
Expand All @@ -15,10 +17,16 @@ function createTests(pagePath, type) {
})
await page.waitFor(500);
}
if (platformInfo === 'ios_simulator 13.7') {
it('skip', async () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
page = await program.reLaunch(pagePath)
await page.waitFor('view');
console.log(type,page);
console.log(type, page);
await toScreenshot(type)
});
afterAll(async () => {
Expand Down Expand Up @@ -59,25 +67,25 @@ function createTests(pagePath, type) {
}

// vue3-nvue不支持自动化测试
nvuePath = '/pages/template/vuex-nvue/vuex-nvue'
vuepath = '/pages/template/vuex-vue/vuex-vue'
const nvuePath = '/pages/template/vuex-nvue/vuex-nvue'
const vuepath = '/pages/template/vuex-vue/vuex-vue'
if (containsVite) {
console.log('vue3: ', containsVite);
if(isApp){
if (isApp) {
createTests(vuepath, 'vue3-App-vue');
}else if(process.env.UNI_PLATFORM == 'h5'){
} else if (process.env.UNI_PLATFORM == 'h5') {
createTests(vuepath, 'vue3-H5-vue');
}else{
} else {
createTests(vuepath, 'vue3-Mp-vue');
}
} else{
} else {
console.log('vue2');
if(isApp){
if (isApp) {
createTests(nvuePath, 'vue2-App-nvue');
createTests(vuepath, 'vue2-App-vue');
}else if(process.env.UNI_PLATFORM == 'h5'){
} else if (process.env.UNI_PLATFORM == 'h5') {
createTests(vuepath, 'vue2-H5-vue');
}else{
} else {
createTests(vuepath, 'vue2-Mp-vue');
}
}

0 comments on commit 2a37ccd

Please sign in to comment.