Complete the code to start a Cypress component test for a Button component.
describe('Button component', () => { it('renders correctly', () => { cy.[1](<Button />) }) })
In Cypress component testing, cy.mount() is used to render the component for testing.
Complete the code to start an E2E test visiting the home page.
describe('Home page', () => { it('loads successfully', () => { cy.[1]('/') }) })
In Cypress E2E tests, cy.visit() is used to open a web page URL.
Fix the error in the E2E test code to check if a button with text 'Submit' exists.
cy.get('button').[1]('Submit')
The contains command finds an element with specific text content.
Fill both blanks to create a component test that mounts a component and checks if it contains text 'Hello'.
cy.[1](<Greeting />) cy.get('div').[2]('Hello')
First, mount renders the component. Then, contains checks for text inside an element.
Fill all three blanks to write an E2E test that visits the login page, types username, and clicks the submit button.
cy.[1]('/login') cy.get('input[name="username"]').[2]('user123') cy.get('button[type="submit"]').[3]()
Use visit to open the page, type to enter text, and click to press the button.