validate.test.js 743 字节
Newer Older
A
Anne_LXM 已提交
1 2 3 4 5 6
describe('pages/clientDB/validate/validate.vue', () => {

	let page
	beforeAll(async () => {
		// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
		page = await program.reLaunch('/pages/clientDB/validate/validate')
A
Anne_LXM 已提交
7
		await page.waitFor('view')
A
Anne_LXM 已提交
8 9 10 11 12 13
	})
	
	it('点击切换navBar', async () => {
		//expect.assertions(1);
		const segmentedControl = await page.$('.segmented-control')
		const seControl = await segmentedControl.$$('.segmented-control__item')
A
Anne_LXM 已提交
14
		// console.log(await seControl[0].text());
DCloud-WZF's avatar
DCloud-WZF 已提交
15
		expect((await seControl[0].text()).trim()).toBe('实例demo')
A
Anne_LXM 已提交
16 17 18 19 20 21 22
		await seControl[1].tap()
		await page.waitFor(300)
		await seControl[2].tap()
		await page.waitFor(300)
	})

})