From d421f729d5a1203dac66772fe4d49c2917b318c5 Mon Sep 17 00:00:00 2001 From: Anish Roy <115141578+pshycodr@users.noreply.github.com> Date: Tue, 18 Feb 2025 22:03:10 +0530 Subject: [PATCH 1/3] Add more detail about SKIP_EMAIL_VERIFICATION_IN_DEV to e2e tests README Fixes #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. --- template/app/.env.server.example | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/app/.env.server.example b/template/app/.env.server.example index 65d02b9e..a3b19be2 100644 --- a/template/app/.env.server.example +++ b/template/app/.env.server.example @@ -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 \ No newline at end of file +AWS_S3_REGION=your-region + +# Skip email verification in development mode +SKIP_EMAIL_VERIFICATION_IN_DEV=true From 5795a551fbdce4ba59e5d291f7d369ef6cbf234a Mon Sep 17 00:00:00 2001 From: Anish Roy <115141578+pshycodr@users.noreply.github.com> Date: Fri, 21 Feb 2025 08:13:45 +0530 Subject: [PATCH 2/3] Update .env.server.example Update README with SKIP_EMAIL_VERIFICATION_IN_DEV instructions and remove default from .env --- template/app/.env.server.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/app/.env.server.example b/template/app/.env.server.example index a3b19be2..3cd163ed 100644 --- a/template/app/.env.server.example +++ b/template/app/.env.server.example @@ -56,4 +56,4 @@ AWS_S3_FILES_BUCKET=your-bucket-name AWS_S3_REGION=your-region # Skip email verification in development mode -SKIP_EMAIL_VERIFICATION_IN_DEV=true +# SKIP_EMAIL_VERIFICATION_IN_DEV=true From 3f74acac57d3df3b72e560778811ae4a71085002 Mon Sep 17 00:00:00 2001 From: Anish Roy <115141578+pshycodr@users.noreply.github.com> Date: Fri, 21 Feb 2025 08:31:56 +0530 Subject: [PATCH 3/3] 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! --- template/e2e-tests/README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/template/e2e-tests/README.md b/template/e2e-tests/README.md index 2b8cad78..7f32234f 100644 --- a/template/e2e-tests/README.md +++ b/template/e2e-tests/README.md @@ -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