question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress doesn't take correct snapshots in 'fullPage' mode in Electron and Chrome browsers

See original GitHub issue

Current behavior:

When I use cy.screenshot() in the test code for visual regression, I wanna take a picture of all DOM element, not only its visible part.

But cypress cannot capture the whole element. The screenshots have the correct size but with only recurring visible part.

screenshot example

Desired behavior:

To take full element as screenshot independently of the DOM element size or viewport settings

Steps to reproduce:

Test code:

it('Take a long snapshot', () => {
  cy.visit('https://twitter.com/Irine_Meier/status/1172003419458088960');
  cy.wait(2000);
  cy.get('#stream-items-id').screenshot({ capture: 'fullPage', scale: true });
});

I took twitter long read for example of App code

https://twitter.com/Irine_Meier/status/1172003419458088960

As u can see the getter #stream-items-id is the twitter tread, the DOM element has a specific length and width

Versions

Windows: win 10 x64 Cypress: 3.7.0 Browsers: Electron 73, Chrome 78

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
srinu-kodicommented, Mar 11, 2021

@jennifer-shehane Any thoughts on this. No library is helping out in the visual regression front with Cypress. It would be really great if someone from Cypress fixes the cy.screenshot() which is not taking fullPage screenshot… Could you please throw some light on this.

1reaction
azaeng04commented, May 12, 2020

@jennifer-shehane any proposed solution for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Run the same tests in both Electron and Chrome, then compare the screenshots/videos. Look for and isolate any differences in the Command Log....
Read more >
Launching Browsers | Cypress Documentation
To use this command in CI, you need to install the browser you want - or use one of our docker images. By...
Read more >
Cross Browser Testing - Cypress Documentation
Cypress has the capability to run tests across multiple browsers. Currently, Cypress has support for Chrome-family browsers (including Electron and.
Read more >
End-to-End Snapshot Testing - Cypress
But these end-to-end tests are running inside a real browser (Electron or any Chrome-based one), and just saving and loading a snapshot file ......
Read more >
Error Messages | Cypress Documentation
This message means that Cypress was unable to find tests in the specified file. You'll likely get this message if you have an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found