crane/docs/examples/end-to-end-testing.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
756 B
Markdown
Raw Normal View History

2024-03-02 20:21:29 +03:00
In addition to Unit and Integration tests, you can also write tests that
2023-10-13 04:59:36 +03:00
interact with your application as a real user would.
That technique is called End to End(E2E) testing.
In this example we have a workspace with two members:
* server: a web server that uses Axum for HTTP and Sqlx
connect to an instance of PostgreSQL
* e2e: a end-to-end test "script" that drives
Firefox into interacting with the sever
Quick-start an E2E project in a fresh directory with:
2023-10-13 04:59:36 +03:00
```sh
nix flake init -t github:ipetkov/crane#end-to-end-testing
```
Alternatively, if you have an existing project already, copy and paste the
following `flake.nix` and modify it to build your workspace's packages:
2023-10-13 04:59:36 +03:00
```nix
{{#include ../../examples/end-to-end-testing/flake.nix}}
```