Git Product home page Git Product logo

Comments (7)

PeterPimentel avatar PeterPimentel commented on May 28, 2024 1

@trietnguyen267 I had the same problem.
Solved it using the mock function https://webdriver.io/docs/mocksandspies/#spies

You are able to mock the graphql requests and then create a helper function to validate what you want based on the operationName.

const mocks = await browser.mock('**/graphql', { method: 'post' })

console.log(mock.calls[0].postData)

from wdio-intercept-service.

ruancarvalho avatar ruancarvalho commented on May 28, 2024

Hey @ThiagoMFerreira, did you had any progress with this kind of tests?
I believe I'm having the same issues.

It doesn't catch graphql requests, although they're shown in the network tab.

from wdio-intercept-service.

ThiagoMFerreira avatar ThiagoMFerreira commented on May 28, 2024

Hey @ThiagoMFerreira, did you had any progress with this kind of tests?
I believe I'm having the same issues.

It doesn't catch graphql requests, although they're shown in the network tab.

Hi @ruancarvalho any progress yet 😔

from wdio-intercept-service.

chmanie avatar chmanie commented on May 28, 2024

GraphQL requests are not particularly special. This plugin has been supporting fetch since v3 (https://github.com/chmanie/wdio-intercept-service/blob/master/CHANGELOG.md#---300--13022019).
Have you noticed this:

There's one catch though: you can't intercept HTTP calls that are initiated on page load (like in most SPAs), as it requires some setup work that can only be done after the page is loaded (due to limitations in selenium). That means you can just capture requests that were initiated inside a test.

from wdio-intercept-service.

andreluisce avatar andreluisce commented on May 28, 2024

Hey @chmanie Even though my requests happens inside my test, it does not capture the Grapqh requests. Do you have any thoughts about it?

from wdio-intercept-service.

tehhowch avatar tehhowch commented on May 28, 2024

@andreluisce are the requests issued from an iframe?

from wdio-intercept-service.

trietnguyen267 avatar trietnguyen267 commented on May 28, 2024

I had same problem when trying intercepting graphql request which it would return JSON data. it seems interceptor didnt recognised the requests as ajax calls at all

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.