grantjenks / django-replay

Django application that records and replays web requests.
https://grantjenks.com/docs/django-replay/
Other
4 stars 2 forks source link

Write the Docs #1

Open guettli opened 7 years ago

guettli commented 7 years ago

The title "Django Replay is an Apache2 licensed Django application that records and replays web requests." is exactly what I am looking for.

But now I don't know how to continue.

Please provide some docs.

Thank you.

grantjenks commented 7 years ago

There aren't any, I'm afraid. The app is barebones but pretty useful. The interface is through the Django admin and management commands. Here's a quick brain dump:

  1. Models: Scenario is a sequence of Actions. Actions have one or more Validators. Read the help text in the admin and it'll describe the fields. Check the admin commands too, I think it'll create validators for you based on response title and response status code. It'll also put actions into scenarios for you.
  2. Management commands: first is "record", that adds the RecorderMiddleware and starts the local development server. All the pages you visit using the development server then are recorded as actions. Second is "testscenario", with no arguments it runs all the scenarios and you can also give it a scenario name.
  3. Installation: add "replay" to the list of installed apps and run migrations as usual. I generally "record" and "testscenario" using development/test settings. In production the replay tables are all empty (don't record with production settings).

That's most of it. I had a client where I guaranteed 80% code coverage and I was too lazy to create unit tests so I made this. One really nice feature is that "testscenario" uses the Django test client so it runs through really quickly, much more quickly than Selenium would.

I'd love if you gave it a try and gave feedback. Pull requests also welcome.