Complete the code to check if the URL includes the word 'dashboard'.
cy.url().should([1], 'dashboard')
The contain assertion checks if the URL contains the given substring.
Complete the code to assert that the URL exactly matches 'https://example.com/home'.
cy.url().should([1], 'https://example.com/home')
The equal assertion checks if the URL exactly matches the given string.
Fix the error in the code to assert the URL starts with 'https://'.
cy.url().should('[1]', /^https:\/\//)
The match assertion is used to check if the URL matches the given regular expression.
Fill both blanks to assert the URL does not include 'login' and is not equal to 'https://example.com/login'.
cy.url().should([1], 'login').and('not.[2]', 'https://example.com/login')
First, we check the URL does not include 'login' with not.include, then assert it is not equal to the login page URL with not.equal.
Fill all three blanks to assert the URL matches regex /^https:\/\/app\./, contains 'dashboard', and is not equal to 'https://app.example.com/logout'.
cy.url().should('[1]', /^https:\/\/app\./).and('[2]', 'dashboard').and('not.[3]', 'https://app.example.com/logout')
We use match for regex, contain for substring, and not.equal to assert inequality.