Open amirhoseinsalimi opened 1 year ago
Not that I know of
Afaik there is, just not using this service. WebdriverIO has some native capabilities like the abort
command that would allow this but these can only be run through the Devtools protocol which has its limitations.
The approach taken by my coworkers has been to do something similar to what this service does: wrap the fetch
/ XMLHttpRequest
object, filter the incoming URLs, and redirect / cancel them / etc as desired. That obviously only works when you get a chance to invoke your filter before the requests you'd like to block are made.
However, if you don't need to block the requests, just check they were made, then you can use getRequests
and perform your own matching on the returned objects. Right now the service requires you to specify the status code in order to use its assert
functionality.
A PR extending the capability to match just the method & url is welcomed!
You can write a custom command. Grab the sessionId
using browser.sessionId
and implement your actions using the jsonwire protocol.
I have done it in multiple scenarios and it has worked flawlessly.
Hi, I want to have the ability to abort the requests while testing so they don't get to the API server. Is there a way to do so?
Currenlty what I see is that requets are made to the server and 200 returns. I don't want to bother myself to check if the API server responds or not, I just want to make sure that the requets is being made.
Is there an API for this?