z-index.test.js 864 B

12345678910111213141516171819202122232425262728293031323334
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isAndroid = platformInfo.startsWith('android')
  3. describe('css-z-index', () => {
  4. let page;
  5. beforeAll(async () => {
  6. page = await program.reLaunch('/pages/CSS/layout/z-index');
  7. });
  8. if (isAndroid) {
  9. it('test crash', async () => {
  10. await page.setData({
  11. autoTest: true
  12. });
  13. const elements = await page.$$('view');
  14. expect(elements.length).toBeGreaterThan(0);
  15. await page.setData({
  16. autoTest: false
  17. });
  18. });
  19. }
  20. it('screenshot', async () => {
  21. const windowInfo = await program.callUniMethod('getWindowInfo');
  22. const image = await program.screenshot({
  23. deviceShot: true,
  24. area: {
  25. x: 0,
  26. y: windowInfo.safeAreaInsets.top + 44
  27. }
  28. });
  29. expect(image).toSaveImageSnapshot();
  30. });
  31. });