Complete the code to select an element by its text using cypress-testing-library.
cy.[1]('Submit').click()
The getByText command selects an element by its visible text immediately.
Complete the code to assert that a button with label 'Save' is visible.
cy.[1]('button', { name: 'Save' }).should('be.visible')
getByRole selects an element by its ARIA role and accessible name synchronously, perfect for asserting visibility.
Fix the error in the code to correctly wait for an element with text 'Loading' to appear.
cy.[1]('Loading').should('exist')
findByText waits for the element to appear asynchronously, which is needed for dynamic content like loading indicators.
Fill both blanks to select an input by its placeholder text and type 'hello'.
cy.[1]('Enter your name').[2]('hello')
getByPlaceholderText selects the input by placeholder synchronously, and type enters text into it.
Fill all three blanks to select a checkbox by label text, check it, and verify it is checked.
cy.[1]('Accept Terms').[2]().should('[3]')
getByLabelText selects the checkbox by its label, check checks it, and be.checked asserts it is checked.