0
0
Cypresstesting~10 mins

cy.visit() for page navigation in Cypress - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to visit the homepage using Cypress.

Cypress
cy.[1]('https://example.com')
Drag options to blanks, or click blank then click option'
Avisit
Bclick
Cget
Dcontains
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like cy.click() or cy.get() instead of cy.visit() for navigation.
2fill in blank
medium

Complete the code to visit the login page with Cypress.

Cypress
cy.[1]('/login')
Drag options to blanks, or click blank then click option'
Acontains
Bclick
Cget
Dvisit
Attempts:
3 left
💡 Hint
Common Mistakes
Using cy.get() or cy.click() instead of cy.visit().
3fill in blank
hard

Fix the error in the code to correctly navigate to the dashboard page.

Cypress
cy.[1]('/dashboard')
Drag options to blanks, or click blank then click option'
Acontains
Bclick
Cvisit
Dget
Attempts:
3 left
💡 Hint
Common Mistakes
Using cy.click() or cy.get() instead of cy.visit().
Not including the leading slash in the URL.
4fill in blank
hard

Fill both blanks to visit the profile page and check the URL contains '/profile'.

Cypress
cy.[1]('/profile')
cy.url().should('[2]', '/profile')
Drag options to blanks, or click blank then click option'
Avisit
Binclude
Ccontain
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using click instead of visit.
Using 'contain' instead of 'include' in the assertion.
5fill in blank
hard

Fill all three blanks to visit the settings page, wait for 2 seconds, and then check the URL includes '/settings'.

Cypress
cy.[1]('/settings')
cy.[2](2000)
cy.url().should('[3]', '/settings')
Drag options to blanks, or click blank then click option'
Avisit
Bwait
Cinclude
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using click instead of visit.
Using should('contain') instead of should('include').
Not waiting before checking the URL.