Git Product home page Git Product logo

Comments (4)

erwinheitzman avatar erwinheitzman commented on June 24, 2024 1

Not that I know of

from wdio-intercept-service.

christian-bromann avatar christian-bromann commented on June 24, 2024 1

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.

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

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!

from wdio-intercept-service.

SubhenduShekhar avatar SubhenduShekhar commented on June 24, 2024

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.

from wdio-intercept-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.