Complete the code to visit a webpage using Cypress.
cy.[1]('https://example.com')
The visit command loads a webpage in Cypress for testing.
Complete the code to check if an element contains specific text.
cy.get('.message').[1]('contain.text', 'Success')
The should command asserts that the element meets a condition, like containing text.
Fix the error in the code to wait for an API call to complete.
cy.intercept('GET', '/api/data').as('getData') cy.[1]('@getData')
The wait command pauses the test until the intercepted API call finishes.
Fill both blanks to create a test that checks a button click changes text.
cy.get('[1]').click() cy.get('[2]').should('contain.text', 'Clicked!')
The button with id #submit-btn is clicked, then the element with id #output is checked for changed text.
Fill all three blanks to write a test that types into input, submits form, and checks success message.
cy.get('[1]').type('hello@example.com') cy.get('[2]').click() cy.get('[3]').should('contain.text', 'Thank you')
Type email into #email-input, click #submit-button, then check .success-message for confirmation text.