Skip to content

Commit

Permalink
Update cy run configs and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jun 9, 2024
1 parent a278e00 commit c5dfc7f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 240 deletions.
17 changes: 17 additions & 0 deletions .idea/runConfigurations/Open.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The test environment uses [bun](https://bun.sh) ([but cypress still needs node A
You can run all the cypress tests in parallel with:

```shell
<local-pagy-dir>/e2e $ ./cy-test
./e2e/cy/test
```

Notice:
Expand All @@ -44,19 +44,27 @@ Notice:
You can limit the cypress test to a specific APP:

```shell
<local-pagy-dir>/e2e $ ./cy-test repro
./e2e/cy/test repro
```

#### Run the test interactively

You can also run the cypress test interactively (only one APP/file at the time) opening cypress UI:

```shell
<local-pagy-dir>/e2e $ ./cy-open demo
./e2e/cy/open demo
```

Notice: You can only run the spec file for the app that is running (e.g. `demo.cy.ts` in the example above)

## Reconciling test snapshots

The pagy e2e testing is mostly based on snapshots, so if you changed the pagy output you may need just to reconcile it with the
snapshot values by running this command (that runs the tests and stores their new value):

```shell
./e2e/cy/reconcile
```
---

See also [Ruby Test Environment](https://github.com/ddnexus/pagy/tree/master/test)
2 changes: 1 addition & 1 deletion e2e/cy-open → e2e/cy/open
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ app=$1
port=${2:-8080}

root="$(git rev-parse --show-toplevel)"
. "$root/scripts/root-pwd.sh"
. "$root/scripts/cd-and-back.sh"

start-test "bundle exec pagy $app -p $port" http://0.0.0.0:$port "cypress open"
10 changes: 10 additions & 0 deletions e2e/cy/reconcile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e

root="$(git rev-parse --show-toplevel)"
. "$root/scripts/cd-and-back.sh"

echo "Reconciling the test snapshots..."
echo > snapshots.js
./cy-test
File renamed without changes.
233 changes: 1 addition & 232 deletions e2e/snapshots.js

Large diffs are not rendered by default.

0 comments on commit c5dfc7f

Please sign in to comment.