From 49e4e11ab785434fbe517b0562a1fd7d51fd2dba Mon Sep 17 00:00:00 2001 From: Albin Date: Fri, 27 Oct 2023 22:35:47 +0200 Subject: [PATCH] feat (afup#1110): functional test Divers Sponsors --- db/seeds/NiveauPartenariat.php | 23 ++++++++++ .../features/Admin/Divers/Sponsors.feature | 42 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 db/seeds/NiveauPartenariat.php create mode 100644 tests/behat/features/Admin/Divers/Sponsors.feature 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/tests/behat/features/Admin/Divers/Sponsors.feature b/tests/behat/features/Admin/Divers/Sponsors.feature new file mode 100644 index 000000000..c6a5db514 --- /dev/null +++ b/tests/behat/features/Admin/Divers/Sponsors.feature @@ -0,0 +1,42 @@ +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" + + + +