bug: emulate.viewport
crops the screenshot in E2E Screenshot tests
#5563
Labels
Resolution: Needs Investigation
This PR or Issue should be investigated from the Stencil team
Prerequisites
Stencil Version
4.13.0
Current Behavior
When using the
emulate.viewport
in thestencil.config.ts
the produced screenshot is just cropped to the sizes.Looks like this (see the background color, which exceeds the screenshot border):
![Screenshot 2024-03-21 at 16 46 54](https://private-user-images.githubusercontent.com/22612468/315527114-afcec6d3-206f-46ed-a4dc-0f1dd34a9f36.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzgwMTUsIm5iZiI6MTczOTAzNzcxNSwicGF0aCI6Ii8yMjYxMjQ2OC8zMTU1MjcxMTQtYWZjZWM2ZDMtMjA2Zi00NmVkLWE0ZGMtMGYxZGQzNGE5ZjM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE4MDE1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmNGUwOGNiMmQxNDVjY2Q2MDE2Y2IxODZkOTUzOTkyMmIzYzRlZGZhZTNmYjYyOGQ1MzhiOWExZGRkODUwMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.p-G75jPgTr4Jq01Edx6LfBwRtRBAx37YLnwwwbPFXWc)
Expected Behavior
I would expect, that the size of the screenshot is adapted, so we can test different device sizes. In an earlier version this was exactly the behaviour.
Should look like this:
![Screenshot 2024-03-21 at 16 46 02](https://private-user-images.githubusercontent.com/22612468/315527608-fc5244ef-51a8-482f-bcb5-b64f860784a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzgwMTUsIm5iZiI6MTczOTAzNzcxNSwicGF0aCI6Ii8yMjYxMjQ2OC8zMTU1Mjc2MDgtZmM1MjQ0ZWYtNTFhOC00ODJmLWJjYjUtYjY0Zjg2MDc4NGExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE4MDE1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzODYzNjBiNmM3Mjg3NGMzOTE2ZGM1ZTk1ZjRhNzY1Y2UzZmM5ODhlODA5MGZkNzM4MzQ3MDQ4YWU2MmM4MDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WJMFL05gKfTqkajpiYGVP6c31feZDqBGIz3y9XuybL8)
System Info
Steps to Reproduce
Run
npm run test.screenshot
in the test repo.Check the produced screenshots.
Code Reproduction URL
https://github.com/mlechler/stencil-e2e-test-bug
Additional Information
No response
The text was updated successfully, but these errors were encountered: