Comments (6)
@MubarakGj thanks for raising the issue.
I have to verify if this may already work in v9 our upcoming major release. I will get back to you on that.
from webdriverio.
webdriverio/examples/devtools/intercept.js
Lines 17 to 31 in 247b729
from webdriverio.
Thanks for reporting!
We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!
from webdriverio.
In v9 this is currently not possible but can be implemented right here. What type of user interface would you like to see? How would you like to modify request data?
from webdriverio.
if we have a method somthing like, browser.intercept(params...) to modify the requests sent to a specific destination, calling the method should modify all the requests sent to the URL after this point.
for simple modifications . ex: if we want to modify an header and add one extra header to the request then,
browser.intercept("URL to intercept", {
headers:{
'header1':'value1', // modifies the value, if header already exists in request else adds the header
'header2':'value2'
}
});
this can directly add those headers to all the intercepted requests or modify them if they already exist.
for complex modifications, if we have sth like the below would be helpful:
browser.intercept("url to intercept", (req)=>{
req.headers = {'header1':'value1'} //replacing the whole header section
req.body['productId'] = '23456';
})
We can do even more things if we can intercept all the requests going out of the browser by giving a generic target URL value. something like "**/*" or "".
Also If we can have a way to set these interceptions at the browser session level (setting the interception once for all pages), we can avoid setting these on each page we navigate. This will help us to add the interception at the beginning of the script and we can intercept all requests till the execution is completed.
from webdriverio.
@MubarakGj this will be possible in v9, please follow #13055 for details!
from webdriverio.
Related Issues (20)
- [🐛 Bug]: Error installing @wdio/cli during project initialization HOT 2
- [🐛 Bug]: <@wdio/config:ConfigParser: Failed loading configuration file in CircleCi> HOT 1
- [🐛 Bug]: Error: There isn't any active suite! HOT 2
- [🐛 Bug]: Inconsistency with driver.lock HOT 3
- [🐛 Bug]: ts-node performs type check regardless of configuration HOT 1
- [📖 Docs]: <title> Fix mock.restore docs HOT 1
- [💡 Feature]: Improve `browser.mock` by enabling partial responses HOT 1
- [🐛 Bug]: allure-reporter - setting a custom message in matcher options makes the test to be reported as broken instead of failed HOT 5
- [🐛 Bug]: scrollIntoView does not scroll to the center of the viewport when used inside an iframe. HOT 3
- [🐛 Bug]: Jasmine and the JUnit reporter output empty spec files since v8.15.9 due to suite file property not including path HOT 1
- [🐛 Bug]: moz:debuggerAddress does not accept boolean value HOT 1
- [🐛 Bug]: <Scenarios with duplicated steps not failing> HOT 1
- [🐛 Bug]: WebdriverIO security vulnerability in dependency on puppeteer-core HOT 17
- [🐛 Bug]: V9 - TSC fails on Windows machine HOT 1
- [🐛 Bug]: Submit/ Save Button Remains Disabled After Using setValue Method in WebDriverIO Sync HOT 1
- [🐛 Bug]: Using the action function cannot accomplish the double-tap functionality of touchAction. HOT 6
- [🐛 Bug]: [V9][@wdio/logger]: Top-level await is currently not supported with the "cjs" output format HOT 1
- [🐛 Bug]: browser.mock throwing ErrorEvent HOT 4
- [🐛 Bug]: DETERMINISTIC FAILURE - Lingering Appium Process After Test Execution has Successfully Finished HOT 2
- [💡 Feature]: Support TypeScript in repl CLI command HOT 1
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 webdriverio.