element-getnativeview.test.js 1.6 KB
Newer Older
shutao-dc's avatar
shutao-dc 已提交
1 2 3 4 5 6
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
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
  }

  const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()

  if (
    platformInfo.indexOf('14.5') != -1 ||
    platformInfo.indexOf('13.7') != -1 ||
    platformInfo.indexOf('12.4') != -1
  ) {
    // TODO: 排查 ios 不兼容版本 测试异常原因
    it('14.5 13.7 12.4 测试异常', () => {
      expect(1).toBe(1)
    })
    return
  }

shutao-dc's avatar
shutao-dc 已提交
23 24
  let page
  beforeAll(async () => {
25
    page = await program.reLaunch('/pages/API/get-native-view/element-getnativeview')
shutao-dc's avatar
shutao-dc 已提交
26 27 28 29 30 31 32 33 34 35
    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 已提交
36
  //检测input标签原生View是否匹配
shutao-dc's avatar
shutao-dc 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49
  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 已提交
50
  //检测webview标签原生View是否匹配
shutao-dc's avatar
shutao-dc 已提交
51 52 53 54 55 56 57
  it('check_web_view_native_view', async () => {
    page.waitFor(100)
    const value = await page.callMethod('checkWebViewNativeView')
    expect(value).toBe(true)
  })

})