4 ms·
Show HN: Interceptor – mock AJAX requests at the browser level
- leesalminen 9y agoGood stuff. Thanks for sharing!
- Osiris 9y agoThis is a pretty cool tool. I'm currently working on a tool that addresses this problem in a different way, by standing up an API server that returns mock data based on the incoming request. It's targeted at an enterprise audience where dozens of APIs need to be mocked. This looks like a great solution for smaller teams or projects.
- pimterry 9y agoI built one of these myself recently, you might be interested: https://github.com/pimterry/mockttp https://github.com/pimterry/mockttp
- drewsymo 9y agoMight be a silly question, but is this any different to the Postman interceptor? Edit: yes it’s very different! Didn’t see that you could return different responses dynamically.
- jlebrech 9y agowow, I needed that 3 years ago.
- Nashooo 9y agoHow usable is this in for example webdriverio tests?
- amitmb 9y agowebdriverio tests are basically automation tests similar to selenium tests. Looking at FIREFOX PROFILE SERVICE(http://webdriver.io/guide/services/firefox-profile.html http://webdriver.io/guide/services/firefox-profile.html), it looks like you can only fire up the extensions, but not define actions like click or type. If that would have been the case, One could have intercepted the requests, defined their own response and have automated tests defined for an app/website. Have a look at the blog post to understand the proper use case.
- chatmasta 9y agoIdk about FF, but I’ve zuccessfully loaded extensions into chrome selenium in the past. It doesn’t work with chrome headless AFAIK
- equalunique 9y agoHaving finished reading Neuromancer, the domain "codemancers.com" paired with a technique for hacking the browser into thinking it's receiving communications from the outside, this submission seems a little tongue-in-cheek.
- yougotit 9y agoDoesn't seem to work