overflow.test.js 900 B

1234567891011121314151617181920212223242526272829
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isAndroid = platformInfo.startsWith('android')
  3. const isAppWebView = process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true'
  4. describe('component-native-overflow', () => {
  5. let page
  6. beforeAll(async () => {
  7. //打开list-view测试页
  8. page = await program.reLaunch('/pages/CSS/overflow/overflow')
  9. await page.waitFor("image")
  10. })
  11. //检测overflow设置hidden,visible
  12. it('check_view_overflow', async () => {
  13. if (isAndroid && !isAppWebView) {
  14. let version = process.env.uniTestPlatformInfo
  15. version = parseInt(version.split(" ")[1])
  16. //安卓7模拟器不截图 导致闪退
  17. if(version == 7) {
  18. return
  19. }
  20. }
  21. await page.waitFor(600)
  22. const image = await program.screenshot({
  23. fullPage: true,
  24. });
  25. expect(image).toSaveImageSnapshot();
  26. })
  27. })