Complete the code to select an element with the class button using cy.get().
cy.get('[1]')
The cy.get() command uses CSS selectors. To select by class, prefix the class name with a dot .. So .button selects elements with class button.
Complete the code to select an element with the id submit using cy.get().
cy.get('[1]')
To select an element by its id in CSS selectors, prefix the id with a hash #. So #submit selects the element with id submit.
Fix the error in the code to select all input elements inside a form with class login.
cy.get('form[1] input')
To select elements inside a form with class login, use form.login input. The dot . indicates the class selector.
Fill both blanks to select all li elements that are direct children of a ul with class menu.
cy.get('ul[1] [2]li')
To select direct children, use the child combinator >. To select ul with class menu, use ul.menu. So the full selector is ul.menu > li.
Fill both blanks to select all button elements with class primary inside a div with id container.
cy.get('div[1] button[2]')
The selector div#container button.primary selects button elements with class primary inside a div with id container. Spaces separate elements in the hierarchy.