element-getnativeview.test.js 1.2 KB
Newer Older
shutao-dc's avatar
shutao-dc 已提交
1 2 3 4 5 6 7 8 9
describe('get-native-view', () => {
  if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
    it('object', () => {
      expect(1).toBe(1)
    })
    return
  }
  let page
  beforeAll(async () => {
10
    page = await program.reLaunch('/pages/API/get-native-view/element-getnativeview')
shutao-dc's avatar
shutao-dc 已提交
11 12 13 14 15 16 17 18 19 20
    await page.waitFor('web-view')
  })

  //检测view标签原生View是否匹配
  it('check_view_native_view', async () => {
    page.waitFor(100)
    const value = await page.callMethod('checkViewNativeView')
    expect(value).toBe(true)
  })

shutao-dc's avatar
shutao-dc 已提交
21
  //检测input标签原生View是否匹配
shutao-dc's avatar
shutao-dc 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34
  it('check_input_native_view', async () => {
    page.waitFor(100)
    const value = await page.callMethod('checkInputNativeView')
    expect(value).toBe(true)
  })

  //检测textarea标签原生View是否匹配
  it('check_textarea_native_view', async () => {
    page.waitFor(100)
    const value = await page.callMethod('checkTextareaNativeView')
    expect(value).toBe(true)
  })

shutao-dc's avatar
shutao-dc 已提交
35
  //检测webview标签原生View是否匹配
shutao-dc's avatar
shutao-dc 已提交
36 37 38 39 40 41 42
  it('check_web_view_native_view', async () => {
    page.waitFor(100)
    const value = await page.callMethod('checkWebViewNativeView')
    expect(value).toBe(true)
  })

})