Comments (7)
Can you explained in a bit more detail what you mean by that?
from wdio-intercept-service.
@LakshmiYaswanth Please provide more detail in your question / request. What would be extremely helpful is if you could provide an example of asynchronous code using wdio-intercept-service that you would like to have work, but which does not currently work.
from wdio-intercept-service.
Maybe I can help:
Using typescript, I am not able to have my esLint able to infer the correct returned type of browser.getRequests() etc. etc.
I can see that the signature will depend if web
here are the types used in tsConfig:
"types": [ "node", "expect-webdriverio", "wdio-intercept-service", "@wdio/globals/types", "@wdio/cucumber-framework" ],
My dev dependencies:
"devDependencies": { "@angular/animations": "^16.2.1", "@angular/cdk": "^16.2.1", "@angular/common": "^16.2.1", "@angular/core": "^16.2.1", "@angular/forms": "^16.2.1", "@angular/material": "^16.2.1", "@angular/platform-browser": "^16.2.1", "@badisi/wdio-harness": "^3.0.3", "@types/jest": "^29.5.3", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", "@wdio/cli": "^8.14.6", "@wdio/config": "^8.14.6", "@wdio/cucumber-framework": "^8.14.6", "@wdio/globals": "^8.14.6", "@wdio/local-runner": "^8.14.6", "@wdio/logger": "^8.11.0", "@wdio/spec-reporter": "^8.14.0", "@wdio/static-server-service": "^8.14.0", "eslint": "^8.47.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-wdio": "^8.8.7", "http-server": "^14.1.1", "jest": "^29.6.2", "jest-circus": "^29.6.2", "npm-run-all": "^4.1.5", "prettier": "^3.0.2", "rxjs": "^7.8.1", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.1.6", "wdio-intercept-service": "^4.4.0", "webdriverio": "^8.14.6", "zone.js": "^0.13.1" }
At runtime, indeed promises are always returned by this plugin function but during compilation i keep getting eslint complaining that "await has no effect on this instruction"....everywhere...
Can you advise ? May I bring more details ?
from wdio-intercept-service.
Sounds like this is a duplicate of #229
from wdio-intercept-service.
Hello @christian-bromann , I have the same issue . I can't use this service in TS file.
Unexpected `await` of a non-Promise (non-"Thenable") value.eslint[@typescript-eslint/await-thenable](https://typescript-eslint.io/rules/await-thenable) (method) WebdriverIO.Browser.getRequests(options?: (WdioInterceptorService.GetRequestOptions & WdioInterceptorService.OnlyCompletedRequests) | undefined): WdioInterceptorService.CompletedRequest[] (+1 overload)
My types are correctly configured:
"types": ["node", "@wdio/globals/types", "@wdio/mocha-framework", "@wdio/cucumber-framework", "expect-webdriverio", "wdio-intercept-service"],
I think the types are not correctly seen by typescript
My snippet code:
const requestreturn = await browser.getRequests();
from wdio-intercept-service.
@lacell75 this package does not provide any types. If anyone wants to contribute this, that would be awesome, thank you!
from wdio-intercept-service.
@lacell75 that looks like just an ESLint error, just disable it. It's perfectly fine to await
something that isn't a promise. And indeed, the return value truly is a promise, so your code is correct as-is -- just the lint issue caused by #229
from wdio-intercept-service.
Related Issues (20)
- (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
- 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
- Getting [wdio-intercept-service]: the "index" property must be a non-negative integer error while trying to capture GET request HOT 1
- Intercepting XMLHttpRequests is broken HOT 6
- Why i can't intercept any request in my app?
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.