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

test fix locked

上级 47616d53
const PAGE_PATH = '/pages/list/list' const PAGE_PATH = '/pages/list/list'
describe('list', () => { describe('list', () => {
let page, containsVite, isApp; let page, containsVite, isApp, currentPage;
containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite') containsVite = process.env.UNI_CLI_PATH.includes('uniapp-cli-vite')
isApp = process.env.UNI_PLATFORM.includes('app') isApp = process.env.UNI_PLATFORM.includes('app')
if (containsVite && isApp) { if (containsVite && isApp) {
it('vue3', async () => { it('vue3', async () => {
expect(1).toBe(1) expect(1).toBe(1)
}) })
return return
} }
beforeAll(async () => { beforeAll(async () => {
page = await program.switchTab(PAGE_PATH) page = await program.switchTab(PAGE_PATH)
await page.waitFor('view') await page.waitFor('view')
await page.setData({'isTest': true}) await page.setData({
}) 'isTest': true
it('检测标题', async () => { })
expect.assertions(1); })
await page.waitFor(5000) it('检测标题', async () => {
const getTitle = await page.data('dataList') expect.assertions(1);
console.log('getTitle: ', getTitle); await page.waitFor(5000)
expect(getTitle.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务') const getTitle = await page.data('dataList')
}) console.log('getTitle: ', getTitle);
it('点击搜索跳转', async () => { expect(getTitle.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务')
await page.callMethod('searchClick') })
await page.waitFor(300) it('点击搜索跳转详情页', async () => {
}) const items = await page.$('.uni-list-item')
await items.tap()
await page.waitFor(3000)
await page.waitFor('view')
currentPage = await program.currentPage()
console.log('currentPage: ', currentPage);
expect(currentPage.path).toBe('pages/list/detail')
})
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册