diff --git a/db/seeds/Compta.php b/db/seeds/Compta.php new file mode 100644 index 000000000..33ff80d9e --- /dev/null +++ b/db/seeds/Compta.php @@ -0,0 +1,51 @@ + 2, + 'idcategorie' => 34, + 'montant' => 1000, + 'idmode_regl' => 2, + 'date_regl' => '2023-10-16', + 'date_ecriture' => '2023-10-17', + 'description' => 'Une recette qui rapporte', + 'attachment_filename' => '202310/test_file1.pdf', + 'idevenement' => 5, + 'idcompte' => 1 + ], + [ + 'idoperation' => 1, + 'idcategorie' => 34, + 'montant' => 500, + 'idmode_regl' => 2, + 'date_regl' => '2023-10-17', + 'date_ecriture' => '2023-10-18', + 'description' => 'Une dépense très utile', + 'idevenement' => 5, + 'idcompte' => 1 + ], + ]; + + $table = $this->table('compta'); + $table->truncate(); + + $table + ->insert($data) + ->save(); + } +} diff --git a/htdocs/templates/administration/compta_synthese.html b/htdocs/templates/administration/compta_synthese.html index 72f1e561b..381ac05ec 100644 --- a/htdocs/templates/administration/compta_synthese.html +++ b/htdocs/templates/administration/compta_synthese.html @@ -14,6 +14,7 @@

Synthese des évènements

