提交 c255655a 编写于 作者: Anne_LXM's avatar Anne_LXM

test fix space-storage locked

上级 69e3eac7
......@@ -11,8 +11,4 @@ describe('pages/storage/storage.vue', () => {
expect(await btnText[0].text()).toBe('空间内置云存储');
expect(await btnText[1].text()).toBe('扩展存储-七牛云');
})
it('空间内置云存储',async()=>{
await btnText[0].tap()
console.log("---",await program.currentPage())
})
})
\ No newline at end of file
// jest.setTimeout(20000)
describe('pages/user-info/list.vue', () => {
let page, currentPage;
console.log('uniTestPlatformInfo', process.env.uniTestPlatformInfo)
if (process.env.uniTestPlatformInfo == 'ios_simulator 13.7') {
it('ios', async () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page = await program.navigateTo('/pages/user-info/list')
await page.waitFor('view')
console.log('process----', process.env.UNI_PLATFORM)
})
async function waitTime() {
if (process.env.UNI_PLATFORM == 'mp-weixin') {
await page.waitFor(2000)
} else {
await page.waitFor(1000)
}
}
it('点击fab跳转到添加页', async () => {
await page.callMethod('fabClick')
await page.waitFor('view')
currentPage = await program.currentPage()
console.log('currentPage', currentPage)
expect(currentPage.path).toBe('pages/user-info/add')
await program.navigateBack()
await page.waitFor('view')
})
it('点击第一条', async () => {
await page.waitFor(2000)
const items = await page.$$('.uni-list-item')
if (items.length > 0) {
await items[0].tap()
await waitTime()
currentPage = await program.currentPage()
console.log('currentPage', currentPage)
expect(currentPage.path).toBe('pages/user-info/detail')
// await program.navigateBack()
// console.log('currentPage', await program.currentPage())
} else {
console.log('no items');
}
})
let page, currentPage;
console.log('uniTestPlatformInfo', process.env.uniTestPlatformInfo)
if (process.env.uniTestPlatformInfo == 'ios_simulator 13.7') {
it('ios', async () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
page = await program.navigateTo('/pages/user-info/list')
await page.waitFor('view')
console.log('process----', process.env.UNI_PLATFORM)
})
async function waitTime() {
if (process.env.UNI_PLATFORM == 'mp-weixin') {
await page.waitFor(2000)
} else {
await page.waitFor(1000)
}
}
it('点击fab跳转到添加页', async () => {
await page.callMethod('fabClick')
await page.waitFor('view')
await waitTime()
const jestResult = await page.data('jestResult')
expect(jestResult).toBe(true)
currentPage = await program.currentPage()
console.log('currentPage', currentPage)
expect(currentPage.path).toBe('pages/user-info/add')
await program.navigateBack()
await page.waitFor('view')
})
it('点击第一条', async () => {
await waitTime()
const items = await page.$$('.uni-list-item')
if (items.length > 0) {
await items[0].tap()
await waitTime()
currentPage = await program.currentPage()
console.log('currentPage', currentPage)
expect(currentPage.path).toBe('pages/user-info/detail')
// await program.navigateBack()
// console.log('currentPage', await program.currentPage())
} else {
console.log('no items');
}
})
})
\ No newline at end of file
......@@ -32,7 +32,9 @@
contentdown: '',
contentrefresh: '',
contentnomore: ''
}
},
// 自动化测试
jestResult:false
}
},
onPullDownRefresh() {
......@@ -62,7 +64,13 @@
clear: true
})
}
}
},
success: () => {
this.jestResult = true
},
fail: () => {
this.jestResult = false
}
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册