Skip to content

Commit

Permalink
feat (afup#1110): functional test
Browse files Browse the repository at this point in the history
Site public :
- Actualités
- Adhésion personne physique
  • Loading branch information
stakovicz committed Nov 13, 2023
1 parent 3260cbe commit f457976
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Resources/views/site/news/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

{% if articles|length %}
{% for article in articles %}
<a class="article article-teaser" href="{{ path('news_display', { code: article.slug}) }}">
<a class="article article-teaser" href="{{ path('news_display', { code: article.slug}) }}"
title="Lire l'article: {{ article.title }}">
<h2>{{ article.title }}</h2>
<div class="article-date"><i>{{ article.publishedAt|localizeddate('long', 'none') }}</i></div>
<p>{{ article.getTeaser|raw }} <span class="home-read-more">Lire plus <i class="fa fa-arrow-right"></i></span></p>
Expand Down
26 changes: 26 additions & 0 deletions tests/behat/features/PublicSite/News.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Feature: Site Public - News

@reloadDbWithTestData
Scenario: Accès à la liste des actualités
Given I am on the homepage
When I follow "Actualités"
Then I should see "Actualités"
And I should see "Les vidéos des talks du Forum PHP 2018 sont disponibles"
And I follow "Lire l'article: Les vidéos des talks du Forum PHP 2018 sont disponibles"
Then I should see "Les vidéos des talks du Forum PHP 2018 sont disponibles"
Then I should see "Cycle de conférences : forum / Année : 2018"

@reloadDbWithTestData
Scenario: Filtre sur les actualités
Given I am on the homepage
When I follow "Actualités"
Then I should see "Actualités"
And I should see "Les vidéos des talks du Forum PHP 2018 sont disponibles"
And I check "news_filters_year_0"
And I submit the form with name "news_filters"
And I should be on "/news/?news_filters[year][0]=2018"
And I should see "Les vidéos des talks du Forum PHP 2018 sont disponibles"
And I check "news_filters_theme_0"
And I submit the form with name "news_filters"
And I should be on "/news/?news_filters[theme][0]=1"
And I should not see "Les vidéos des talks du Forum PHP 2018 sont disponibles"
43 changes: 42 additions & 1 deletion tests/behat/features/PublicSite/Register.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Feature: Site Public - Register

@reloadDbWithTestData
@clearEmails
Scenario: Accès à l'adhésion particulier
Given I am on the homepage
When I follow "Adhérer"
Expand All @@ -19,4 +20,44 @@ Feature: Site Public - Register
And I fill in "confirmation_mot_de_passe" with "test"
And I press "Ajouter"
Then I should see "Espace membre"
And I should see " Merci pour votre inscription. Il ne reste plus qu'à régler votre cotisation."
And I should see "Merci pour votre inscription. Il ne reste plus qu'à régler votre cotisation."
When I follow "Se mettre à jour"
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 |
| <registeredUser@gmail.com> | Votre compte afup.org |

@reloadDbWithTestData
@clearEmails
Scenario: Accès à l'adhésion entreprise
Given I am on the homepage
When I follow "Adhérer"
Then I should see "Devenir membre de l'AFUP"
When I follow "Adhérer en tant qu'entreprise"
Then I should see "Adhésion entreprise à l'AFUP"
When I fill in "company_member_companyName" with "Une société"
And I fill in "company_member_siret" with "123456789"
And I fill in "company_member_address" with "45 rue des Roses"
And I fill in "company_member_zipcode" with "69003"
And I fill in "company_member_city" with "LYON"
And I fill in "company_member_firstName" with "Mon prénom"
And I fill in "company_member_lastName" with "Mon nom"
And I fill in "company_member_email" with "[email protected]"
And I fill in "company_member_phone" with "0123456"
And print last response
And I fill in "company_member[invitations][0][email]" with "[email protected]"
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"

0 comments on commit f457976

Please sign in to comment.