oesmith / puffing-billy

A rewriting web proxy for testing interactions between your browser and external sites. Works with ruby + rspec.
MIT License
656 stars 170 forks source link

Can I somehow save Cache and not use it in my tests? #286

Closed YosypVoloshchuk closed 4 years ago

YosypVoloshchuk commented 4 years ago

Hi All! I need to check that after some actions on UI side was sent api requests, I found that when I use cache = true in Billy.configure I can save all requests in some folder, but it will reuse all requests in my next steps. Can I somehow only write requests to folder and not reuse them?

ronwsmith commented 4 years ago

I think you can do this by changing cache_path for each scenario with around hooks.

YosypVoloshchuk commented 4 years ago

@ronwsmith Thanks for the answer, Can You please to clarify I using Capybara+Cucumber, so I have scenarios like

YosypVoloshchuk commented 4 years ago

I tried change cache_path after each step, but it is not help, on the last step requests are still reuse previous data that was cached

ronwsmith commented 4 years ago

Hmm, doesn't seem like it would work then.

YosypVoloshchuk commented 4 years ago

Ok. Thanks for answer