Cypress check_anchor_links.js misses issues in FAQ
See original GitHub issueWhere to find the issue
cypress/integration/check_anchor_links.js
Describe the issue
The Cypress test cypress/integration/check_anchor_links.js does not find anchor link issues in the new FAQ structure under https://www.coronawarn.app/en/faq/results/ and https://www.coronawarn.app/de/faq/results/
Steps to reproduce
Manually introduce a bad anchor link into /src/data/faq.json.
npm run test:open
Select check_anchor_links.js
Note that the bad anchor link is not found
Suggested change
Add the directories:
/en/faq/results/and/de/faq/results/
to
cypress/integration/check_anchor_links.js
This is however not sufficient as then the test fails with a syntax error:
1) Check for broken anchor links
"/de/faq/results/" - Check for broken anchor links:
Error: Syntax error, unrecognized expression: #
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Testing The Anchor Links - Cypress
The anchor link leads nowhere. Of course, Guillermo quickly fixed the missing element IDs. Yet even then, he missed one of the problems...
Read more >Testing links with Cypress - Filip Hric
Let's say you want to test all the links in a navigation bar, ideally in most effective way. In this article I show...
Read more >Check if element has href if it does it shouldn't be empty ...
Just to illustrate the readability of Cypress chained commands. Remove the noise, just use chaining cy.get('Selector for the anchor tag')Β ...
Read more >Clicking anchor link to download file causes page load timeout
Clicking on a button downloads the file, but after downloading the file, the cypress waiting for page load which is not the expected...
Read more >Cypress Tips and Tricks - Gleb Bahmutov
Using a single cypress/integration/spec.js file to test a large web application quickly becomes difficult and time consuming. We have separatedΒ ...
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 Free
Top 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

Alternative confirmation as follows:
npx cypress run -s cypress/integration/check_anchor_links.js -c baseUrl=https://coronawarn.appThis command runs
check_anchor_links.json the production website https://coronawarn.app in headless mode using the default Electron browser.Thanks to @ahodzic2 for investigating the Cypress test cypress/integration/check_anchor_links.js, adding the directories
/en/faq/resultsand/de/faq/resultsand resolving the syntax issue arising! ππ»The steps
npm run test:openSelectcheck_anchor_links.jscause the test to run to completion. Bad links in
/en/faq/resultsand/de/faq/resultsare now identified.Therefore this issue is now resolved.
See also: