clientDB.test.js 988 字节
Newer Older
study夏羽's avatar
study夏羽 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
describe('pages/clientDB/clientDB.vue', () => {
	let page
	beforeAll(async () => {
		// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
		page = await program.reLaunch('/pages/clientDB/clientDB')

		if (process.env.UNI_PLATFORM === "h5" || process.env.UNI_PLATFORM === "app-plus") {
			await page.waitFor(1000)
		}
		if (process.env.UNI_PLATFORM === "mp-weixin") {
			await page.waitFor(1000)
		}

		page = await program.currentPage()
	})
	
	beforeEach(async()=>{
		jest.setTimeout(5000)
		return false
	})

	it('当前页面-clientDB', async () => {
		// await page.waitFor(1000)
		//expect.assertions(2);
		expect(await page.path).toBe('pages/clientDB/clientDB')
		
		await page.waitFor(300)
		const list = await page.$('uni-list')
		console.log("list: ",list);
		// if(list){
		// 	const getList = await list.$$('.item')
		// 	console.log("getList: ",getList);
		// 	expect(getList.length).toBe(5)
		// }
		

	})

})