Complete the code to create a test block using Cypress.
describe('My First Test', () => { it('[1]', () => { cy.visit('https://example.com') }) })
The it block describes what the test does. Here, it should say what is being checked, like 'checks the homepage loads'.
Complete the code to visit a URL inside an it block.
it('visits the page', () => { cy.[1]('https://example.com') })
cy.click() instead of cy.visit()cy.get() which selects elements, not pagesThe cy.visit() command loads a webpage in Cypress tests.
Fix the error in the it block to correctly check the page title.
it('checks the title', () => { cy.title().[1]('eq', 'Example Domain') })
get which selects elements, not assertionsvisit or click which are unrelated hereThe should command is used to make assertions in Cypress.
Fill both blanks to select an element and check its text.
it('checks header text', () => { cy.[1]('h1').[2]('contain', 'Welcome') })
click instead of getvisit instead of shouldcy.get() selects the element, and should('contain', ...) asserts its text.
Fill all three blanks to write a test that types into an input and checks its value.
it('types in input and checks value', () => { cy.[1]('input[name="username"]').[2]('user123') cy.[3]('input[name="username"]').should('have.value', 'user123') })
invoke instead of typeUse get to select the input, type to enter text, and get again to select for assertion.
