validate.test.js 848 字节
Newer Older
A
Anne_LXM 已提交
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
describe('pages/clientDB/validate/validate.vue', () => {

	let page
	beforeAll(async () => {
		// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
		page = await program.reLaunch('/pages/clientDB/validate/validate')
		await page.waitFor(1000)
		page = await program.currentPage()
	})
	
	beforeEach(async()=>{
		jest.setTimeout(5000)
		return false
	})

	it('点击切换navBar', async () => {
		//expect.assertions(1);
		const segmentedControl = await page.$('.segmented-control')
		
		const seControl = await segmentedControl.$$('.segmented-control__item')
		// console.log(await seControl[0].text());
		expect(await seControl[0].text()).toBe('实例demo')
		
		await seControl[1].tap()
		await page.waitFor(300)
		
		await seControl[2].tap()
		await page.waitFor(300)
		
	})

})