Skip to content

Commit

Permalink
feat (#1110): functional test
Browse files Browse the repository at this point in the history
Administration - Trésorerie - Compte banques
Site Public - Flux RSS
  • Loading branch information
stakovicz committed Oct 17, 2023
1 parent 71b6b8c commit 693a0ae
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
39 changes: 39 additions & 0 deletions db/seeds/Compta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

use Phinx\Seed\AbstractSeed;

class Compta extends AbstractSeed
{
public function run()
{
$data = [
[
'idoperation' => 2,
'idcategorie' => 34,
'montant' => 1000,
'idmode_regl' => 2,
'date_regl' => '2023-10-16',
'description' => 'Une recette qui rapporte',
'idevenement' => 5,
'idcompte' => 1
],
[
'idoperation' => 1,
'idcategorie' => 34,
'montant' => 500,
'idmode_regl' => 2,
'date_regl' => '2023-10-17',
'description' => 'Une dépense très utile',
'idevenement' => 5,
'idcompte' => 1
],
];

$table = $this->table('compta');
$table->truncate();

$table
->insert($data)
->save();
}
}
28 changes: 28 additions & 0 deletions tests/behat/features/Admin/Tresorerie/CompteBanques.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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"
Then I should see "1 000,00"
Then I should see "Une recette qui rapporte"
Then I should see "17/10/2023"
Then I should see "500,00"
Then I should see "Une dépense très utile"
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"

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"#'

# 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 '#???#'
9 changes: 9 additions & 0 deletions tests/behat/features/PublicSite/Rss.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: Site Public - Flux RSS

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 "<rss version=\"2.0\">"
And the response should contain "</rss>"

0 comments on commit 693a0ae

Please sign in to comment.