{/foreach} + diff --git a/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature b/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature new file mode 100644 index 000000000..2bba9b9e7 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature @@ -0,0 +1,11 @@ +Feature: Administration - Trésorerie - Balance comptable + + @reloadDbWithTestData + Scenario: Balance comptable afficher + Given I am logged in as admin and on the Administration + When I follow "Balance comptable" + Then the ".content h2" element should contain "Balance comptable" + And I should see "AG 500,00 1 000,00" + And I follow the button of tooltip "Voir sur la page courante" + And I should see "17/10/2023 Assurances Une recette qui rapporte 0,00 1 000,00" + And I should see "18/10/2023 Assurances Une dépense très utile 500,00 0,00" diff --git a/tests/behat/features/Admin/Tresorerie/Bilan.feature b/tests/behat/features/Admin/Tresorerie/Bilan.feature new file mode 100644 index 000000000..09f5cc2e5 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/Bilan.feature @@ -0,0 +1,12 @@ +Feature: Administration - Trésorerie - Bilan + + @reloadDbWithTestData + Scenario: Bilan afficher + Given I am logged in as admin and on the Administration + When I follow "Bilan" + Then the ".content h2" element should contain "Bilan" + And I should see "AG 500,00" + And I should see "AG 1 000,00" + And I follow the button of tooltip "Déplier les écritures de débit/crédit pour AG" + And I should see "18/10/2023 Une dépense très utile 500,00" + And I should see "17/10/2023 Une recette qui rapporte 1 000,00" diff --git a/tests/behat/features/Admin/Tresorerie/CompteBanques.feature b/tests/behat/features/Admin/Tresorerie/CompteBanques.feature new file mode 100644 index 000000000..f52f78618 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/CompteBanques.feature @@ -0,0 +1,26 @@ +Feature: Administration - Trésorerie - Compte banques + + @reloadDbWithTestData + Scenario: Compte banques voir le journal de banque + Given I am logged in as admin and on the Administration + When I follow "Compte banques" + Then the ".content h2" element should contain "Journal de banque" + Then I should see "16/10/2023 Carte Bleue Une recette qui rapporte 1 000,00" + Then I should see "17/10/2023 Carte Bleue Une dépense très utile 500,00" + Then I should see "500,00 Total débit" + Then I should see "1 000,00 Total crédit" + Then I should see "500,00 solde" + + @reloadDbWithTestData + Scenario: Compte banques Export Excel + Given I am logged in as admin and on the Administration + When I follow "Compte banques" + And I follow "Export XLSX" + Then the response header "Content-disposition" should match '#filename="compta_afup_(.*).xlsx"#' + + @reloadDbWithTestData + Scenario: Compte banques Télécharger les justificatifs triés par mois + Given I am logged in as admin and on the Administration + When I follow "Compte banques" + And I follow "Télécharger les justificatifs triés par mois" + Then the response header "Content-disposition" should match '#filename="afup_justificatifs-(.*).zip"#' diff --git a/tests/behat/features/Admin/Tresorerie/Configuration.feature b/tests/behat/features/Admin/Tresorerie/Configuration.feature new file mode 100644 index 000000000..012a6ccb9 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/Configuration.feature @@ -0,0 +1,62 @@ +Feature: Administration - Trésorerie - Configuration + + Scenario: Création/liste des évènements + Given I am logged in as admin and on the Administration + When I follow "Configuration" + Then the ".content h2" element should contain "Configuration" + When I follow "Évènements" + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter une ligne configuration 'Evenement'" + When I fill in "evenement" with "Un super évènement" + And I press "soumettre" + Then the ".content .message" element should contain "L'écriture a été ajoutée" + And I should see "Un super évènement" + + Scenario: Création/liste des catégories + Given I am logged in as admin and on the Administration + When I follow "Configuration" + Then the ".content h2" element should contain "Configuration" + When I follow "Catégories" + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter une categorie" + When I fill in "categorie" with "Une super catégorie" + And I press "soumettre" + Then the ".content .message" element should contain "L'écriture a été ajoutée" + And I should see "Une super catégorie" + + Scenario: Création/liste des opérations + Given I am logged in as admin and on the Administration + When I follow "Configuration" + Then the ".content h2" element should contain "Configuration" + When I follow "Opérations" + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter une opération" + When I fill in "operation" with "Une super opération" + And I press "soumettre" + Then the ".content .message" element should contain "L'écriture a été ajoutée" + And I should see "Une super opération" + + Scenario: Création/liste des opérations + Given I am logged in as admin and on the Administration + When I follow "Configuration" + Then the ".content h2" element should contain "Configuration" + When I follow "Modes de réglements" + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter un type de reglement" + When I fill in "reglement" with "Un super règlement" + And I press "soumettre" + Then the ".content .message" element should contain "L'écriture a été ajoutée" + And I should see "Un super règlement" + + Scenario: Création/liste des comptes + Given I am logged in as admin and on the Administration + When I follow "Configuration" + Then the ".content h2" element should contain "Configuration" + When I follow "Comptes" + When I follow "Ajouter" + Then the ".content h2" element should contain "Ajouter un compte" + When I fill in "nom_compte" with "Un super compte" + And I press "soumettre" + Then the ".content .message" element should contain "L'écriture a été ajoutée" + And I should see "Un super compte" + diff --git a/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature b/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature new file mode 100644 index 000000000..bdb83c782 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/RechercheComptable.feature @@ -0,0 +1,10 @@ +Feature: Administration - Trésorerie - Recherche comptable + + @reloadDbWithTestData + Scenario: Recherche Comptable pour raoul + Given I am logged in as admin and on the Administration + When I follow "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 " diff --git a/tests/behat/features/Admin/Tresorerie/SyntheseEvenements.feature b/tests/behat/features/Admin/Tresorerie/SyntheseEvenements.feature new file mode 100644 index 000000000..bbba5e6c1 --- /dev/null +++ b/tests/behat/features/Admin/Tresorerie/SyntheseEvenements.feature @@ -0,0 +1,15 @@ +Feature: Administration - Synthese des évènements + + @reloadDbWithTestData + Scenario: Synthese des évènements de l'AG + Given I am logged in as admin and on the Administration + When I follow "Synthese évènement" + Then the ".content h2" element should contain "Synthese des évènements" + Then I select "5" from "idevnt" + And I press "evt_submit" + Then I should see "Assurances Une dépense très utile 500,00" + Then I should see "Assurances Une recette qui rapporte 1 000,00" + Then I should see "500,00 Total dépenses" + Then I should see "1 000,00 Total recettes" + Then I should see "500,00 Différence" + diff --git a/tests/behat/features/PublicSite/Rss.feature b/tests/behat/features/PublicSite/Rss.feature new file mode 100644 index 000000000..10e5a0757 --- /dev/null +++ b/tests/behat/features/PublicSite/Rss.feature @@ -0,0 +1,12 @@ +Feature: Site Public - Flux RSS + + @reloadDbWithTestData + Scenario: On accède au flux RSS via le lien dans le footer + Given I am on the homepage + And I follow "Accédez au flux RSS de l'AFUP" + Then the response header "Content-type" should match '#^text/xml; charset=UTF-8$#' + And the response should contain "Le flux RSS de l'AFUP" + And the response should contain "" + And the response should contain "<![CDATA[Les vidéos des talks du Forum PHP 2018 sont disponibles]]>" + And the response should contain "https://apachephptest:80/news/1-les-videos-du-forum-2018-en-ligne" + And the response should contain ""