Skip to content

Commit

Permalink
afup#1110 Evenement
Browse files Browse the repository at this point in the history
- Suivi
- Ajout inscription
- 3 exports en CSV
- Virements en attente
  • Loading branch information
stakovicz committed Apr 14, 2022
1 parent f809f40 commit 779f45c
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 26 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,23 @@ Le blog wordpress est géré à l'aide de composer.

Pour mettre à jour les dépendances, il faut utiliser la commande suivante: `docker run --rm --entrypoint php --user $(id -u):$(id -g) --volume $(pwd):/project herloct/composer:1.4.2-php5.6 -ddate.timezone=Europe/Paris /usr/local/bin/composer update --ignore-platform-reqs`

## Connection Google Map Geocoding (pour les exports des Inscriptions)
### Créer une application GitHub :

Aller sur [Googel Cloud Platform Console](https://console.cloud.google.com/projectcreate)

Créer u projet avec ces paramètres :
* Nom du projet: `AFUP/Web dev`
Valider avec le bouton `Créer`

Puis dans `Identifiants`, `Créer des identifiants`, récupérer la clé

Mettre cette information dans le fichier
```yaml
# app/config/parameters.yml
parameters:
# ...
google_maps_api_key: <Clé API Google>
```
Puis dans `API et services` activer l'API `Geocoding API`.
8 changes: 8 additions & 0 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public function assertResponseHeaderEquals($headerName, $expectedValue)
$this->minkContext->assertSession()->responseHeaderEquals($headerName, $expectedValue);
}

/**
* @Then the response header :arg1 should match :arg2
*/
public function assertResponseHeaderMatch($headerName, $regExpExpectedValue)
{
$this->minkContext->assertSession()->responseHeaderMatches($headerName, $regExpExpectedValue);
}

/**
* @When I follow the button of tooltip :arg1
*/
Expand Down
2 changes: 1 addition & 1 deletion sources/Afup/Forum/Facturation.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function genererDevis($reference, $chemin = null)

