Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detail about SKIP_EMAIL_VERIFICATION_IN_DEV to e2e tests README #373

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion template/app/.env.server.example
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@ GOOGLE_ANALYTICS_PROPERTY_ID=123456789
AWS_S3_IAM_ACCESS_KEY=ACK...
AWS_S3_IAM_SECRET_KEY=t+33a...
AWS_S3_FILES_BUCKET=your-bucket-name
AWS_S3_REGION=your-region
AWS_S3_REGION=your-region

# Skip email verification in development mode
# SKIP_EMAIL_VERIFICATION_IN_DEV=true
21 changes: 18 additions & 3 deletions template/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,28 @@ Start your Wasp DB and leave it running:
cd ../app && wasp db start
```

### Skipping Email Verification in e2e Tests

Open another terminal and start the Wasp app with the environment variable set to skip email verification in development mode:
```shell

> [!IMPORTANT]
> 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.
>
> **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:

```bash
cd app && SKIP_EMAIL_VERIFICATION_IN_DEV=true wasp start
```

> [!IMPORTANT]
> 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!
#### What this step will do:
- **Automated Testing:** Skipping email verification ensures e2e tests run uninterrupted.
- **Consistent Behavior:** It guarantees login flows won’t break during automated test runs.
- **CI/CD Pipelines:** This variable should also be set in CI pipelines to avoid test failures.
```yaml
env:
SKIP_EMAIL_VERIFICATION_IN_DEV: "true"
```


In another terminal, run the local e2e tests:
```shell
Expand Down