From 6878aea35afb8b50540d5fb397dca0fceeb93215 Mon Sep 17 00:00:00 2001 From: Albin Date: Wed, 15 Nov 2023 21:43:19 +0100 Subject: [PATCH] =?UTF-8?q?feat=20(afup#1110):=20functional=20test=20Site?= =?UTF-8?q?=20public=20:=20-=20Adh=C3=A9sion=20personne=20morale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/bootstrap/FeatureContext.php | 20 +++++++++++++++++++ .../features/PublicSite/Register.feature | 17 ++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index a4332afac..d05cf9c4f 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -108,6 +108,26 @@ public function iAmLoggedInWithTheUserAndThePassword($user, $password) $this->minkContext->assertPageContainsText("Espace membre"); } + /** + * @Then I emulate JS collection on adhesion_entreprise.html.twig + */ + public function emulateJSCollectionAdhesionEntreprise() + { + $emailCount = 0; + + $emailList = $this->minkContext->getSession()->getPage()->find('xpath', '//*[@id="company_member_invitations"]'); + + $newWidget = $emailList->getAttribute('data-prototype'); + $newWidget = preg_replace("/__name__label__/g", 'Membre #' . ($emailCount+1), $newWidget); + $newWidget = preg_replace("/__name__/g", $emailCount, $newWidget); + + + $newDiv = '
'.$newWidget.'
'; + + // TODO ajouter le contenu de $newDiv à $emailList + // Puis réinjecter l'HTML dans Mink + } + /** * @Then I submit the form with name :formName */ diff --git a/tests/behat/features/PublicSite/Register.feature b/tests/behat/features/PublicSite/Register.feature index 5cc5d40c1..ed8d22eee 100644 --- a/tests/behat/features/PublicSite/Register.feature +++ b/tests/behat/features/PublicSite/Register.feature @@ -57,7 +57,24 @@ Feature: Site Public - Register And I fill in "company_member_email" with "registeredCompany@gmail.com" And I fill in "company_member_phone" with "0123456" And print last response + And I emulate JS collection on adhesion_entreprise.html.twig And I fill in "company_member[invitations][0][email]" with "registeredUser@gmail.com" And I press "Enregistrer mon adhésion" And I should see "Adhésion enregistrée !" And I should see "Montant de la cotisation: 150.00 Euros" + When I press "Régler par carte" + # Pour suivre la redirection POST de Paybox + And I submit the form with name "PAYBOX" + When I fill in "NUMERO_CARTE" with "1111222233334444" + And I select "12" from "MOIS_VALIDITE" + And I select "25" from "AN_VALIDITE" + And I fill in "CVVX" with "123" + And I press "Valider" + Then I should see "PAIEMENT ACCEPTÉ" + When I follow "Retour" + Then I should see "Le paiement de votre cotisation s'est bien passé, merci." + # Simuler l'appel de callback Paybox + And simulate the Paybox callback + And I should only receive the following emails: + | to | subject | + | | Votre compte afup.org |