Skip to content

Tag: cypress

Get native HTML element in Cypress

How do I get an underlying native HTMLElement (or Element or Node…) from a Cypress query? I would like to access the native HTMLElement instance in el. I have tried el[0] but the result is of type any. Answer In cypress, first() is a command that will be chained to .get() and retry for that whole select…

How to test a bad request in cypress

I am testing logging in POST method in cypress with incorrect credentials. this returns 400 bad requests which I need to test. This is what I have: The request that was sent: This is the response I get: I’d like to know what is in the response or body Answer The answer to your question is in the error m…