-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (#1110): functional test Planete PHP
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 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
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,43 @@ | ||
<?php | ||
|
||
use Phinx\Seed\AbstractSeed; | ||
|
||
class FeedArticle extends AbstractSeed | ||
{ | ||
public function run() | ||
{ | ||
$feed = [ | ||
'nom' => 'Un super site PHP', | ||
'url' => 'https://afup.org', | ||
'feed' => 'https://afup.org/rss.xml', | ||
'etat' => 0, | ||
]; | ||
$table = $this->table('afup_planete_flux'); | ||
$table->truncate(); | ||
|
||
$table | ||
->insert($feed) | ||
->save(); | ||
|
||
$data = [ | ||
[ | ||
'afup_planete_flux_id' => 2, | ||
'clef' => '0482a33e-7370-11ee-b962-0242ac120002', | ||
'titre' => 'Un titre', | ||
'url' => 'https://afup.org/url.html', | ||
'maj' => time(), | ||
'auteur' => 'Un super auteur', | ||
'resume' => 'Un super article', | ||
'contenu' => 'Le contenu du super article', | ||
'etat' => 1 | ||
], | ||
]; | ||
|
||
$table = $this->table('afup_planete_billet'); | ||
$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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Feature: Administration - Planète PHP - Billets | ||
|
||
@reloadDbWithTestData | ||
Scenario: Gestion des flux | ||
Given I am logged in as admin and on the Administration | ||
When I follow "Billets" | ||
Then the ".content h2" element should contain "Billets" | ||
And I should see "Un titre Le contenu du super article Actif" |
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,31 @@ | ||
Feature: Administration - Planète PHP - Flux | ||
|
||
Scenario: Gestion des flux | ||
Given I am logged in as admin and on the Administration | ||
When I follow "Flux" | ||
Then the ".content h2" element should contain "Flux" | ||
# Ajout d'un flux | ||
When I follow "Ajouter" | ||
Then the ".content h2" element should contain "Ajouter un flux" | ||
When I fill in "feed_form[name]" with "Site web les-tilleuls.coop" | ||
And I fill in "feed_form[url]" with "https://les-tilleuls.coop" | ||
And I fill in "feed_form[feed]" with "https://les-tilleuls.coop/feed.xml" | ||
And I press "Ajouter" | ||
Then the ".content .message" element should contain "Le flux a été ajouté" | ||
# Liste des flux | ||
And I should see "les-tilleuls.coop https://les-tilleuls.coop Actif Oui non testé" | ||
# Test de validité | ||
When I follow "Test validité" | ||
And I should see "les-tilleuls.coop https://les-tilleuls.coop Actif Oui validé" | ||
# Modification + désactivation d'un flux | ||
When I follow the button of tooltip "Modifier la fiche de Site web les-tilleuls.coop" | ||
Then the ".content h2" element should contain "Modifier un flux" | ||
When I fill in "feed_form[name]" with "Site web les-tilleuls.coop modifié" | ||
And I select "0" from "feed_form[status]" | ||
And I press "Modifier" | ||
Then the ".content .message" element should contain "Le flux a été modifié" | ||
And I should see "les-tilleuls.coop modifié https://les-tilleuls.coop Inactif" | ||
# Suppression | ||
When I follow the button of tooltip "Supprimer la fiche de Site web les-tilleuls.coop modifié" | ||
Then the ".content .message" element should contain "Le flux a été supprimé" | ||
And I should not see "les-tilleuls.coop" |