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 test: pages/eventRegistration.js fails

See original GitHub issue

Where to find the issue

https://github.com/corona-warn-app/cwa-website/blob/master/cypress/integration/pages/eventRegistration.js

Describe the issue

npm ci
npm run test:prepare
npm run test

shows the test for pages/eventRegistration.js failing.

image

  Test Event Registration Page
    1) "before each" hook for "Basic page assertions"


  0 passing (660ms)
  1 failing

  1) Test Event Registration Page
       "before each" hook for "Basic page assertions":
     CypressError: `cy.visit()` failed trying to load:

http://localhost:8000/undefined/eventregistration

The response we received from your web server was:

  > 404: Not Found

This was considered a failure because the status code was not `2xx`.

Change was introduced by PR https://github.com/corona-warn-app/cwa-website/pull/1499.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeMcC399commented, Jul 19, 2021

There is new text in the README.md file which says:


  • Set the default language to test against: create a cypress.env.json file with the following values
  • Values can be “en” or “de”. Defaults to “en”
{
  "testEnvLang": "en"
}

The blog_spec.js test is carried out automatically on both the English (en) and German (de) pages. Could the eventregistration test also be aligned to test both languages automatically?

blog_spec.js uses clickLanguage to do this.

The instructions don’t say that the comments only apply to the eventregistration test. Where is the file cypress.env.json supposed to be created? (I had to read the cypress documentation to find out the answer: it goes into the root directory, next to cypress.json.)

0reactions
MikeMcC399commented, Jul 19, 2021

@chrisenitan

It looks like https://github.com/corona-warn-app/cwa-website/blob/master/cypress/integration/pages/eventRegistration.js is a work-in-progress which does not test the German language page correctly, even though the README.md suggests otherwise.

Please let us have your comments in the follow-on issue https://github.com/corona-warn-app/cwa-website/issues/1513.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page occasionally does not load from cy.visit() #2938 - GitHub
Your page did not fire its 'load' event within '60000ms'. You can try increasing the 'pageLoadTimeout' value in 'cypress.json' to wait longer.
Read more >
Error Messages | Cypress Documentation
We found an error preparing your test file. This message means that Cypress encountered an error when compiling and/or bundling your test file....
Read more >
Cypress task fails and complains that task event has not been ...
task('copycsvFile') failed with the following error: The 'task' event has not been registered in the plugins file. You must register it before ...
Read more >
Listen To The Application Events From Cypress Tests
How the Cypress tests can receive the DOM and jQuery events sent by ... to the event sent at the application's startup is...
Read more >
Filtering app errors in Cypress tests - YouTube
This video shows how Cypress catches exceptions thrown from the ... Then it shows how to register the error handler for all tests....
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