Complete the code to check if the page contains the text 'Welcome'.
cy.contains([1])The cy.contains() command expects a string argument to find text on the page. Using quotes around 'Welcome' ensures it is treated as a string.
Complete the assertion to verify the button is visible.
cy.get('button').should([1], true)
The correct assertion to check visibility in Cypress is should('be.visible'). This confirms the button is shown on the page.
Fix the error in the assertion to check the input has value 'test'.
cy.get('input').should('have.value', [1])
The value to check must be a string, so it needs quotes. Using 'test' is correct syntax in Cypress assertions.
Fill both blanks to assert the checkbox is checked and enabled.
cy.get('input[type=checkbox]').should([1]).and([2])
Use should('be.checked') to verify the checkbox is checked, and and('be.enabled') to confirm it is enabled for interaction.
Fill all three blanks to assert the list has 5 items, the first item contains 'Item 1', and the list is visible.
cy.get('ul > li').should([1], 5).first().should([2], [3]).parent().should('be.visible')
should('have.length', 5) checks the list has 5 items. should('contain.text', 'Item 1') verifies the first item includes the text 'Item 1'. Finally, should('be.visible') confirms the list is shown.