native-view.test.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isMP = platformInfo.startsWith('mp')
  3. const isWeb = platformInfo.startsWith('web')
  4. const isAppWebView = process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true'
  5. const isIOS = platformInfo.startsWith('ios')
  6. describe('native-view.uvue', () => {
  7. if (isMP || isWeb || isAppWebView) {
  8. it('not support', () => {
  9. expect(1).toBe(1)
  10. })
  11. return
  12. }
  13. if(isIOS) {
  14. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  15. if(
  16. platformInfo.indexOf('14.5') != -1 ||
  17. platformInfo.indexOf('13.7') != -1 ||
  18. platformInfo.indexOf('12.4') != -1
  19. ){
  20. // TODO: 排查 ios 不兼容版本 测试异常原因
  21. it('14.5 13.7 12.4 测试异常', () => {
  22. expect(1).toBe(1)
  23. })
  24. return
  25. }
  26. }
  27. it('native-view检测init函数是否响应', async () => {
  28. page = await program.reLaunch('/pages/component/native-view/native-view')
  29. await page.waitFor('view')
  30. const value = await page.data('isLoad')
  31. expect(value).toBe(true)
  32. })
  33. })