0
0
Cypresstesting~10 mins

Why navigation testing validates routing in Cypress - Test Your Understanding

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

Complete the code to visit the homepage in Cypress.

Cypress
cy.[1]('/')
Drag options to blanks, or click blank then click option'
Acontains
Bvisit
Cget
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'visit' to navigate.
2fill in blank
medium

Complete the code to check the URL path after navigation.

Cypress
cy.url().should('include', [1])
Drag options to blanks, or click blank then click option'
A'get'
B'click'
C'/dashboard'
D'/login'
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like 'click' or 'get' instead of a URL path string.
3fill in blank
hard

Fix the error in the assertion to verify the page contains the text 'Welcome'.

Cypress
cy.contains([1]).should('be.visible')
Drag options to blanks, or click blank then click option'
A'Welcome'
BWelcome
C"Welcome"
Dwelcome
Attempts:
3 left
💡 Hint
Common Mistakes
Passing unquoted text causing syntax errors.
4fill in blank
hard

Fill both blanks to assert the URL path and page title after navigation.

Cypress
cy.url().should('include', [1])
cy.title().should('eq', [2])
Drag options to blanks, or click blank then click option'
A'/profile'
B'User Profile'
C'/settings'
D'Settings Page'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing URL paths and titles in the wrong blanks.
5fill in blank
hard

Fill all three blanks to navigate, check URL, and verify page content.

Cypress
cy.[1]('/dashboard')
cy.url().should('include', [2])
cy.get([3]).should('contain.text', 'Dashboard Overview')
Drag options to blanks, or click blank then click option'
Avisit
B'/dashboard'
C'[data-cy=dashboard-header]'
Dclick
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'visit' for navigation.
Wrong selector format for the element.