grid.test.js 712 字节
Newer Older
Anne_LXM's avatar
Anne_LXM 已提交
1
jest.setTimeout(20000)
A
Anne_LXM 已提交
2
describe('grid', () => {
A
Anne_LXM 已提交
3
	let page, hasLogin;
study夏羽's avatar
study夏羽 已提交
4
	beforeAll(async () => {
Anne_LXM's avatar
Anne_LXM 已提交
5
		page = await program.switchTab('/pages/grid/grid')
A
Anne_LXM 已提交
6
		await page.waitFor('view')
Anne_LXM's avatar
Anne_LXM 已提交
7 8 9 10 11
    if(process.env.UNI_PLATFORM === "mp-weixin"){
      await page.waitFor(5000)
    }else{
      await page.waitFor(2000)
    }
Anne_LXM's avatar
Anne_LXM 已提交
12 13
	})
	it('检测宫格', async () => {
A
Anne_LXM 已提交
14 15
		hasLogin = await page.data('hasLogin')
		let gridList = await page.data('gridList')
Anne_LXM's avatar
Anne_LXM 已提交
16
		console.log("gridList", gridList.length,hasLogin)
A
Anne_LXM 已提交
17
		expect(gridList.length).toBe(9)
study夏羽's avatar
study夏羽 已提交
18 19
	})
	it('点击宫格', async () => {
A
Anne_LXM 已提交
20 21 22 23
		const perPage = await page.$$('.grid-item-box')
		for (var i = 0; i < perPage.length; i++) {
			await perPage[i].tap()
			await page.waitFor(300)
study夏羽's avatar
测试  
study夏羽 已提交
24
		}
study夏羽's avatar
study夏羽 已提交
25 26
	})
});