Cypress · Junior · Pytanie 19 z 75
Która asercja sprawdza wartość pola?
- 1
.should('have.value', 'John') - 2
.should('have.text', 'John') - 3
.should('equal.value', 'John')
Pokaż odpowiedź
Poprawna odpowiedź: .should('have.value', 'John')
Wyjaśnienie
Wartości pól to nie treść tekstowa. have.value czyta bieżącą wartość; have.text czyta węzły tekstowe.