Beautiful Open-Source Form Builder
Fix E2E form event handling (#1207)
Julien Nahum92a084b3e579
diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.ymlindex 7721a62a5..67a44e950 100644--- a/.github/workflows/ci-cd.yml+++ b/.github/workflows/ci-cd.yml@@ -413,6 +413,7 @@ jobs:if: ${{ failure() && !cancelled() }}run: |docker compose -f docker-compose.e2e.yml logs --no-color > e2e-docker.log+ docker compose -f docker-compose.e2e.yml exec -T api cat storage/logs/laravel.log > e2e-laravel.log || trueif [ -f .e2e-ui.log ]; thencp .e2e-ui.log e2e-ui.logfi@@ -442,6 +443,7 @@ jobs:name: e2e-debug-logspath: |e2e-docker.log+ e2e-laravel.loge2e-ui.logif-no-files-found: ignoreretention-days: 14diff --git a/api/app/Listeners/Forms/FormCreationConfirmation.php b/api/app/Listeners/Forms/FormCreationConfirmation.phpindex a60666229..00dcaf473 100644--- a/api/app/Listeners/Forms/FormCreationConfirmation.php+++ b/api/app/Listeners/Forms/FormCreationConfirmation.php@@ -5,6 +5,7 @@ namespace App\Listeners\Forms;use App\Events\Models\FormCreated;use App\Mail\Forms\FormCreationConfirmationMail;use Illuminate\Contracts\Queue\ShouldQueue;+use Illuminate\Support\Facades\App;use Illuminate\Support\Facades\Mail;class FormCreationConfirmation implements ShouldQueue@@ -17,6 +18,10 @@ class FormCreationConfirmation implements ShouldQueue*/public function handle(FormCreated $event){+ if (App::environment('e2e')) {+ return;+ }+Mail::to($event->form->creator)->send(new FormCreationConfirmationMail($event->form));}}diff --git a/api/app/Listeners/Forms/FormSpamCheckListener.php b/api/app/Listeners/Forms/FormSpamCheckListener.phpindex 648027022..55e69c80b 100644--- a/api/app/Listeners/Forms/FormSpamCheckListener.php+++ b/api/app/Listeners/Forms/FormSpamCheckListener.php@@ -18,7 +18,7 @@ class FormSpamCheckListener implements ShouldQueuepublic function handle(FormSaved $event): void{- if (App::environment('testing')) {+ if (App::environment(['testing', 'e2e'])) {return;}diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.ymlindex 5353d2f31..216a230bc 100644--- a/docker-compose.e2e.yml+++ b/docker-compose.e2e.yml@@ -38,7 +38,7 @@ services:QUEUE_CONNECTION: syncFILESYSTEM_DRIVER: localLOCAL_FILESYSTEM_VISIBILITY: public- MAIL_MAILER: log+ MAIL_MAILER: arrayMAIL_FROM_ADDRESS: dev@localhostMAIL_FROM_NAME: OpnForm-E2EPHP_MEMORY_LIMIT: "1G"