protected function truncate($value, $length)
{
if ($value <= $legth) {
if ($value <= $length) {
return $value;
}

Expand Down
5 changes: 3 additions & 2 deletions sources/AppBundle/Event/Model/Repository/TicketRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function getTotalOfSoldTicketsByMember($userType, $userId, $eventId)
public function getRegistrationsForEventsWithNewsletterAllowed(\Traversable $events)
{
$params = [];
$idsParams = [];
$cpt = 0;
foreach ($events as $event) {
$key = 'event_id' . ++$cpt;
Expand All @@ -69,12 +70,12 @@ public function getRegistrationsForEventsWithNewsletterAllowed(\Traversable $eve
afup_inscription_forum.prenom,
afup_inscription_forum.email
FROM afup_inscription_forum
WHERE afup_inscription_forum.id_forum IN (%ids%)
WHERE afup_inscription_forum.id_forum IN (%ids)
AND afup_inscription_forum.newsletter_afup = 1
GROUP BY afup_inscription_forum.nom, afup_inscription_forum.prenom, afup_inscription_forum.email
ORDER BY afup_inscription_forum.nom, afup_inscription_forum.prenom, afup_inscription_forum.email',
[
'%ids%' => implode(',', $idsParams),
'%ids' => implode(',', $idsParams),
]
))
->setParams($params)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Administration - Partie Événements Création/Modification
Feature: Administration - Événements - Gestions Événements

@reloadDbWithTestData
Scenario: On crée un nouvel événement vide
Expand Down
60 changes: 60 additions & 0 deletions tests/behat/features/Admin/Events/Inscriptions.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Feature: Administration - Événements - Inscriptions

@reloadDbWithTestData
Scenario: Accès à la liste puis ajout d'une inscription
Given I am logged in as admin and on the Administration
And I follow "Inscriptions"
Then the ".content h2" element should contain "Inscriptions"
When I follow "Ajouter"
Then I should see "Ajouter une inscription pour le forum"
Then The "civilite" field should only contain the follow values '["M.", "Mme"]'
When I select "2" from "type_inscription"
And I fill in "nom" with "Nom participant"
And I fill in "prenom" with "Prénom participant"
And I fill in "email" with "nomparticipant@gmail.com"
And I select "2" from "type_reglement"
And I press "Soumettre"
Then I should see "L'inscription a été ajoutée"
And I should see "Inscriptions"
And I should see "Prénom participant Nom participant"

# Bug sur cet export à reprendre une fois celui-ci corrigé
# Scenario: Export CSV: Inscription
# Given I am logged in as admin and on the Administration
# # Export
# And I follow "Inscriptions"
# Then I should see "Exports"
# And I follow "Exporter les inscriptions"
# Then the response status code should be 200

Scenario: Export CSV: Badges
Given I am logged in as admin and on the Administration
# Création d'un évènement
And I follow "Gestion événements"
Then the ".content h2" element should contain "Liste des événements"
When I follow "Ajouter"
Then I fill in "titre" with "AFUP export badges"
And I fill in "nb_places" with "666"
And I press "Soumettre"
# Export
And I follow "Inscriptions"
Then I should see "Exports"
And I follow "Exporter les inscriptions pour les badges"
Then the response status code should be 200
And the response header "Content-disposition" should match '#^attachment; filename="inscriptions_forum_.*.csv"#'

Scenario: Export CSV: Inscrits aux 4 derniers événements
Given I am logged in as admin and on the Administration
# Création d'un évènement
And I follow "Gestion événements"
Then the ".content h2" element should contain "Liste des événements"
When I follow "Ajouter"
Then I fill in "titre" with "AFUP export derniers"
And I fill in "nb_places" with "4242"
And I press "Soumettre"
# Export
And I follow "Inscriptions"
Then I should see "Exports"
And I follow "Exporter les inscrits aux 4 derniers événements"
Then the response status code should be 200
And the response header "Content-disposition" should match '#^attachment; filename="inscriptions_([0-9]*)_derniers_events.csv"#'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Administration - Partie Événements - Salles (Création/Modification/Suppression)
Feature: Administration - Événements - Salles

@reloadDbWithTestData
Scenario: On crée une nouvelle salle vide
Expand Down
15 changes: 15 additions & 0 deletions tests/behat/features/Admin/Events/Suivi.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Administration - Événements - Suivi

@reloadDbWithTestData
Scenario: On vérifie la page du suivi
Given I am logged in as admin and on the Administration
And I follow "Suivi"
Then the ".content h2" element should contain "Suivi"
And the response should contain "Évolution des inscriptions"
And the response should contain "Jours de vente restants"
And the response should contain "142 jours restants"
And the response should contain "Progression des ventes: Jour 1"
And the response should contain "0 places vendues sur"
And the response should contain "Progression des ventes: Jour 2"
And the response should contain "0 places vendues sur"
And the response should contain "Répartition des billets"
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
Feature: Administration - Partie Evenements

@reloadDbWithTestData
Scenario: Accès à la liste à l'ajout d'une inscription
Given I am logged in as admin and on the Administration
And I follow "Inscriptions"
Then the ".content h2" element should contain "Inscriptions"
# ajout d'une rubrique
When I follow "Ajouter"
Then I should see "Ajouter une inscription pour le forum"
Then The "civilite" field should only contain the follow values '["M.", "Mme"]'
When I select "2" from "type_inscription"
And I fill in "nom" with "Nom participant"
And I fill in "prenom" with "Prénom participant"
And I fill in "email" with "nomparticipant@gmail.com"
And I select "2" from "type_reglement"
And I press "Soumettre"
Then I should see "L'inscription a été ajoutée"
And I should see "Inscriptions"
And I should see "Prénom participant Nom participant"

Feature: Administration - Événements - TOkens Sponsors

@reloadDbWithTestData
Scenario: Tickets sponsors
Expand Down
23 changes: 23 additions & 0 deletions tests/behat/features/Admin/Events/Virements.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Feature: Administration - Événements - Virements en attente

@reloadDbWithTestData
Scenario: Accès à la liste des virements
Given I am logged in as admin and on the Administration
# Ajout d'une inscription avec virement
And I follow "Inscriptions"
When I follow "Ajouter"
Then The "civilite" field should only contain the follow values '["M.", "Mme"]'
When I select "2" from "type_inscription"
And I fill in "nom" with "Nom participant"
And I fill in "prenom" with "Prénom participant"
And I fill in "email" with "nomparticipant@gmail.com"
And I select "2" from "type_reglement"
And I press "Soumettre"
# Accès à la liste
And I follow "Virements en attente"
Then the ".content h2" element should contain "Virements en attente de réception"
And I should see "Facture Société Montant Date Places"
And I should see "Prénom participant Nom participant"
# Marque le virement comme reçu
Then I press "Virement reçu"
And I should not see "Prénom participant Nom participant"

0 comments on commit 779f45c

Please sign in to comment.