native-view.test.js 1.1 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isMP = platformInfo.startsWith('mp')

shutao-dc's avatar
shutao-dc 已提交
4
describe('native-view.uvue', () => {
DCloud-WZF's avatar
DCloud-WZF 已提交
5 6 7 8 9 10 11
  if (isMP) {
  	it('skip mp', () => {
  		expect(1).toBe(1)
  	})
  	return
  }

shutao-dc's avatar
shutao-dc 已提交
12 13 14 15 16 17
  if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
    it('object', () => {
      expect(1).toBe(1)
    })
    return
  }
18 19 20 21 22 23 24 25

  if(process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) {
    const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
    if(
      platformInfo.indexOf('14.5') != -1 ||
      platformInfo.indexOf('13.7') != -1 ||
      platformInfo.indexOf('12.4') != -1
      ){
26 27 28 29
        // TODO: 排查 ios 不兼容版本 测试异常原因
        it('14.5 13.7 12.4 测试异常', () => {
          expect(1).toBe(1)
        })
30 31 32 33
        return
    }
  }

shutao-dc's avatar
shutao-dc 已提交
34 35 36 37 38 39 40 41 42
  beforeAll(async () => {
    page = await program.reLaunch('/pages/component/native-view/native-view')
  });

  it('native-view检测init函数是否响应', async () => {
    await page.waitFor(600)
    const value = await page.data('isLoad')
    expect(value).toBe(true)
  })
DCloud-WZF's avatar
DCloud-WZF 已提交
43
})