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 12, 2023
1 parent 7ebc7d4 commit ac74ba7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 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
14 changes: 12 additions & 2 deletions db/seeds/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 not contain "Adrien GALLOU - AFUP"
And the response should contain "Geoffrey BACHELET - AFUP"

@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 contain "Adrien GALLOU - AFUP"
And the response should contain "Geoffrey BACHELET - AFUP"

@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"

0 comments on commit ac74ba7

Please sign in to comment.