Cypress - Element Interactions
You want to clear an input field only if it contains any text. Which Cypress code snippet correctly does this?
invoke('val') to get the current value of the input.then, clear only if the value is not empty.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions