I am trying to change a value on a native html5 range input with Cypress. Here is the code:
cy.get('input[type="range"]')
.invoke('val', 5)
.trigger('change')
I get an error that says:
CypressError: Timed out retrying: cy.invoke() errored because the property: 'val' does not exist on your subject.
cy.invoke() waited for the specified property 'val' to exist, but it never did.
I have confirmed the input does exist in the assertion. I have also confirmed it is selecting the proper element (range input.)
Any ideas on what the issue is and why this doesn't work? Cypress documentation indicates this would work for me as shown in their examples.