choose-location.test.js 1.1 KB
Newer Older
1
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
2
const isMP = platformInfo.startsWith('mp')
3

4 5
describe('dialog page', () => {
  if (process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
6 7 8 9 10
  	it('skip app-webview', () => {
  		expect(1).toBe(1)
  	})
  	return
  }
11 12
  if (isMP) {
  	it('skip mp', () => {
13 14 15 16
  		expect(1).toBe(1)
  	})
  	return
  }
17

18 19
	let page;
	let originLifeCycleNum;
20 21
  beforeAll(async () => {
    page = await program.reLaunch('/pages/API/choose-location/choose-location')
22 23 24
		await page.waitFor('view');

		originLifeCycleNum = await page.callMethod('getLifeCycleNum')
25 26 27

		await page.callMethod('chooseLocation')
		await page.waitFor(1000)
28 29 30
  });

  it('dialogPage should empty', async () => {
31 32
		const dialogPagesNum = await page.data('dialogPagesNum')
		expect(dialogPagesNum).toBe(0)
33 34 35 36 37 38 39 40 41 42
	})

	it('should trigger parent hide', async () => {
		const lifecycleNum = await page.callMethod('getLifeCycleNum')
		expect(lifecycleNum).toBe(originLifeCycleNum - 1)
	})

	afterAll(async () => {
		await page.callMethod('setLifeCycleNum', originLifeCycleNum)
  });
43
})