{"repo":"webdriverio-community/wdio-intercept-service","free":true,"listed":false,"github":"https://github.com/webdriverio-community/wdio-intercept-service","clone":"git clone https://github.com/webdriverio-community/wdio-intercept-service.git","description":"🕸 Capture and assert HTTP ajax calls in webdriver.io","language":"JavaScript","stars":108,"topics":["wdio","webdriver","capturerequest","selenium","assess-requests"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"WebdriverIO Intercept Service ============================= 🕸 Capture and assert HTTP ajax calls in webdriver.io This is a plugin for webdriver.io. If you don't know it yet, check it out, it's pretty cool. Although selenium and webdriver are used for e2e and especially UI testing, you might want to assess HTTP requests done by your client code (e.g. when you don't have immediate UI feedback, like in metrics or tracking calls). With wdio-intercept-service you can intercept ajax HTTP calls initiated by some user action (e.g. a button press, etc.) and make assertions about the request and corresponding responses later. 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. If you're fine with that, this plugin might be for you, so read on. Prerequisites webdriver.io v5.x or newer. Heads up! If you're still using webdriver.io v4, please use the v2.x branch of this plugin! Installation Usage Usage with WebDriver CLI It should be as easy as adding wdio-intercept-service to your wdio.conf.js : and you're all set. Usage with WebDriver Standalone When using WebdriverIO Standalone, the before and beforeTest / beforeScenario functions need to be called manually. Once initialized, some related functions are added to your browser command chain (see ","default_branch":null,"files":null,"tree":[],"storefront":"/r/webdriverio-community","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/webdriverio-community/wdio-intercept-service/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}