-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshots in macOS Safari: Unable to locate the page area - mark not found. #8154
Comments
I assume it has something to do with macOS rounded corners. But I don't know why there is no such problem in Chrome although it also has rounded corners in macOS. |
Hello @htho, TestCafe allows you to capture screenshots of the application at any point during a test run or when a test fails - this helps in debugging. However, please note that TestCafe does not include a scenario for visual regression tests. As a result, we cannot guarantee consistent screenshots across different versions. In theory, you can use TestCafe for screenshot testing, but since Safari and Chrome are two completely different browsers, their HTML rendering and screenshot mechanisms differ. This leads to visual discrepancies. We recommend comparing screenshots within the same browser, not across different ones. At this moment, we're unable to prioritize the task of adjusting the UI on screenshots for Safari as we have other priorities with our tasks. In the future, if this issue becomes more prominent, we will revisit the consideration of this improvement. |
Hello @PavelMor25 I am aware that screenshots from two different browsers can not simply be compared. Since there is the screenshot-feature in TestCafe, it makes sense for it to work - right? Anyway, I am willing to create a PR for this. |
We are always happy to consider all proposed changes. You can submit a pull request and include a description. We will review it and accept it if everything is okay. Before creating the fix, please take a look at our contributing guide |
## Purpose #8154 addresses the issue, where screenshots are not cropped on macOS (14) Safari. The problem is, that the screenshot mark can not be found. This is because part of the mark is not visible because of the rounded corners in macOS. ![312752882-4a8a5548-85e3-4805-855e-608366c74c8b](https://github.com/DevExpress/testcafe/assets/2182288/be53f18f-be1a-41ce-b432-26b68aa561e4) ## Approach The solution is to increase `MARK_RIGHT_MARGIN` in `src/screenshots/constants.js`. I found that `25` is the lowest value that works for all resolutions I was able to test. * In order for the tests to work I parametrized the tests to depend on `MARK_RIGHT_MARGIN`. * ~~I enabled the screenshot-tests that were skipped in the safari browser~~ * ~~fix tests~~ * ~~retina aware~~ * ~~color-profile aware~~ ## References #8154 ## Pre-Merge TODO - [x] Write tests for your proposed changes - [x] Make sure that existing tests do not fail --------- Co-authored-by: gti <support@gti.de>
fixed by #8161 |
What is your Scenario?
I do visual regression tests. Now I need to test Safari as well.
What is the Current behavior?
When I run the tests, the screenshot is not cropped - so the window chrome (frame, browser-bars etc.) is still included, and the mark is visible in the bottom right corner.
Test "Screenhot" - in Safari
What is the Expected behavior?
The screenshots should be cropped and not include the mark. Also there should be no warning in the log. Like for example in Chrome on macOS.
Test "Screenhot" - in Chrome
What is the public URL of the test page? (attach your complete example)
I created a repository at https://github.com/htho/testcafe-repro-screenshot-mark-macos-14
What is your TestCafe test code?
Your complete configuration file
none
Your complete test report
Screenshots
No response
Steps to Reproduce
% git clone https://github.com/htho/testcafe-repro-screenshot-mark-macos-14.git
% cd testcafe-repro-screenshot-mark-macos-14
% npm i
% npm run test
TestCafe version
3.5.0
Node.js version
21.6.2
Command-line arguments
testcafe safari screenshot.tc.ts
Browser name(s) and version(s)
Safari 17.3.1
Platform(s) and version(s)
macOS 14.3.1
Other
No response
The text was updated successfully, but these errors were encountered: