Skip to content

Release 4.0.0

Choose a tag to compare

@github-actions github-actions released this 01 Aug 19:03
· 739 commits to main since this release

馃挜 Breaking Change

  • element screenshots are now automatically scrolled to the top of the screen before taking a screenshot. When done it will automatically scroll back to the original position. This will increase the accuracy but will also result in comparison errors when you migrate from version 3 to 4.

馃殌 New Features

  • add support for for iPhones/iPads in landscape mode
  • add support for landscape mode for Android phones and tablets when ChromeDriver screenshots are made

    NOTE: A ChromeDriver screenshot is taken by default, when you add the 'appium:nativeWebScreenshot': true-capability it will take a full screen (with status, address and toolbar) screenshot. Landscape mode will work for Android phones but not when enabled for Tablets

  • if a screenshot from a device was rotated this module will automatically rotate it back to landscape
  • iPads in landscape mode can have an opened side menu bar. This can result in errors for the screenshots when they are compared. When using the the following in your config the module options will automatically block out the side bar during comparisons, see code example and image below
    services: [
        [
            "image-comparison",
            // The options
            {
                // ... more options
                blockOutSideBar: true,
                // ... more options
            },
        ],
    ],

screenshot-IpadPro12 9Inch5thGenerationLandscape15-1024x1366

  • element screenshots are now automatically scrolled to the top of the screen before taking a screenshot. When done it will automatically scroll back to the original position. This will increase the accuracy

馃拝 Polish

  • Slower devices had issues with processing the injected CSS, this has now been improved

馃悰 Bug Fix

  • fix iOS 15 iPad address bar issues, see #76
  • fixes #77, return types are now Promises
  • fixes #45, Screen comparison for iPad(landscape) not fully ignoring address bar
  • fixes wswebcreation/webdriver-image-comparison#107, Full Page scrolling doesn't work out of the box for all websites
  • fix wswebcreation/webdriver-image-comparison#109, Throw proper error when element height/width is 0
    It will now throw a descriptive error when an element doesn't have the right dimensions to be used for an element screenshot
    Error: The element, with selector "$([id="root"])",is not visible. The dimensions are 1366x0
     at /Users/wimselles/Git/webdriver-image-comparison/lib/methods/rectangles.ts:45:11
     at step (/Users/wimselles/Git/webdriver-image-comparison/build/methods/rectangles.js:33:23)
     at Object.next (/Users/wimselles/Git/webdriver-image-comparison/build/methods/rectangles.js:14:53)
     at fulfilled (/Users/wimselles/Git/webdriver-image-comparison/build/methods/rectangles.js:5:58)
    
  • this module didn't take into account that iPhones in Landscape mode that had a notch (faceId) also have a safe area. Now this is properly calculated and (element) screenshots are now correct