Comments (7)
@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.
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.
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.
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.
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.
@andreluisce are the requests issued from an iframe?
from wdio-intercept-service.
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)
- How to stop intercepting / Setting the value of '__webdriverajax' exceeded the quota HOT 6
- Transition package from CJS to ESM HOT 3
- After updating to 4.3.0, attempting to get the network response when a filter is applied results in an error "Cannot read property trim of undefined" HOT 10
- (Version 4.2.2) Occasionally getting a java heap space error when running the network intercept too often HOT 1
- [Version 4.2.2] browser.disableInterceptor() is not a function HOT 1
- browser.getRequests() hanging without @wdio/sync module HOT 15
- Best practices with the wdio intercept service HOT 2
- Interceptor results are inconsistent
- Is there a way to abort the request? HOT 4
- Exception in .getRequests HOT 3
- Getting pending requests too HOT 1
- Intercepting segmentio messages HOT 5
- Not able to capture some api's called on Submit action HOT 4
- Cannot read property 'addCommand' of undefined HOT 11
- No request(empty array) returned from intercept service HOT 10
- Does getRequests() capture all the 'GET' calls in the network log? HOT 2
- can we have support async/await for wdio-intercept-service HOT 7
- wdio-intercept-service is not capturing requests invoked in iframe HOT 6
- Cypress does not intercept graphql query HOT 2
- Other request types not being collected HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wdio-intercept-service.