Recall & Review
beginner
What does
cy.go() do in Cypress?cy.go() moves the browser forward or backward in its history, similar to clicking the browser's back or forward buttons.
Click to reveal answer
beginner
How do you use
cy.go() to go back one page in browser history?Use cy.go('back') or cy.go(-1) to move back one page.
Click to reveal answer
intermediate
How do you move forward two pages in browser history using
cy.go()?Use cy.go('forward') or cy.go(2) to move forward two pages.
Click to reveal answer
beginner
What happens if you call
cy.go() without any arguments?Calling cy.go() without arguments does nothing; you must specify a direction or number.
Click to reveal answer
beginner
Can
cy.go() be used to reload the current page?No, cy.go() only navigates browser history. Use cy.reload() to reload the current page.
Click to reveal answer
Which command moves the browser back one page in Cypress?
✗ Incorrect
cy.go('back') moves the browser back one page in history.
What argument moves the browser forward two pages using
cy.go()?✗ Incorrect
Passing 2 or 'forward' to cy.go() moves forward two pages.
What does
cy.go() do if called without arguments?✗ Incorrect
cy.go() requires an argument; without it, it does nothing.
Which command should you use to reload the current page in Cypress?
✗ Incorrect
cy.reload() reloads the current page; cy.go() does not.
How do you move back two pages in browser history using
cy.go()?✗ Incorrect
Use cy.go(-2) to go back two pages.
Explain how to use
cy.go() to navigate browser history in Cypress.Think about browser back and forward buttons.
You got /4 concepts.
What is the difference between
cy.go() and cy.reload()?Consider what happens when you press browser refresh vs back button.
You got /4 concepts.