diff --git a/Makefile b/Makefile index e20fc4a70..c41857671 100644 --- a/Makefile +++ b/Makefile @@ -72,10 +72,11 @@ test: test-functional: data config htdocs/uploads - CURRENT_UID=$(CURRENT_UID) docker-compose stop dbtest apachephptest mailcatcher - CURRENT_UID=$(CURRENT_UID) docker-compose up -d dbtest apachephptest mailcatcher + CURRENT_UID=$(CURRENT_UID) docker-compose stop dbtest apachephptest planetetest mailcatcher + CURRENT_UID=$(CURRENT_UID) docker-compose up -d dbtest apachephptest planetetest mailcatcher CURRENT_UID=$(CURRENT_UID) docker-compose run --no-deps --rm cliphp ./bin/behat - CURRENT_UID=$(CURRENT_UID) docker-compose stop dbtest apachephptest mailcatcher + CURRENT_UID=$(CURRENT_UID) docker-compose run --no-deps --rm cliphp ./bin/behat -c behat-planete.yml + CURRENT_UID=$(CURRENT_UID) docker-compose stop dbtest apachephptest planetetest mailcatcher data: mkdir data diff --git a/README.md b/README.md index 24dae15d2..39c05d2c6 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,16 @@ Lancement des tests unitaires : ``` - Une alternative est d'utiliser la commande `make test` qui effectuer la même action. -Lancement des tests unitaires : +Lancement des tests fonctionnels : - Se connecter dans le conteneur php `docker/bin/bash` -- Lancer les tests : +- Lancer les tests pour le site web : ``` ./bin/behat ``` +- Lancer les tests pour le site Planete PHP : +``` + ./bin/behat -c behat-planete.yml +``` - Une alternative est d'utiliser la commande `make test-functional`, attention cette commande arrête les containeurs de tests à la fin de l'exécution de la suite de test. Si par la suite vous souhaitez lancer un test, il faut bien penser à les allumer de nouveau. Dans chacun des cas, il est possible de spécifier un test dans la ligne de commande. Exemple: `./bin/behat tests/behat/features/Admin/AdminFeuilles.feature` @@ -84,7 +88,7 @@ Il est possible de tester les paiements Paybox en environnement de développemen Pour cela, les identifiant, site et rang [de test](https://www.paybox.com/espace-integrateur-documentation/comptes-de-tests/) sont déjà configurés dans le fichier parameters.yml par défaut. Ensuite pour le paiement il faut utiliser ces informations [de carte](https://www.paybox.com/espace-integrateur-documentation/cartes-de-tests/) (celle _"Carte participant au programme 3-D Secure (enrôlée)"_) : -* Numéro de carte : `1111 2222 3333 4444` +* Numéro de carte : `1111222233334444` * Validité : `12/25` * CVV : `123` diff --git a/app/Resources/translations/messages.en.yml b/app/Resources/translations/messages.en.yml index 6d5717058..9c8a55591 100644 --- a/app/Resources/translations/messages.en.yml +++ b/app/Resources/translations/messages.en.yml @@ -87,7 +87,7 @@ Language: Language 'Recevoir le dossier': 'Get it' 'Page précédente': 'Previous page' 'Page suivante': 'Next page' -Billetterie: Ticketting +Billetterie: Ticketing 'Vous êtes connecté avec un compte AFUP d''entreprise. Pour acheter des places au tarif AFUP, celles-ci doivent être enregistrées pour les membres de votre adhésion.': 'You are connected with an enterprise membership account. You can only buy tickets for the accounts of your memberships.' 'Vous êtes connecté avec un compte AFUP personnel. Vous pouvez acheter une place au tarif membre pour vous seul.': 'You are connected with a personnal account. You can buy one member ticket for yourself.' 'Attention votre cotisation ne sera plus valable le jour de l''évènement. Vous pouvez commander des billets au tarif AFUP mais vous devrez renouveler votre cotisation pour pouvoir accéder à l''évènement.': 'Please take care of your membership. It won''t be valid at the date of the event. You can order members tickets but you will have to pay your membership fee before the event.' diff --git a/app/Resources/views/event/speaker/page.html.twig b/app/Resources/views/event/speaker/page.html.twig index 975e364ba..6e9ded820 100644 --- a/app/Resources/views/event/speaker/page.html.twig +++ b/app/Resources/views/event/speaker/page.html.twig @@ -111,7 +111,7 @@ {{ form_errors(speakers_contact_form.phone_number) }} - {{ form_widget(speakers_contact_form.submit) }} + {{ form_widget(speakers_contact_form.submit, {attr: {title: "Enregistrer le contact"}}) }} @@ -150,7 +150,7 @@
- {{ form_widget(speakers_diner_form.submit) }} + {{ form_widget(speakers_diner_form.submit, {attr: {title: "Enregistrer mes préférences pour le restaurant"}}) }}
{{ form_end(speakers_diner_form) }} @@ -196,7 +196,7 @@
- {{ form_widget(hotel_reservation_form.submit) }} + {{ form_widget(hotel_reservation_form.submit, {attr: {title: "Enregistrer les nuitées"}}) }}
{{ form_end(hotel_reservation_form) }} diff --git a/app/Resources/views/site/member/index.html.twig b/app/Resources/views/site/member/index.html.twig index 7e21a9e6c..440d624f1 100644 --- a/app/Resources/views/site/member/index.html.twig +++ b/app/Resources/views/site/member/index.html.twig @@ -46,7 +46,8 @@ Mes coordonnées : {{ user.label }}
Modifiez votre adresse de facturation et votre adresse email, changez votre mot de passe diff --git a/behat-planete.yml b/behat-planete.yml new file mode 100644 index 000000000..e2f0b67fc --- /dev/null +++ b/behat-planete.yml @@ -0,0 +1,16 @@ +default: + suites: + features: + paths: + - %paths.base%/planete/tests + contexts: + - FeatureContext + - Behat\MinkExtension\Context\MinkContext + extensions: + Behat\MinkExtension: + base_url: 'https://planetetest:80' + sessions: + default: + goutte: + guzzle_parameters: + verify: false diff --git a/db/seeds/Event.php b/db/seeds/Event.php index 55660b8d6..93aa20476 100644 --- a/db/seeds/Event.php +++ b/db/seeds/Event.php @@ -28,7 +28,8 @@ public function run() 'fr' => 'François le français', 'en' => 'Henri l\'anglais', 'sponsor_management_fr' => '**Sponsors**, venez, vous serez très visible !', - 'sponsor_management_en' => '**Sponsors**, come, you will be very visible!' + 'sponsor_management_en' => '**Sponsors**, come, you will be very visible!', + 'mail_inscription_content' => 'Contenu email', ]), 'date_fin_appel_projet' => $now + $oneMonthInSeconds, 'date_fin_appel_conferencier' => $event - $oneMonthInSeconds * 2, diff --git a/db/seeds/EventTarif.php b/db/seeds/EventTarif.php index f5b8ac686..135613e5f 100644 --- a/db/seeds/EventTarif.php +++ b/db/seeds/EventTarif.php @@ -24,7 +24,7 @@ public function run() [ 'id_tarif' => 3, 'id_event' => Event::ID_FORUM, - 'price' => 150, + 'price' => 15, 'date_start' => '2010-01-01 10:00:00', 'date_end' => '2099-12-31 23:59:59', ], diff --git a/db/seeds/FeedArticle.php b/db/seeds/FeedArticle.php index 8db307063..9c90c7d87 100644 --- a/db/seeds/FeedArticle.php +++ b/db/seeds/FeedArticle.php @@ -21,7 +21,7 @@ public function run() $data = [ [ - 'afup_planete_flux_id' => 2, + 'afup_planete_flux_id' => 1, 'clef' => '0482a33e-7370-11ee-b962-0242ac120002', 'titre' => 'Un titre', 'url' => 'https://afup.org/url.html', @@ -31,6 +31,28 @@ public function run() 'contenu' => 'Le contenu du super article', 'etat' => 1 ], + [ + 'afup_planete_flux_id' => 1, + 'clef' => '460d0a22-78bd-11ee-b962-0242ac120002', + 'titre' => 'Un 2e titre', + 'url' => 'https://afup.org/url-2.html', + 'maj' => time(), + 'auteur' => 'Toujours un super auteur', + 'resume' => 'Un article qui déchire', + 'contenu' => 'Le contenu de l\'article qui déchire', + 'etat' => 1 + ], + [ + 'afup_planete_flux_id' => 1, + 'clef' => '4d5cf2e2-78bd-11ee-b962-0242ac120002', + 'titre' => 'Un titre désactivé', + 'url' => 'https://afup.org/url-out.html', + 'maj' => time(), + 'auteur' => 'Un super désactivé', + 'resume' => 'Un super désactivé', + 'contenu' => 'Le contenu du super désactivé', + 'etat' => 0 + ], ]; $table = $this->table('afup_planete_billet'); diff --git a/db/seeds/GeneralMeetings.php b/db/seeds/GeneralMeetings.php index 690ba2de0..9894ffdaf 100644 --- a/db/seeds/GeneralMeetings.php +++ b/db/seeds/GeneralMeetings.php @@ -6,12 +6,18 @@ class GeneralMeetings extends AbstractSeed { public function run() { + $timestamp = strtotime(date("Y-m-d") . "+2 months"); + // Assemblées générales $data = [ [ 'date' => 1635544800, 'description' => 'Assemblée octobre 2021' ], + [ + 'date' => $timestamp, + 'description' => 'Assemblée dans 2 mois' + ], ]; $table = $this->table('afup_assemblee_generale'); @@ -28,6 +34,11 @@ public function run() 'date' => 1635544800, 'presence' => 1 ], + [ + 'id_personne_physique' => '1', + 'date' => $timestamp, + 'presence' => 1 + ], ]; $table = $this->table('afup_presences_assemblee_generale'); @@ -41,12 +52,12 @@ public function run() // Assemblées générales Questions $data = [ [ - 'date' => 1635544800, + 'date' => $timestamp, 'label' => 'Une 1ère question. Alors d\'accord ?', 'created_at' => '2021-09-01 10:42:42' ], [ - 'date' => 1635544800, + 'date' => $timestamp, 'label' => 'Une autre question pertinente. On vote ?', 'created_at' => '2021-09-12 10:42:42' ], diff --git a/docker-compose.yml b/docker-compose.yml index ae304f764..c9b033c16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,6 +89,26 @@ services: - db - mailcatcher + planetetest: + build: + context: ./docker/dockerfiles/planete + args: + uid: ${CURRENT_UID:-1001} + gid: "1001" + ENABLE_XDEBUG: ${ENABLE_XDEBUG:-false} + environment: + SYMFONY_ENV: "test" + volumes: + - ./:/var/www/html + healthcheck: + test: ["CMD", "curl", "-f", "https://planetetest:80"] + interval: 30s + timeout: 10s + retries: 5 + depends_on: + dbtest: + condition: service_healthy + cliphp: build: context: ./docker/dockerfiles/apachephp @@ -104,6 +124,7 @@ services: - apachephp - mailcatcher - apachephptest + - planetetest - dbtest command: "false" diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 54ff726cc..a4332afac 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -4,6 +4,7 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; +use Behat\Mink\Exception\ExpectationException; use Behat\MinkExtension\Context\MinkContext; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Process; @@ -107,6 +108,34 @@ public function iAmLoggedInWithTheUserAndThePassword($user, $password) $this->minkContext->assertPageContainsText("Espace membre"); } + /** + * @Then I submit the form with name :formName + */ + public function submitFormWithName($formName) + { + $form = $this->minkContext->getSession()->getPage()->find('xpath', "//form[@name='$formName']"); + + if (null === $form) { + throw new ExpectationException(sprintf('The form named "%s" not found', $formName), null); + } + + $form->submit(); + } + + /** + * @Then simulate the Paybox callback + */ + public function simulateThePayboxCallback() + { + $url = $this->minkContext->getSession()->getCurrentUrl(); + $url = str_replace('paybox-redirect', 'paybox-callback', $url); + + $curl = curl_init($url); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_exec($curl); + } + /** * @Then The :field field should only contain the follow values :expectedValuesJson */ diff --git a/htdocs/css/buttons.css b/htdocs/css/buttons.css index a2b11c74e..55ab2aa9a 100644 --- a/htdocs/css/buttons.css +++ b/htdocs/css/buttons.css @@ -56,3 +56,12 @@ input[type="submit"].button--call-to-action { font-weight: bold; color: #fff; } + +button[type="submit"].button--call-to-action.paiement { + background-color: #ed0678 !important; + border-color: #ed0678 !important; + font-weight: bold !important; + color: #fff !important; + height: auto !important; +} + diff --git a/htdocs/pages/planete/app.php b/htdocs/pages/planete/app.php index 6a86ffd89..4169d0a70 100644 --- a/htdocs/pages/planete/app.php +++ b/htdocs/pages/planete/app.php @@ -13,9 +13,10 @@ } $isDevEnv = isset($_ENV['SYMFONY_ENV']) && $_ENV['SYMFONY_ENV'] == 'dev'; +$isTestEnv = isset($_ENV['SYMFONY_ENV']) && $_ENV['SYMFONY_ENV'] == 'test'; -if ($_SERVER['HTTP_HOST'] === 'afup.dev' || $isDevEnv) { - if (!$isDevEnv +if ($_SERVER['HTTP_HOST'] === 'afup.dev' || $isDevEnv || $isTestEnv) { + if (!($isDevEnv || $isTestEnv) && ( isset($_SERVER['HTTP_CLIENT_IP']) @@ -33,7 +34,11 @@ $loader = require __DIR__.'/../../../vendor/autoload.php'; Debug::enable(); - $kernel = new PlaneteAppKernel('dev', true); + if ($isDevEnv) { + $kernel = new PlaneteAppKernel('dev', true); + } else { + $kernel = new PlaneteAppKernel('test', true); + } } else { /** @var ClassLoader $loader */ $loader = require __DIR__.'/../../../vendor/autoload.php'; diff --git a/planete/app/config/config_test.yml b/planete/app/config/config_test.yml index 2f6d92503..b2daa58a3 100644 --- a/planete/app/config/config_test.yml +++ b/planete/app/config/config_test.yml @@ -12,5 +12,9 @@ web_profiler: toolbar: false intercept_redirects: false -swiftmailer: - disable_delivery: true +parameters: + database_host: dbtest + database_port: 3306 + database_name: web + database_user: afup + database_password: afup diff --git a/planete/tests/features/Home.feature b/planete/tests/features/Home.feature new file mode 100644 index 000000000..beb0bee14 --- /dev/null +++ b/planete/tests/features/Home.feature @@ -0,0 +1,11 @@ +Feature: Planete PHP - Home + + @reloadDbWithTestData + Scenario: On voit bien toute la page + Given I am on the homepage + Then I should see "planete-php.fr" + Then I should see "Un titre" + Then I should see "Un 2e titre" + Then I should see "Envoyez un email avec l'URL du site et du flux à planetephpfr AT afup POINT org" + When I follow "Articles précédents" + Then I should see "Articles précédents Articles suivants" diff --git a/planete/tests/features/Rss.feature b/planete/tests/features/Rss.feature new file mode 100644 index 000000000..9bebcc478 --- /dev/null +++ b/planete/tests/features/Rss.feature @@ -0,0 +1,10 @@ +Feature: Planete PHP - RSS + + @reloadDbWithTestData + Scenario: On accède bien au flux RSS + Given I am on the homepage + When I follow "RSS Feed" + Then the response should contain "planete php fr" + Then the response should contain "Un titre" + Then the response should contain "Un 2e titre" + Then the response should contain "" diff --git a/sources/AppBundle/Payment/Paybox.php b/sources/AppBundle/Payment/Paybox.php index 0bc951177..796acc814 100644 --- a/sources/AppBundle/Payment/Paybox.php +++ b/sources/AppBundle/Payment/Paybox.php @@ -97,7 +97,7 @@ public function generate(\DateTimeInterface $now) foreach ($sanitizedInputs as $inputKey => $inputValue) { $htmlForm .= ' ' . PHP_EOL; } - $htmlForm .= ' ' . PHP_EOL; + $htmlForm .= ' ' . PHP_EOL; $htmlForm .= ''; return $htmlForm; diff --git a/sources/AppBundle/Security/TestGithubAuthenticator.php b/sources/AppBundle/Security/TestGithubAuthenticator.php index 57dccfcf2..41cef4e37 100644 --- a/sources/AppBundle/Security/TestGithubAuthenticator.php +++ b/sources/AppBundle/Security/TestGithubAuthenticator.php @@ -82,6 +82,15 @@ private function getTestUsersDetails() 'avatar_url' => 'http://test2.com', ]; + $testUsers['agallou'] = [ + 'id' => 320372, + 'name' => 'agallou', + 'login' => 'agallou', + 'company' => 'AFUP', + 'html_url' => 'http://test2.com', + 'avatar_url' => 'http://test2.com', + ]; + return $testUsers; } diff --git a/tests/behat/features/Admin/Events/GestionEvenements.feature b/tests/behat/features/Admin/Events/GestionEvenements.feature index f636fc1bc..298473224 100644 --- a/tests/behat/features/Admin/Events/GestionEvenements.feature +++ b/tests/behat/features/Admin/Events/GestionEvenements.feature @@ -114,9 +114,14 @@ Feature: Administration - Évènements - Gestions Évènements And I should see "03/03/2027" And I should see "06/03/2027" - Scenario: Si on tente d'en envoyer un mail de test sans contenu, on a un message d'erreur + @reloadDbWithTestData + @clearEmails + Scenario: Si on tente d'en envoyer un mail de test sans contenu, on a un message d'erreur Given I am logged in as admin and on the Administration When I go to "/pages/administration/index.php?page=forum_gestion&action=modifier&id=1" + And I fill in "mail_inscription_content" with "" + And I press "Soumettre" + When I go to "/pages/administration/index.php?page=forum_gestion&action=modifier&id=1" Then I should see "Modifier un évènement" When I follow "Envoyer un test du mail d'inscription sur bureau@afup.org" Then I should see "Contenu du mail d'inscription non trouvé pour le forum forum" @@ -128,6 +133,8 @@ Feature: Administration - Évènements - Gestions Évènements And I press "Soumettre" Then I should see "Le forum a été modifié" + @reloadDbWithTestData + @clearEmails Scenario: Si on tente d'en envoyer un mail de test avec contenu, le mail est bien envoyé Given I am logged in as admin and on the Administration When I go to "/pages/administration/index.php?page=forum_gestion&action=modifier&id=1" diff --git a/tests/behat/features/Admin/Events/TokensSponsors.feature b/tests/behat/features/Admin/Events/TokensSponsors.feature index 4d098bf9f..efc192f6a 100644 --- a/tests/behat/features/Admin/Events/TokensSponsors.feature +++ b/tests/behat/features/Admin/Events/TokensSponsors.feature @@ -40,6 +40,9 @@ Feature: Administration - Évènements - Tokens Sponsors Then I follow "Envoyer le mail de rappel" And I should see "1 mails de relance ont été envoyés" And I should only receive the following emails: - | to | subject | - | | Toutes les informations concernant votre sponsoring du forum | - | | Sponsor: enregistrez-vous pour le forum | + | to | subject | + | | Toutes les informations concernant votre sponsoring du forum | + | | [forum] Merci ! | + | | [forum] Merci ! | + | | Sponsor: enregistrez-vous pour le forum | + diff --git a/tests/behat/features/Admin/Members/GeneralMeeting/GeneralMeetingQuestions.feature b/tests/behat/features/Admin/Members/GeneralMeeting/GeneralMeetingQuestions.feature index 868e3fb9e..1d509ee64 100644 --- a/tests/behat/features/Admin/Members/GeneralMeeting/GeneralMeetingQuestions.feature +++ b/tests/behat/features/Admin/Members/GeneralMeeting/GeneralMeetingQuestions.feature @@ -12,7 +12,6 @@ Feature: Administration - Partie Assemblée Générale Questions And I follow "Assemblée générale - votes" When I follow "Ajouter" Then the ".content h2" element should contain "Assemblée générale - questions" - Then I should see "Assemblée générale du 30/10/2021" And I fill in "general_meeting_question_form[label]" with "Une super question" And I press "Ajouter cette question" Then I should see "La question a été ajoutée" diff --git a/tests/behat/features/EventPages/SpeakerInfos.feature b/tests/behat/features/EventPages/SpeakerInfos.feature new file mode 100644 index 000000000..9f155f3eb --- /dev/null +++ b/tests/behat/features/EventPages/SpeakerInfos.feature @@ -0,0 +1,33 @@ +Feature: Event > Profil speaker + + @reloadDbWithTestData + Scenario: Accès à la page + Given I go to "/event/forum/speaker-infos" + When I follow "Connect as agallou" + Then I should see "Votre conférence" + Then I should see "Nous vous défrayons" + + @reloadDbWithTestData + Scenario: Saisie des infos + Given I go to "/event/forum/speaker-infos" + When I follow "Connect as agallou" + Then I fill in "speakers_contact[phone_number]" with "0123456789" + And I press "Enregistrer le contact" + Then I should see "Informations de contact enregistrées" + + Then I fill in "speakers_diner[will_attend]" with "1" + Then I fill in "speakers_diner[has_special_diet]" with "1" + Then I fill in "speakers_diner[special_diet_description]" with "Je suis végétarien" + And I press "Enregistrer mes préférences pour le restaurant" + Then I should see "Informations sur votre venue au restaurant des speakers enregistrées" + Then I should see "Je suis végétarien" + + When I check "hotel_reservation_nights_0" + And I press "Enregistrer les nuitées" + Then I should see "Informations sur votre venue à l'hôtel enregistrées" + Then the "hotel_reservation_nights_0" checkbox is checked + + When I attach the file "test_file2.pdf" to "speakers_expenses[files][]" + And I press "Ajouter des fichiers" + When I should see "Fichiers ajoutés" + Then I should see "test_file2.pdf" diff --git a/tests/behat/features/EventPages/Ticketing.feature b/tests/behat/features/EventPages/Ticketing.feature index da2442367..88ce6f3f3 100644 --- a/tests/behat/features/EventPages/Ticketing.feature +++ b/tests/behat/features/EventPages/Ticketing.feature @@ -1,10 +1,13 @@ Feature: Event pages - Ticketing @reloadDbWithTestData - Scenario: On voit bien toute la page, même le footer + @clearEmails + Scenario: Achat de billet CB Given I am on "/event/forum/tickets" Then I should see "Billetterie: forum" And I should see "Si vous rencontrez le moindre problème, n'hésitez pas à nous contacter à l'adresse bonjour [@] afup.org." + # Choix du règlement par CB + And I select "0" from "purchase[paymentType]" Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" @@ -16,8 +19,75 @@ Feature: Event pages - Ticketing And I fill in "purchase[city]" with "PARIS" And I fill in "purchase[email]" with "facturationEntreprise@yahoo.fr" And I check "purchase[cgv]" + # Formule Deuxième journée And I select "2" from "purchase[tickets][0][ticketEventType]" And I press "Confirmer & Payer" Then I should see "Paiement de vos billets" And I should see "Nous avons bien reçu votre inscription et nous vous en remercions !" And I should see "Vous serez redirigé vers notre partenaire paybox afin de procéder au paiement d'un montant de 250€" + # Bascule vers Paybox + 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 commande 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 | + | , | Facture évènement AFUP | + | | [forum] Merci ! | + + @reloadDbWithTestData + Scenario: Achat de billet virement + Given I am on "/event/forum/tickets" + Then I should see "Billetterie: forum" + And I should see "Si vous rencontrez le moindre problème, n'hésitez pas à nous contacter à l'adresse bonjour [@] afup.org." + # Choix du règlement par virement + And I select "2" from "purchase[paymentType]" + Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' + When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" + And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" + And I fill in "purchase[tickets][0][email]" with "personne1@yahoo.fr" + And I fill in "purchase[firstname]" with "Prénom facturation" + And I fill in "purchase[lastname]" with "Nom facturation" + And I fill in "purchase[address]" with "42 rue de Strasbourg" + And I fill in "purchase[zipcode]" with "75003" + And I fill in "purchase[city]" with "PARIS" + And I fill in "purchase[email]" with "facturationEntreprise@yahoo.fr" + And I check "purchase[cgv]" + # Formule Deuxième journée + And I select "2" from "purchase[tickets][0][ticketEventType]" + When I press "Confirmer & Payer" + Then I should see "Paiement de vos billets" + And I should see "Nous avons bien reçu votre inscription et nous vous en remercions !" + And I should see "Pour les paiements par virement, merci d'envoyer le virement d'un montant de 250€ aux coordonnées suivantes :" + And I should see "Pensez à indiquer dans le libellé du virement la référence suivante:" + + @reloadDbWithTestData + Scenario: Achat de billet tarif membre + Given I am logged-in with the user "paul" and the password "paul" + And I am on "/event/forum/tickets" + Then I should see "Billetterie: forum" + # Formule Tarif membre + And I select "0" from "purchase[tickets][0][ticketEventType]" + Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mme"]' + When I fill in "purchase[tickets][0][firstname]" with "Prénom personne 1" + And I fill in "purchase[tickets][0][lastname]" with "Nom personne 1" + And I fill in "purchase[tickets][0][email]" with "paul.personne@mycorp.fr" + And I fill in "purchase[firstname]" with "Prénom facturation" + And I fill in "purchase[lastname]" with "Nom facturation" + And I fill in "purchase[address]" with "42 rue de Strasbourg" + And I fill in "purchase[zipcode]" with "75003" + And I fill in "purchase[city]" with "PARIS" + And I fill in "purchase[email]" with "facturationEntreprise@yahoo.fr" + And I check "purchase[cgv]" + When I press "Confirmer & Payer" + Then I should see "Paiement de vos billets" + And I should see "Vous serez redirigé vers notre partenaire paybox afin de procéder au paiement d'un montant de 15€" diff --git a/tests/behat/features/EventPages/TicketingEn.feature b/tests/behat/features/EventPages/TicketingEn.feature index 5b57086ef..5fbc7d9d4 100644 --- a/tests/behat/features/EventPages/TicketingEn.feature +++ b/tests/behat/features/EventPages/TicketingEn.feature @@ -1,7 +1,7 @@ Feature: Event pages - Ticketing - en anglais @reloadDbWithTestData - Scenario: On voit bien toute la page, même le footer + Scenario: Achat de billet en anglais Given I am on "/event/forum/tickets?_locale=en" - Then I should see "Ticketting: forum" + Then I should see "Ticketing: forum" Then The "purchase[tickets][0][civility]" field should only contain the follow values '["M.", "Mrs."]' diff --git a/tests/behat/features/MembersArea/GeneralMeeting.feature b/tests/behat/features/MembersArea/GeneralMeeting.feature new file mode 100644 index 000000000..8f98ff637 --- /dev/null +++ b/tests/behat/features/MembersArea/GeneralMeeting.feature @@ -0,0 +1,20 @@ +Feature: Espace membre, Assemblée Générale + @reloadDbWithTestData + Scenario: Non à jour de cotisation + Given I am logged-in with the user "userexpire" and the password "userexpire" + And I follow "Espace membre" + Then I should see "Espace membre" + When I follow "Indiquer ma présence" + Then I should see "Ma participation à l'Assemblée Générale" + And I should see "Vous ne pourrez donc pas voter lors de cette assemblée générale." + + @reloadDbWithTestData + Scenario: Indiquer présent + Given I am logged-in with the user "paul" and the password "paul" + And I follow "Espace membre" + Then I should see "Espace membre" + When I follow "Indiquer ma présence" + Then I should see "Ma participation à l'Assemblée Générale du" + When I select "2" from "form[presence]" + And I press "Confirmer" + Then I should see "La présence et le pouvoir ont été modifiés" diff --git a/tests/behat/features/MembersArea/MemberContact.feature b/tests/behat/features/MembersArea/MemberContact.feature new file mode 100644 index 000000000..44d2ca779 --- /dev/null +++ b/tests/behat/features/MembersArea/MemberContact.feature @@ -0,0 +1,20 @@ +Feature: Espace membre > Personne physique > Coordonnées + + @reloadDbWithTestData + Scenario: Invitation des membres + Given I am logged-in with the user "paul" and the password "paul" + When I follow "Espace membre" + Then I should see "Espace membre" + And I should see "Antenne la plus proche : Aucune" + When I follow "Modifier les coordonnées" + Then I should see "Mes coordonnées" + When I fill in "contact_details[email]" with "paul.personne2@mycorp.fr" + And I fill in "contact_details[address]" with "Rue du chemin" + And I fill in "contact_details[zipcode]" with "75000" + And I fill in "contact_details[city]" with "Ville" + And I select "FR" from "contact_details[country]" + And I select "bordeaux" from "contact_details[nearest_office]" + When I press "contact_details_save" + Then I should see "Votre compte a été modifié !" + When I follow "Accueil" + And I should see "Antenne la plus proche : Bordeaux" \ No newline at end of file diff --git a/tests/behat/files/test_file2.pdf b/tests/behat/files/test_file2.pdf new file mode 100644 index 000000000..d0108c476 Binary files /dev/null and b/tests/behat/files/test_file2.pdf differ diff --git a/tests/units/AppBundle/Payment/Paybox.php b/tests/units/AppBundle/Payment/Paybox.php index 2765bd0bc..b678e192d 100644 --- a/tests/units/AppBundle/Payment/Paybox.php +++ b/tests/units/AppBundle/Payment/Paybox.php @@ -40,7 +40,7 @@ protected function generateDateProvider() - + EOF; @@ -65,7 +65,7 @@ protected function generateDateProvider() - + EOF;