Skip to content

Commit 60d757e

Browse files
authored
Add more detail about SKIP_EMAIL_VERIFICATION_IN_DEV to e2e tests README (wasp-lang#373)
* Add more detail about SKIP_EMAIL_VERIFICATION_IN_DEV to e2e tests README Fixes wasp-lang#363 Add `SKIP_EMAIL_VERIFICATION_IN_DEV=true` to `template/app/.env.server.example` file. * Add a new section to the file to skip email verification in development mode. * Add `SKIP_EMAIL_VERIFICATION_IN_DEV=true` to the new section. * Update .env.server.example Update README with SKIP_EMAIL_VERIFICATION_IN_DEV instructions and remove default from .env * Update e2e-tests/README.md Added more detailed explanations about the SKIP_EMAIL_VERIFICATION_IN_DEV variable in e2e-tests/README.md, including its significance, usage in CI pipelines, and troubleshooting tips. Let me know if any additional clarifications are needed! * Remove SKIP_EMAIL_VERIFICATION_IN_DEV from .env
1 parent 6693d51 commit 60d757e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

template/e2e-tests/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,28 @@ Start your Wasp DB and leave it running:
1818
cd ../app && wasp db start
1919
```
2020

21+
### Skipping Email Verification in e2e Tests
22+
2123
Open another terminal and start the Wasp app with the environment variable set to skip email verification in development mode:
22-
```shell
24+
25+
> [!IMPORTANT]
26+
> When using the email auth method, a verification link is typically sent when a user registers. If you're using the default Dummy provider, this link is logged in the console.
27+
>
28+
> **However, during e2e tests, this manual step will cause the tests to hang and fail** because the link is never clicked. To prevent this, set the following environment variable when starting your app:
29+
30+
```bash
2331
cd app && SKIP_EMAIL_VERIFICATION_IN_DEV=true wasp start
2432
```
2533

26-
> [!IMPORTANT]
27-
> When using the email auth method a verification link is sent when the user registers, or logged to the console if you're using the default Dummy provider. You must click this link to complete registration. Setting SKIP_EMAIL_VERIFICATION_IN_DEV to "true" skips this verification step, allowing you to automatically log in. This step must be skipped when running tests, otherwise the tests will hang and fail as the verification link is never clicked!
34+
#### What this step will do:
35+
- **Automated Testing:** Skipping email verification ensures e2e tests run uninterrupted.
36+
- **Consistent Behavior:** It guarantees login flows won’t break during automated test runs.
37+
- **CI/CD Pipelines:** This variable should also be set in CI pipelines to avoid test failures.
38+
```yaml
39+
env:
40+
SKIP_EMAIL_VERIFICATION_IN_DEV: "true"
41+
```
42+
2843
2944
In another terminal, run the local e2e tests:
3045
```shell

0 commit comments

Comments
 (0)