-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1208 from stakovicz/feat-1110-tests-fonctionnels
feat (#1110): test fonctionnels
- Loading branch information
Showing
7 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
use Phinx\Seed\AbstractSeed; | ||
|
||
class TechletterSubscriptions extends AbstractSeed | ||
{ | ||
public function run() | ||
{ | ||
$subscriptionDate = (new DateTime())->format(DateTime::ATOM); | ||
$data = [ | ||
[ | ||
'user_id' => Users::ID_USER_ADMIN, | ||
'subscription_date' => $subscriptionDate, | ||
], | ||
[ | ||
'user_id' => Users::ID_USER_EXPIRIE, | ||
'subscription_date' => $subscriptionDate, | ||
], | ||
]; | ||
|
||
$table = $this->table('afup_techletter_subscriptions'); | ||
|
||
$table->truncate(); | ||
|
||
$table | ||
->insert($data) | ||
->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ public function run() | |
'niveau' => 2, // AFUP_DROITS_NIVEAU_ADMINISTRATEUR, | ||
'prenom' => 'Admin', | ||
'email' => '[email protected]', | ||
'niveau_modules' => '00000' | ||
], | ||
// utilisateur ayant expiré, avec une date de cotisation fixe, utile pour les tests | ||
[ | ||
|
@@ -61,6 +62,7 @@ public function run() | |
'niveau' => 0, // AFUP_DROITS_NIVEAU_MEMBRE, | ||
'prenom' => 'Jean', | ||
'email' => '[email protected]', | ||
'niveau_modules' => '00000', | ||
], | ||
[ | ||
'id' => self::ID_USER_PERSONNE_MORALE, | ||
|
@@ -72,6 +74,7 @@ public function run() | |
'email' => '[email protected]', | ||
'roles' => '["ROLE_COMPANY_MANAGER"]', | ||
'id_personne_morale' => self::ID_PERSONNE_MORALE_MY_CORP, | ||
'niveau_modules' => '00000', | ||
], | ||
[ | ||
'id' => self::ID_USER_PERSONNE_MORALE_NON_MANAGER, | ||
|
@@ -83,6 +86,7 @@ public function run() | |
'email' => '[email protected]', | ||
'roles' => '[]', | ||
'id_personne_morale' => self::ID_PERSONNE_MORALE_MY_CORP, | ||
'niveau_modules' => '00000', | ||
], | ||
[ | ||
'id' => self::ID_USER_PERSONNE_PHYSIQUE, | ||
|
@@ -93,7 +97,8 @@ public function run() | |
'niveau' => 0, // AFUP_DROITS_NIVEAU_MEMBRE, | ||
'email' => '[email protected]', | ||
'roles' => '[]', | ||
'etat' => User::STATUS_ACTIVE | ||
'etat' => User::STATUS_ACTIVE, | ||
'niveau_modules' => '00000', | ||
], | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/behat/features/Admin/Techletter/AdminVeilleAbonnés.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Administration - Veille - Abonnés | ||
|
||
@reloadDbWithTestData @test | ||
Scenario: Accès aux abonnés de la veille technique | ||
Given I am logged in as admin and on the Administration | ||
And I follow "Abonnés" | ||
Then the ".content .statistic .value" element should contain "2" | ||
And the ".content .statistic .label" element should contain "abonnés" | ||
And I should see "Nom" in the "thead > tr:first-child > th:nth-child(1)" element | ||
And I should see "Date d'enregistrement" in the "thead > tr:first-child > th:nth-child(2)" element | ||
And I should see "Admin Admin" in the "tbody > tr:first-child > td:nth-child(1)" element | ||
And I should see "Jean Maurice" in the "tbody > tr:last-child > td:nth-child(1)" element |
34 changes: 34 additions & 0 deletions
34
tests/behat/features/Admin/Techletter/AdminVeilleCampagnes.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Feature: Administration - Veille - Campagnes | ||
|
||
@reloadDbWithTestData | ||
@test | ||
@clearEmails | ||
Scenario: Créer une campagne pour la veille tech | ||
Given I am logged in as admin and on the Administration | ||
And I follow "Campagnes" | ||
Then the ".content h2" element should contain "Campagnes" | ||
And I should see "ID" in the "thead > tr:first-child > th:nth-child(1)" element | ||
And I should see "Date d'envoi planifiée" in the "thead > tr:first-child > th:nth-child(2)" element | ||
And I should see "Envoyée à mailchimp ?" in the "thead > tr:first-child > th:nth-child(3)" element | ||
|
||
When I select "1" from "sending_sendingDate_day" | ||
And I select "2" from "sending_sendingDate_month" | ||
And I select "2023" from "sending_sendingDate_year" | ||
And I press "sending_save" | ||
Then the ".content h2" element should contain "Veille de l'AFUP du 01/02/2023" | ||
|
||
When I press "Envoyer une newsletter de test au Pôle" | ||
And I should only receive the following emails: | ||
| to | subject | | ||
| <pole-veille@afup.org> | [Test] Veille de l'AFUP du 01/02/2023 | | ||
And the ".content .header" element should contain "Le mail de test a été envoyé" | ||
|
||
When I fill in "sendingDate" with "2023-02-01 12:00:00" | ||
And I press "Mettre à jour la date de planification" | ||
And the ".content .header" element should contain "Date mise à jour" | ||
|
||
When I follow "Campagnes" | ||
Then the ".content h2" element should contain "Campagnes" | ||
And I should see "3" in the "tbody > tr:last-child > td:nth-child(1)" element | ||
And I should see "01/02/2023" in the "tbody > tr:last-child > td:nth-child(2)" element | ||
And I should see "non" in the "tbody > tr:last-child > td:nth-child(3)" element |
File renamed without changes.