detail.test.js 845 字节
Newer Older
A
Anne_LXM 已提交
1 2 3 4 5 6 7
describe('pages/user-info/detail.vue', () => {
	let page
	beforeAll(async () => {
		// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
		// page = await program.navigateTo('/pages/user-info/detail')
		page = await program.currentPage()
		await page.waitFor('view')
A
Anne_LXM 已提交
8
		await page.setData({"isTest":true})
A
Anne_LXM 已提交
9 10 11 12 13
	})
	it('点击修改',async()=>{
		// expect.assertions(1);
		const getQuery = await page.query
		console.log('getQuery: ',getQuery);
A
Anne_LXM 已提交
14
		if(getQuery.id || (getQuery.hobby_valuetotext && getQuery.hobby_valuetotext.length>0)){
A
Anne_LXM 已提交
15 16 17 18
			await page.callMethod('handleUpdate')
			await page.waitFor(1000)
			console.log('currentPage',await program.currentPage())
			expect((await program.currentPage()).path).toBe('pages/user-info/edit')
A
Anne_LXM 已提交
19 20
		}else{
			console.log('err query')
A
Anne_LXM 已提交
21
		}
A
Anne_LXM 已提交
22 23
	})
})