pull-zoom-image.test.js 864 B

123456789101112131415161718192021222324252627
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isAndroid = platformInfo.startsWith('android')
  3. const isIos = platformInfo.startsWith('ios')
  4. const isHarmony = platformInfo.startsWith('harmony')
  5. const isApp = isAndroid || isIos || isHarmony
  6. describe('pull-zoom-image', () => {
  7. if (!isApp) {
  8. it('not support', () => {
  9. expect(1).toBe(1)
  10. })
  11. return
  12. }
  13. it('screenshot', async () => {
  14. const page = await program.reLaunch('/pages/template/pull-zoom-image/pull-zoom-image');
  15. await page.waitFor('view');
  16. await page.waitFor(1000);
  17. const windowInfo = await program.callUniMethod('getWindowInfo');
  18. const image = await program.screenshot({
  19. deviceShot: true,
  20. area: {
  21. x: 0,
  22. y: windowInfo.safeAreaInsets.top + 44
  23. }
  24. });
  25. expect(image).toSaveImageSnapshot();
  26. });
  27. });