Cypress eventRegistration test fails (canvas width)
See original GitHub issueWhere to find the issue
Cypress test suite eventRegistration.js.
Describe the issue
The Cypress test eventRegistration.js fails with the error:
expected <canvas#eventqrcode.d-none.eventqr-preview> to have attribute width with the value '827', but the value was '1654'
A related issue https://github.com/corona-warn-app/cwa-website/issues/2139 was already reported and resolved.
Steps to reproduce
npm run test:open
In Cypress console select and run:
eventRegistration.js
Suggested change
The Cypress test eventRegistration.js should be reviewed and updated to work with the current Event Registration form.
It looks like the changes from PR #2105 “Reintroducing multiQR functionality” broke the Cypress test.
Consider also making sure that the test covers the single and the multi QR code tabs of the Event Registration form.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Image diffing a Canvas using Cypress to detect visual ...
Configuring Cypress; Writing Cypress tests; Generating base snapshots; Building, serving and image diffing in CI; Analysing artifacts. Installing dependencies.
Read more >Test loading of image in Cypress - Stack Overflow
To check if an image has finished loading, the simplest way is to check the image's naturalWidth or naturalHeight property.
Read more >cy.click() failed because element is effective width and height ...
I'm encountering some flaky tests due to an element not being considered visible by Cypress, I don't understand what makes an element ...
Read more >Visual Testing - Cypress Documentation
Your visual styles may also rely on more than CSS, perhaps you want to ensure an SVG or image has rendered correctly or...
Read more >Canvas Visual Testing with Retries - Gleb Bahmutov
The test calls the first function that performs the Cypress commands. This function downloads the canvas PNG and calls the cy.task('compare') .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PR #2277 resolved this issue.
@brifemu Thank you very much for picking this up! I wish you and @dsarkar a good start in the New Year!