Navigate trough SPA inside a test #30457
Unanswered
zecka
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a website built with Next.js. Occasionally, a bug occurs during certain page transitions (the initial loading is fine).
To cover this type of bug, I would like to create a test scenario for a random user journey on my site.
In short, I want the homepage to be the entry point, then click on a random internal link, wait for the page to change, and check that there is no error message (I do this by checking for the presence of a specific div ID that exists on all pages but not on error pages). Then, click on another internal link on the page, check again that there is no error message, and so on, for X iterations.
I’m not very familiar with the asynchronous aspect of Cypress.
Here’s what I’ve done so far.
First, I created a command that retrieves a random internal link on the page:
And here’s my test scenario:
I’m really not sure if my approach is correct.
Additionally, I don't quite understand how to wait for the page change before proceeding with another click.
I already try to check url but some internal link have redirection so this will not work
Beta Was this translation helpful? Give feedback.
All reactions