get-launch-options-sync.test.js 1.2 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5
const PAGE_PATH = '/pages/API/get-launch-options-sync/get-launch-options-sync'

describe('getLaunchOptionsSync', () => {
  it('getLaunchOptionsSync', async () => {
    const page = await program.navigateTo(PAGE_PATH)
6
    await page.waitFor('view')
DCloud-WZF's avatar
DCloud-WZF 已提交
7 8 9 10
    await page.callMethod('getLaunchOptionsSync')
    const data = await page.data()
    expect(data.checked).toBe(true)
  })
11
  it('app onLaunch 和 getLaunchOptionsSync 结果一致', async () => {
12 13 14 15 16 17

    if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('android')) {
      // if android return
      expect(1).toBe(1)
    }

18 19 20 21 22 23
    const page = await program.navigateTo(PAGE_PATH)
    await page.waitFor('view')
    const res = await page.callMethod('compareOnLaunchRes')
    expect(res.appOnLaunch).toEqual(res.launchOptions)
  })
  it('app onShow 和 getEnterOptionsSync 结果一致', async () => {
24 25 26 27 28
    if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('android')) {
      // if android return
      expect(1).toBe(1)
    }

29 30 31 32 33
    const page = await program.navigateTo(PAGE_PATH)
    await page.waitFor('view')
    const res = await page.callMethod('compareOnShowRes')
    expect(res.appOnShow).toEqual(res.onShowOption)
  })
DCloud-WZF's avatar
DCloud-WZF 已提交
34
})