list.test.js 900 字节
Newer Older
study夏羽's avatar
study夏羽 已提交
1 2 3 4 5 6 7 8 9
describe('pages/list/list.vue', () => {

	let page
	beforeAll(async () => {
		page = await program.switchTab('/pages/list/list')
		await page.waitFor(500)
	})

	it('检测标题', async () => {
study夏羽's avatar
jest h5  
study夏羽 已提交
10
		// expect.assertions(1);
study夏羽's avatar
study夏羽 已提交
11
		const getData = await page.data('dataList')
study夏羽's avatar
study夏羽 已提交
12
		console.log("getData: ",getData);
study夏羽's avatar
study夏羽 已提交
13
		expect(getData.title).toBe('阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务')
study夏羽's avatar
study夏羽 已提交
14 15 16
	})
	
	it('点击搜索跳转', async () => {
study夏羽's avatar
update  
study夏羽 已提交
17
		// expect.assertions(2);
study夏羽's avatar
jest h5  
study夏羽 已提交
18
		await page.callMethod('searchClick')
study夏羽's avatar
study夏羽 已提交
19 20 21 22 23 24 25 26 27 28
		await page.waitFor(1000)
		
		if (process.env.UNI_PLATFORM != "mp-weixin") {
			// console.log("currentPage: --1",(await program.currentPage()).path);
			expect((await program.currentPage()).path).toBe('pages/list/search/search')
			await page.waitFor(500)
			
			await program.navigateBack()
			expect((await program.navigateBack()).path).toBe('pages/list/list')
		}
study夏羽's avatar
study夏羽 已提交
29 30
	})
})