newsuk / AyeSpy

A performant visual regression testing tool
BSD 3-Clause "New" or "Revised" License
206 stars 13 forks source link

cropToSelector does not crop page regions correctly (chrome; not tested on firefox) #181

Closed rickschubert closed 5 years ago

rickschubert commented 5 years ago

Example config:

{
    "gridUrl": "http://localhost:4444/wd/hub",
    "baseline": "./baseline",
    "latest": "./latest",
    "generatedDiffs": "./generatedDiffs",
    "report": "./reports",
    "scenarios": [
        {
            "url": "https://www.google.com/",
            "label": "homepage-chrome",
            "cropToSelector": "#body",
            "viewports": [
                {
                    "height": 1080,
                    "width": 1400,
                    "label": "standard"
                },
                {
                    "height": 1080,
                    "width": 1920,
                    "label": "wide"
                },
                {
                    "height": 1080,
                    "width": 600,
                    "label": "mobile"
                }
            ],
            "wait": 0
        }
    ]
}

Actual screenshot taken: image

Aye-spy version: 4.3.0 Chrome version: Version 74.0.3729.108 (Official Build) (64-bit) ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72)

This happens across many different websites, not just google - from my perception it seems like cropToSelector never works correctly.

lukasr22 commented 5 years ago

Hello @rickschubert , Thank You for using AyeSpy. I was retesting same scenario with your config file and standard and wide image was all right. Mobile wasnt but because even google page on browser didnt restyle if window is smaller for this example is 600px. Image Attached image

Better option for mobile is using mobileEmulator option: https://github.com/newsuk/AyeSpy#mobile-emulator What version of Grid and chrome in grid do you using? I was tested it wit AyeSpy 4.3.0 Selenium grid version: 3.14.0 Chrome version: v:69.0.3497.100 Do you have more examples where cropToSelector doesn't work correctly? Thanks.

mdcruz commented 5 years ago

Closing this issue as there hasn't been any activity