0
0
Cypresstesting~5 mins

cy.go() for browser history in Cypress - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Acy.go('back')
Bcy.go('forward')
Ccy.reload()
Dcy.visit()
What argument moves the browser forward two pages using cy.go()?
A-2
B'back'
C2
D'forward'
What does cy.go() do if called without arguments?
AGoes forward one page
BReloads the page
CGoes back one page
DDoes nothing
Which command should you use to reload the current page in Cypress?
Acy.reload()
Bcy.go('reload')
Ccy.go(0)
Dcy.visit()
How do you move back two pages in browser history using cy.go()?
Acy.go(2)
Bcy.go('back')
Ccy.go(-2)
Dcy.go('forward')
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.