Skip to content

Commit

Permalink
feat (afup#1110): functional test
Browse files Browse the repository at this point in the history
API pour event :
- Planning
- Programmee
- Speakers
- Ical
  • Loading branch information
stakovicz committed Nov 13, 2023
1 parent 7ebc7d4 commit 3260cbe
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 7 deletions.
3 changes: 2 additions & 1 deletion db/seeds/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function run()
'date_fin_saisie_repas_speakers' => $event - $oneDayInSeconds * 7,
'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7,
'place_name' => 'Paris',
'place_address' => 'Marriott Rive Gauche'
'place_address' => 'Marriott Rive Gauche',
'date_annonce_planning' => date('Y-m-d', $event),
],
];

Expand Down
18 changes: 14 additions & 4 deletions db/seeds/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function run()
'language_code' => 'fr',
'markdown' => 1,
'joindin' => 24041,
'date_publication' => $date->format('Y-m-d H:i:s')
'date_publication' => null
],
[
'session_id' => self::ID_SESSIONS[1],
Expand All @@ -59,7 +59,7 @@ public function run()
'language_code' => 'fr',
'markdown' => 0,
'joindin' => 24138,
'date_publication' => $date->format('Y-m-d H:i:s')
'date_publication' => (new \DateTime())->modify('-1 days')->format('Y-m-d H:i:s')
],
[
'session_id' => 3,
Expand All @@ -81,7 +81,7 @@ public function run()
'language_code' => 'fr',
'markdown' => 1,
'joindin' => 24041,
'date_publication' => $date->format('Y-m-d H:i:s')
'date_publication' => (new \DateTime())->modify('+5 days')->format('Y-m-d H:i:s')
],
];

Expand Down Expand Up @@ -111,6 +111,16 @@ public function run()
->save()
;

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

$table
->insert([
'id' => 1,
'nom' => 'La salle T',
'id_forum' => Event::ID_FORUM,
])
->save();

$i = 1;
$plannings = [];
Expand All @@ -120,7 +130,7 @@ public function run()
'id_session' => $session['session_id'],
'debut' => $dateDebut->format('U'),
'fin' => $date->format('U'),
'id_salle' => 0,
'id_salle' => 1,
'id_forum' => Event::ID_FORUM,
'keynote' => ''
];
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/Admin/Events/Salles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Administration - Évènements - Salles
When I press "Ajouter"
And I should see "La salle \"La salle ronde\" a été ajoutée."
And I should see "Liste des salles pour forum"
And I fill in "edit_room_53_name" with "La grande salle ronde"
And I fill in "edit_room_1_name" with "La grande salle ronde"
When I press "Sauvegarder"
And I should see "La salle \"La grande salle ronde\" a été sauvegardée."
And I should see "Liste des salles pour forum"
Expand Down
51 changes: 51 additions & 0 deletions tests/behat/features/Api/Api.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Feature: API pour event

@reloadDbWithTestData
Scenario: Liste du programme sans filtre
Given I am on "/blog/forum/program?apply-publication-date-filters=0&speakers-page-prefix=/forum/conferencier-e-s/"
Then the response should contain "<script type=\"application/ld+json\">"
And the response should contain "Jouons tous ensemble à un petit jeu"
And the response should contain "REST ou GraphQL ? Exemples illustrés avec Symfony et API Platform"
And the response should contain "Révolutionons PHP"

@reloadDbWithTestData
Scenario: Liste du programme avec filtre
Given I am on "/blog/forum/program?apply-publication-date-filters=1&speakers-page-prefix=/forum/conferencier-e-s/"
Then the response should contain "<script type=\"application/ld+json\">"
And the response should contain "Jouons tous ensemble à un petit jeu"
And the response should contain "REST ou GraphQL ? Exemples illustrés avec Symfony et API Platform"
And the response should not contain "Révolutionons PHP"

@reloadDbWithTestData
Scenario: Planning
Given I am on "/blog/forum/planning"
Then the response should contain "La salle T"
And the response should contain "<script type=\"application/ld+json\">"

@reloadDbWithTestData
Scenario: Speakers sans filtre
Given I am on "/blog/forum/speakers?apply-publication-date-filters=0"
Then the response should contain "<script type=\"application/ld+json\">"
And the response should contain "Adrien GALLOU"
And the response should contain "Geoffrey BACHELET"

@reloadDbWithTestData
Scenario: Speakers avec filtre
Given I am on "/blog/forum/speakers?apply-publication-date-filters=1"
Then the response should contain "<script type=\"application/ld+json\">"
And the response should not contain "Adrien GALLOU"
And the response should contain "Geoffrey BACHELET"

@reloadDbWithTestData
Scenario: Ical Talk 1
Given I am on "/blog/talk_widget?ids=1"
Then the response should contain "Jouons tous ensemble à un petit jeu"
And the response should not contain "REST ou GraphQL ? Exemples illustrés avec Symfony et API Platform"
And the response should contain "Geoffrey BACHELET"

@reloadDbWithTestData
Scenario: Ical Talk 1 et 2
Given I am on "/blog/talk_widget?ids=1,2"
Then the response should contain "Jouons tous ensemble à un petit jeu"
And the response should contain "REST ou GraphQL ? Exemples illustrés avec Symfony et API Platform"
And the response should contain "Geoffrey BACHELET"
3 changes: 2 additions & 1 deletion tests/behat/features/Api/Talks/OpenfeedbackExport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Feature: Export talks Openfeedback - API
Given I am on "/event/forum/openfeedback.json"
Then the response status code should be 200
And the response header "Content-Type" should match "#^application/json#"
And the response header "Content-Length" should match "#^1018#"
And the response should contain "Jouons tous ensemble \u00e0 un petit jeu"
And the response should contain "REST ou GraphQL ? Exemples illustr\u00e9s avec Symfony et API Platform"

0 comments on commit 3260cbe

Please sign in to comment.