I have this test code
describe('smoke', () => {
it('should type e-mail', () => {
cy.visit('/auth/login');
cy.findByRole('textbox', { name: /Seu e-mail/i }).type(
'analyst@open-cred.com'
);
});
});
This is the HTML:
<div role="group" class="chakra-form-control css-1kxonj9">
<label for="email" id="field-:r1:-label" class="chakra-form__label css-1q3y7ys" data-invalid="">E-mail</label>
<input name="email" placeholder="Seu e-mail" type="text" id="email" class="chakra-input css-9m5lgx" value="" aria-invalid="true" aria-describedby="field-:r1:-feedback">
<div id="field-:r1:-feedback" aria-live="polite" class="chakra-form__error-message css-170ki1a">Um e-mail é necessário</div></div>
By W3 documentation a text input has role=textbox. But the test can't find the text input.
Does somebody know what I'm doing wrong?