diff --git a/app/Resources/views/admin/planete/feed_list.html.twig b/app/Resources/views/admin/planete/feed_list.html.twig index 5ebb0163e..7bfe41830 100644 --- a/app/Resources/views/admin/planete/feed_list.html.twig +++ b/app/Resources/views/admin/planete/feed_list.html.twig @@ -83,8 +83,10 @@ {% if feed.status == 1 %} {% if testFeeds and feed.id in feedResults|keys %} {% set color = feedResults[feed.id] ? 'green' : 'red' %} + {% set text = feedResults[feed.id] ? 'validé' : 'erreur' %} {% endif %} + {{ text|default('non testé') }} {% endif %} diff --git a/app/Resources/views/site/member/index.html.twig b/app/Resources/views/site/member/index.html.twig index 39400a056..7e21a9e6c 100644 --- a/app/Resources/views/site/member/index.html.twig +++ b/app/Resources/views/site/member/index.html.twig @@ -198,7 +198,8 @@ Coordonnées @@ -211,7 +212,8 @@ Personnes rattachées @@ -224,7 +226,8 @@ Profil public diff --git a/app/config/config.yml b/app/config/config.yml index 855f2b88d..aa0d42379 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -277,7 +277,7 @@ parameters: icon: "tag" elements: configuration: - nom: 'Configuration' + nom: 'Configuration du site' niveau: 'ROLE_ADMIN' membre_administrateur: nom: 'Administrateurs du site' diff --git a/db/seeds/FeedArticle.php b/db/seeds/FeedArticle.php new file mode 100644 index 000000000..8db307063 --- /dev/null +++ b/db/seeds/FeedArticle.php @@ -0,0 +1,43 @@ + 'Un super site PHP', + 'url' => 'https://afup.org', + 'feed' => 'https://afup.org/rss.xml', + 'etat' => 0, + ]; + $table = $this->table('afup_planete_flux'); + $table->truncate(); + + $table + ->insert($feed) + ->save(); + + $data = [ + [ + 'afup_planete_flux_id' => 2, + 'clef' => '0482a33e-7370-11ee-b962-0242ac120002', + 'titre' => 'Un titre', + 'url' => 'https://afup.org/url.html', + 'maj' => time(), + 'auteur' => 'Un super auteur', + 'resume' => 'Un super article', + 'contenu' => 'Le contenu du super article', + 'etat' => 1 + ], + ]; + + $table = $this->table('afup_planete_billet'); + $table->truncate(); + + $table + ->insert($data) + ->save(); + } +} diff --git a/db/seeds/NiveauPartenariat.php b/db/seeds/NiveauPartenariat.php new file mode 100644 index 000000000..0146a607e --- /dev/null +++ b/db/seeds/NiveauPartenariat.php @@ -0,0 +1,23 @@ + 'Platine'], + ['titre' => 'Or'], + ['titre' => 'Argent'], + ['titre' => 'Bronze'], + ]; + + $table = $this->table('afup_niveau_partenariat'); + $table->truncate(); + + $table + ->insert($data) + ->save(); + } +} diff --git a/db/seeds/Users.php b/db/seeds/Users.php index b2864f54b..95f7164ac 100644 --- a/db/seeds/Users.php +++ b/db/seeds/Users.php @@ -29,6 +29,7 @@ public function run() 'ville' => 'LYON', 'id_pays' => 'FR', 'etat' => 0, + 'max_members' => 3 ], ]; @@ -87,6 +88,7 @@ public function run() 'roles' => '[]', 'id_personne_morale' => self::ID_PERSONNE_MORALE_MY_CORP, 'niveau_modules' => '00000', + 'etat' => 1 ], [ 'id' => self::ID_USER_PERSONNE_PHYSIQUE, @@ -137,8 +139,16 @@ public function run() 'type_personne' => 1, // AFUP_COTISATION_MORALE 'id_personne' => self::ID_PERSONNE_MORALE_MY_CORP, 'montant' => 150, - 'date_fin' => $dateDebutUserExpire + $oneMonthInSeconds * 12, - 'numero_facture' => 'COTIS-2018-201', + 'date_fin' => $now + $oneMonthInSeconds * 12, + 'numero_facture' => 'COTIS-'.date('Y').'-200', + ], + [ + 'date_debut' => $dateDebutUserExpire, + 'type_personne' => 0, // AFUP_COTISATION_PHYSIQUE + 'id_personne' => self::ID_USER_PERSONNE_PHYSIQUE, + 'montant' => 25, + 'date_fin' => $now + $oneMonthInSeconds * 12, + 'numero_facture' => 'COTIS-'.date('Y').'-201', ] ]; diff --git a/tests/behat/features/Admin/AdminPersonnesMoralesCotisations.feature b/tests/behat/features/Admin/AdminPersonnesMoralesCotisations.feature index 1c620ee16..7727dd0e8 100644 --- a/tests/behat/features/Admin/AdminPersonnesMoralesCotisations.feature +++ b/tests/behat/features/Admin/AdminPersonnesMoralesCotisations.feature @@ -10,7 +10,7 @@ Feature: Administration - Partie Personnes morales - cotisations When I follow the button of tooltip "Gérer les cotisations de MyCorp" Then I should see "Cotisations de MyCorp" When I follow the button of tooltip "Télécharger la facture" - Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2018-201_13072018.pdf"' + Then the response header "Content-disposition" should match '#attachment; filename="MyCorp_COTIS-#' @reloadDbWithTestData Scenario: On test la gestion des cotisations diff --git a/tests/behat/features/Admin/Divers/Administrateurs.feature b/tests/behat/features/Admin/Divers/Administrateurs.feature new file mode 100644 index 000000000..1110a8b0b --- /dev/null +++ b/tests/behat/features/Admin/Divers/Administrateurs.feature @@ -0,0 +1,19 @@ +Feature: Administration - Administrateurs du site + + @reloadDbWithTestData + Scenario: Afficher / modifier les administrateurs du site + Given I am logged in as admin and on the Administration + And I follow "Administrateurs du site" + Then I should see "Administrateurs du site" + And I should see "Admin Admin Actif Administrateur" + And I follow the button of tooltip "Modifier la fiche de Admin Admin" + And I should see "Modifier une personne physique" + And I fill in "user_edit_lastname" with "SuperLastnameAdmin" + And I fill in "user_edit_firstname" with "SuperFirstnameAdmin" + And I fill in "user_edit_address" with "Address" + And I fill in "user_edit_zipcode" with "77777" + And I fill in "user_edit_city" with "City" + And I press "Modifier" + Then the ".content .message" element should contain "La personne physique a été modifiée" + And I follow "Administrateurs du site" + And I should see "SuperLastnameAdmin SuperFirstnameAdmin Actif Administrateur" diff --git a/tests/behat/features/Admin/Divers/Configuration.feature b/tests/behat/features/Admin/Divers/Configuration.feature new file mode 100644 index 000000000..1e7883214 --- /dev/null +++ b/tests/behat/features/Admin/Divers/Configuration.feature @@ -0,0 +1,12 @@ +Feature: Administration - Configuration + + @reloadDbWithTestData + Scenario: Afficher / modifier l'adresse + Given I am logged in as admin and on the Administration + And I follow "Configuration du site" + Then I should see "Configuration" + And I should see "32, Boulevard de Strasbourg CS 30108" + And I fill in "afup|adresse" with "32, Boulevard de Nantes CS 30108" + When I press "Enregistrer" + Then the ".content .message" element should contain "La configuration a été enregistrée" + And I should see "32, Boulevard de Nantes CS 30108" diff --git a/tests/behat/features/Admin/Divers/Logs.feature b/tests/behat/features/Admin/Divers/Logs.feature new file mode 100644 index 000000000..2a57c5819 --- /dev/null +++ b/tests/behat/features/Admin/Divers/Logs.feature @@ -0,0 +1,8 @@ +Feature: Administration - Logs + + @reloadDbWithTestData + Scenario: Afficher les logs + Given I am logged in as admin and on the Administration + And I follow "Logs" + Then I should see "Logs" + And I should see "Date Nom Prénom Texte" diff --git a/tests/behat/features/Admin/Divers/Sponsors.feature b/tests/behat/features/Admin/Divers/Sponsors.feature new file mode 100644 index 000000000..f3f8f3403 --- /dev/null +++ b/tests/behat/features/Admin/Divers/Sponsors.feature @@ -0,0 +1,38 @@ +Feature: Administration - Sponsors/Partenaires + + @reloadDbWithTestData + Scenario: Afficher Sponsors/Partenaires création / modification / suppression + Given I am logged in as admin and on the Administration + And I follow "Sponsors/Partenaires" + Then I should see "Liste des sponsors/partenaires de forum" + And I should see "Aucun inscrit" + # Création + When I follow "Ajouter un partenaire" + Then I should see "Ajouter un partenaire" + # Choix du Forum + And I fill in "id_forum" with "1" + # Choix du niveau Or + And I fill in "id_niveau_partenariat" with "2" + And I fill in "ranking" with "42" + And I fill in "nom" with "Un partenaire en Or" + And I fill in "presentation" with "La présentation du partenaire en Or" + And I fill in "site" with "https://www.exemple.com" + And I attach the file "avatar1.png" to "logo" + When I press "Soumettre" + # Liste + Then the ".content .message" element should contain "Le partenaire a été ajouté" + And I should see "forum Or Un partenaire en Or https://www.exemple.com avatar1.png 42" + # Modification + When I follow "Modifier le partenaire Un partenaire en Or" + Then I should see "Partenaire de forum" + And I fill in "ranking" with "73" + And I fill in "nom" with "Un partenaire modifié" + And I fill in "presentation" with "La présentation du partenaire modifié" + And I fill in "site" with "https://www.exemple.com/updated" + When I press "Soumettre" + Then the ".content .message" element should contain "Le partenaire a été modifié" + And I should see "forum Or Un partenaire modifié https://www.exemple.com/updated avatar1.png 73" + # Suppression + When I follow "Supprimer le partenaire Un partenaire modifié" + Then the ".content .message" element should contain "Le partenaire a été supprimé" + And I should see "Aucun inscrit" diff --git a/tests/behat/features/Admin/Members/AdminMembersReporting.feature b/tests/behat/features/Admin/Members/AdminMembersReporting.feature index 9ae3d93b7..7c6dba12d 100644 --- a/tests/behat/features/Admin/Members/AdminMembersReporting.feature +++ b/tests/behat/features/Admin/Members/AdminMembersReporting.feature @@ -5,5 +5,5 @@ Feature: Administration - Partie Reporting Given I am logged in as admin and on the Administration And I follow "Reporting" Then the ".content h2" element should contain "Statistiques concernant les membres" - Then I should see "1 Personnes physiques totales*" + Then I should see "2 Personnes physiques totales*" Then I should see "1 Personnes physiques non rattachées à une personne morale*" diff --git a/tests/behat/features/Admin/PlanetePHP/BIllets.feature b/tests/behat/features/Admin/PlanetePHP/BIllets.feature new file mode 100644 index 000000000..a2efbfc18 --- /dev/null +++ b/tests/behat/features/Admin/PlanetePHP/BIllets.feature @@ -0,0 +1,8 @@ +Feature: Administration - Planète PHP - Billets + + @reloadDbWithTestData + Scenario: Gestion des flux + Given I am logged in as admin and on the Administration + When I follow "Billets" + Then the ".content h2" element should contain "Billets" + And I should see "Un titre Le contenu du super article Actif" diff --git a/tests/behat/features/Admin/PlanetePHP/Flux.feature b/tests/behat/features/Admin/PlanetePHP/Flux.feature new file mode 100644 index 000000000..9bb46177a --- /dev/null +++ b/tests/behat/features/Admin/PlanetePHP/Flux.feature @@ -0,0 +1,31 @@ +Feature: Administration - Planète PHP - Flux + + Scenario: Gestion des flux + Given I am logged in as admin and on the Administration + When I follow "Flux" + Then the ".content h2" element should contain "Flux" + # Ajout d'un flux + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter un flux" + When I fill in "feed_form[name]" with "Site web les-tilleuls.coop" + And I fill in "feed_form[url]" with "https://les-tilleuls.coop" + And I fill in "feed_form[feed]" with "https://les-tilleuls.coop/feed.xml" + And I press "Ajouter" + Then the ".content .message" element should contain "Le flux a été ajouté" + # Liste des flux + And I should see "les-tilleuls.coop https://les-tilleuls.coop Actif Oui non testé" + # Test de validité + When I follow "Test validité" + And I should see "les-tilleuls.coop https://les-tilleuls.coop Actif Oui validé" + # Modification + désactivation d'un flux + When I follow the button of tooltip "Modifier la fiche de Site web les-tilleuls.coop" + Then the ".content h2" element should contain "Modifier un flux" + When I fill in "feed_form[name]" with "Site web les-tilleuls.coop modifié" + And I select "0" from "feed_form[status]" + And I press "Modifier" + Then the ".content .message" element should contain "Le flux a été modifié" + And I should see "les-tilleuls.coop modifié https://les-tilleuls.coop Inactif" + # Suppression + When I follow the button of tooltip "Supprimer la fiche de Site web les-tilleuls.coop modifié" + Then the ".content .message" element should contain "Le flux a été supprimé" + And I should not see "les-tilleuls.coop" diff --git a/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature b/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature index bdb83c782..659c6d2cb 100644 --- a/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature +++ b/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature @@ -7,4 +7,5 @@ Feature: Administration - Trésorerie - Recherche comptable Then the ".content h2" element should contain "Recherche comptable" When I fill in "q" with "raoul" And I press "Rechercher" - And I should see "Jul 13, 2018 > Jul 8, 2019 150.00 Dupont Raoul " + And I should see "Jul 13, 2018 >" + And I should see "150.00 Dupont Raoul " diff --git a/tests/behat/features/MembersArea/Index.feature b/tests/behat/features/MembersArea/Index.feature index f70020597..6936c91e2 100644 --- a/tests/behat/features/MembersArea/Index.feature +++ b/tests/behat/features/MembersArea/Index.feature @@ -52,17 +52,17 @@ Feature: Espace membre, accueil Given I am logged-in with the user "edmonddupont" and the password "edmonddupont" And I follow "Espace membre" Then I should see "Cotisations" - When I follow "Se mettre à jour" + When I follow "Consulter" Then I should see "Payer ma cotisation" When I follow "Télécharger la facture" - Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2018-201_13072018.pdf"' + Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2023-200_13072018.pdf"' @reloadDbWithTestData Scenario: Si on est pas company manager de la personne morale, on ne peux pas télécharger la facture Given I am logged-in with the user "raoul" and the password "raoul" And I follow "Espace membre" Then I should see "Cotisations" - When I follow "Se mettre à jour" + When I follow "Consulter" Then I should see "Payer ma cotisation" Then I should not see "Télécharger la facture" When I am on "/member/membership-fee/download?id=3" diff --git a/tests/behat/features/MembersArea/PersonneMorale.feature b/tests/behat/features/MembersArea/PersonneMorale.feature new file mode 100644 index 000000000..d90babf5c --- /dev/null +++ b/tests/behat/features/MembersArea/PersonneMorale.feature @@ -0,0 +1,51 @@ +Feature: Espace membre > Personne morale > Personnes rattachés + + @reloadDbWithTestData + @clearEmails + Scenario: Gestions des droits + Given I am logged-in with the user "edmonddupont" and the password "edmonddupont" + And I follow "Espace membre" + Then I should see "Espace membre" + And I follow "Modifier les personnes rattachées" + # Liste des membres + Then I should see "Les membres rattachés à mon entreprise" + Then I should see "Jan Raoul Non jean.raoul@mycorp.fr" + # Donner les droits + And I press "Donner les droits de gestion" + Then I should see "Le membre a été promu en tant que manager." + # Retirer les droits + And I press "Enlever les droits de gestion" + Then I should see "Le membre n'a plus accès la gestion de l'entreprise." + + @reloadDbWithTestData + @clearEmails + Scenario: Invitation des membres + Given I am logged-in with the user "edmonddupont" and the password "edmonddupont" + And I follow "Espace membre" + Then I should see "Espace membre" + And I follow "Modifier les personnes rattachées" + # Envoyer une invitation + Then I fill in "company_member_invitation[email]" with "email1@email.com" + And I press "Envoyer l'invitation" + Then I should see "L'invitation a été envoyée à l'adresse email1@email.com." + And I should only receive the following emails: + | to | subject | + | | MyCorp vous invite à profiter de son compte "Membre AFUP" | + And I should see "email1@email.com Non" + # Envoyer la dernière + Then I fill in "company_member_invitation[email]" with "email2@email.com" + And I press "Envoyer l'invitation" + # Renvoyer la dernière invitation + And I press "Envoyer à nouveau" + And I should see "L'invitation a été renvoyée." + And I should only receive the following emails: + | to | subject | + | | MyCorp vous invite à profiter de son compte "Membre AFUP" | + | | MyCorp vous invite à profiter de son compte "Membre AFUP" | + | | MyCorp vous invite à profiter de son compte "Membre AFUP" | + # Invitation max bloqué + Then I should see "Vous avez actuellement 1 membre(s) rattaché(s) et 2 invitation(s) en attente." + # Annulation d'une invitation + And I press "Annuler" + Then I should see "L'invitation a été annulée." + Then I should not see "Vous avez actuellement 1 membre(s) rattaché(s) et 2 invitation(s) en attente." diff --git a/tests/behat/features/MembersArea/Techletter.feature b/tests/behat/features/MembersArea/Techletter.feature new file mode 100644 index 000000000..4dd9bcdba --- /dev/null +++ b/tests/behat/features/MembersArea/Techletter.feature @@ -0,0 +1,35 @@ +Feature: Espace membre, Veille de l'AFUP + + @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" + And I follow "Consulter" + Then I should see "Veille de l'AFUP" + And I should see "Vous n'êtes pas à jour de votre cotisation." + And I should see "Vous ne pourrez donc pas recevoir, vous inscrire ni consulter l'historique des veilles de l'AFUP." + + @reloadDbWithTestData + Scenario: Abonnement à jour je dois voir l'historique + Given I am logged-in with the user "paul" and the password "paul" + And I follow "Espace membre" + Then I should see "Espace membre" + And I follow "Gérer mon abonnement" + Then I should see "Historique des veilles" + + @reloadDbWithTestData + Scenario: Abonnement / désabonnement + Given I am logged-in with the user "paul" and the password "paul" + And I follow "Espace membre" + Then I should see "Espace membre" + And I follow "Gérer mon abonnement" + Then I should see "Veille de l'AFUP" + And I should see "Vous ne recevez actuellement pas la veille de l'AFUP." + # Abonnement + Then I press "M'abonner" + And I should see "Vous êtes maintenant abonné à la veille de l'AFUP" + And I should see "Vous recevez actuellement la veille de l'AFUP deux fois par mois sur l'adresse paul.personne@mycorp.fr." + # Désabonnment + Then I follow "Me désabonner" + And I should see "Vous êtes maintenant désabonné à la veille de l'AFUP"