Looks well done (it uses unicode art, so it must be amazing) but I have a fundamental distrust/dislike of record/replay frameworks...just seems like you're papering over an inherently bad testing approach.<p>E.g. sure, when replays work, they're great, but:<p>a) you have to do a manual recording to create them the first time (which means manually setting up test data in production that is just-right for your test case)<p>b) you have to manually re-record when they fail (and again means you have manually go back and restore the test data in production that is just-right for your test case...and odds are you weren't the one who originally recorded this test, so good luck guessing exactly what that was).<p>In both cases, you've accepted that you can't easily setup specific, isolated test data in your upstream system, and are really just doing "slightly faster manual testing".<p>So, IMO, you should focus on solving the core issue: the uncontrollable upstream system.<p>Or, if you can't, decouple all of your automated tests from it fully, and just accept that cross-system tests against a datasource you can't control is not a fun/good way to write more than a handful of tests (e.g. ~5 smoke tests are fine, but ~100s of record/replay tests for minute boundary cases sounds terrible).
I would love to hear from people involved in projects like this, what kind of work/ how much, was done to get it ready for and approved to be open sourced by the company.<p>Especially at large corps like Netflix I'm sure there's a lot of hoops to jump through.
This is very cool, solving some issues I no doubt many people have when writing tests against a (fast-)moving target. I'll definitely give it a try in my next project.<p>I looked through the codebase, and noticed that this uses a custom data format to persist HTTP requests and responses in local storage. I'm not sure if it's technically possible in all circumstances, but I think it might be valuable to have requests and responses be stored as HAR 1.2 [1] when possible, so that the trace can be used by other tools [2] to aid in debugging, verifying and analyzing behaviour as well as perhaps automated creation of load/performance tests.<p>[1] - <a href="http://www.softwareishard.com/blog/har-12-spec/" rel="nofollow">http://www.softwareishard.com/blog/har-12-spec/</a><p>[2] - e.g. <a href="https://toolbox.googleapps.com/apps/har_analyzer/" rel="nofollow">https://toolbox.googleapps.com/apps/har_analyzer/</a>
There is already famous Policy package for .NET with same name<p><a href="https://github.com/App-vNext/Polly" rel="nofollow">https://github.com/App-vNext/Polly</a>
I used to use nock which would work very well in node environments. But this works in the browser as well. So I guess this can be fairly helpful while writing tests post development. If you are doing TDD, then recording/replaying doesn't fit anywhere in the development cycle.<p>I like the API of this library and the browser support that was missing in nock. So thanks Netflix! Although it would have been nice to see nock add this support. Which is what I wonder - why not just contribute to existing libraries.
Related to that, is there anything that allows to completely save the state of a modern website with all of the fetch requests and websocket related stuff it fired off?<p>I just want an ability to save and reopen exactly what I'm looking at. There are some cool websites which will eventually go down and I want to preserve an interactive snapshot of them.
So VCR gem for javascript. Great! Personally I stopped using VCR gem a while back as it blocks edge cases. However for larger projects where things can get unwieldily this makes a lot of sense. Local test suites should never hit external APIs so it's much better to have mocks/stubs than to have no tests at all.<p>However on smaller projects I've found that just clicking through to make sure things work and then letting my error reporting system catch bugs to be much more effective :)<p>It's a hard line to walk and I surely haven't perfected it. I'll give it a shot on a future project!
I personally replace all stubbed HTTP interactions between my services with contracts with good success. <a href="https://docs.pact.io/getting-started" rel="nofollow">https://docs.pact.io/getting-started</a>
I know this is slightly different, but I wish more people knew about Chrome / Safari / Firefox’s “network” console tab. Great for debugging. Can look at all requests, headers, responses, timespans, etc. Some will even let you copy a given network request as a cURL command, capturing all headers, body, query strings, etc.
I'm curious what the application could be for load testing? Tools like locust and gatling are nice but are still synthetic. I'd love to capture X minutes of traffic, then dupe it Y times and replay it as a more accurate representation of traffic patterns for load testing. Is that a thing?
I did something similar, but as an interim proxy (can record, replay, there are modifier hooks, can slow down requests). You have to point towards a backend api and on the frontend you use the proxy url instead of the original. But it's mostly for debugging, so the scope is much more limited.
Also check out <a href="https://github.com/code-mancers/interceptor" rel="nofollow">https://github.com/code-mancers/interceptor</a> which as well uses browser APIs to enable users to mock http responses via a chrome extension.
How does it hook into the browser APIs? I can't seem to find it.
By what black magic would it know how to hook into my puppeteer instance?
Or I'm I not understand this?
Why another tshark/tcpdump? all this can be done with a simple script with few lines. Today we need javascript recorders, traffic recorders are a kid game and using a certificate to touch https is a dangerous way (but every project there is doing same). Tshark and sslkeylogfile is the only safe way...
but I like this project I don't know why! I feel something.
is it a port of <a href="https://github.com/App-vNext/Polly" rel="nofollow">https://github.com/App-vNext/Polly</a> ?
Also, what's up with the in-your-face hiring pitch right in the documentation?<p><a href="https://netflix.github.io/pollyjs/#/README?id=we39re-hiring" rel="nofollow">https://netflix.github.io/pollyjs/#/README?id=we39re-hiring</a>