Complete the code to check the current URL's pathname using cy.location().
cy.location('[1]').should('eq', '/dashboard')
The pathname property of cy.location() returns the path part of the URL, such as /dashboard.
Complete the code to assert the URL's protocol is HTTPS using cy.location().
cy.location('[1]').should('eq', 'https:')
The protocol property returns the protocol part of the URL, like https: or http:.
Fix the error in the code to correctly check the URL's hash using cy.location().
cy.location().[1].should('eq', '#section1')
The hash property returns the part of the URL after the #, including the # itself.
Fill in the blank to assert the URL's host (including port if present) using cy.location().
cy.location().[1].should('eq', 'example.com:3000')
The host property returns the domain and port together (if the port is non-default), such as example.com:3000.
Fill all three blanks to create a test that checks the URL's origin, pathname, and search query using cy.location().
cy.location().[1].should('eq', 'https://example.com') cy.location().[2].should('eq', '/products') cy.location().[3].should('eq', '?category=books')
The origin property returns the protocol and domain. The pathname is the path after the domain. The search property returns the query string starting with ?.