Complete the code to select the first item in the list using Cypress.
cy.get('ul > li').[1]().should('have.length', 1)
The first() command selects the first element from the set of matched elements.
Complete the code to select the last button on the page using Cypress.
cy.get('button').[1]().should('be.visible')
The last() command selects the last element from the matched set.
Fix the error in the code to select the third item in the list using Cypress.
cy.get('li').[1](2).should('contain.text', 'Item 3')
The eq(index) command selects the element at the given zero-based index. Index 2 means the third element.
Fill both blanks to select the second item and check it contains the correct text.
cy.get('ul > li').[1]([2]).should('contain.text', 'Second item')
Use eq(1) to select the second element because indexing starts at zero.
Fill all three blanks to select the last item, check its text, and then select the first item.
cy.get('li').[1]().should('contain.text', [2]); cy.get('li').[3]().should('exist')
First, select the last item with last(), check its text, then select the first item with first().