-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ae1128
commit bd59cb1
Showing
14 changed files
with
211 additions
and
6 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,3 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/config_test.php'; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
default: | ||
context: | ||
parameters: | ||
base_url: http://aperophp.local | ||
base_url: http://www.aperophp.dev | ||
extensions: | ||
Behat\MinkExtension\Extension: | ||
base_url: http://aperophp.local | ||
base_url: http://www.aperophp.dev |
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
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,18 @@ | ||
# language: fr | ||
|
||
Fonctionnalité: La gestion des comptes est fonctionnelle | ||
|
||
Scénario: Il est possible de s'inscrire | ||
Quand je vais sur la page d'inscription | ||
Alors la page d'inscription s'affiche correctement | ||
Quand je me créé un compte "test_behat"/"password"/"[email protected]" | ||
Alors imprimer la dernière réponse | ||
Alors la page de connexion s'affiche correctement | ||
Et le message de succès "Votre compte a été créé avec succès." s'affiche | ||
|
||
# Scénario: Il est possible de se connecter | ||
# Quand je vais sur la page de connexion | ||
# Alors la page de connexion s'affiche correctement | ||
# Quand je me connecte avec les identifiants "test_behat"/"password" | ||
# Alors je suis sur la page d'accueil | ||
# Et je suis connecté en tant que "test_behat" |
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,24 @@ | ||
Pré-requis | ||
|
||
* DONE Reprendre le process de création de schéma de bdd pour être plus indépendant de la ligne de commande | ||
* DONE Créer un controler Behat qui se connecte sur une BDD de dev | ||
* DONE Monter la volée une base de données SQLite avant chaque test Behat | ||
|
||
Tests Behat | ||
|
||
* Compte | ||
* S'incrire | ||
* Se connecter | ||
* Se déconnecter | ||
|
||
* Apéro | ||
* Liste des apéros | ||
* Consulter un apéro | ||
* S'inscrire à un apéro | ||
* Déposer un commentaire | ||
* Créer un apéro | ||
* Modifier un apéro | ||
|
||
MEP | ||
|
||
* Modifier Capistrano pour ne pas déployer le controler Behat |
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,36 @@ | ||
<?php | ||
|
||
namespace Aperophp\Test\Functional\Context; | ||
|
||
use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext; | ||
use Behat\Behat\Exception\PendingException; | ||
use Behat\Behat\Context\Step; | ||
|
||
class SigninContext extends PageObjectContext | ||
{ | ||
/** | ||
* @Given /^je vais sur la page de connexion$/ | ||
*/ | ||
public function jeVaisSurLaPageDeConnexion() | ||
{ | ||
$this->getPage('Signin')->open(); | ||
} | ||
|
||
/** | ||
* @Given /^la page de connexion s\'affiche correctement$/ | ||
*/ | ||
public function laPageDeConnexionSAfficheCorrectement() | ||
{ | ||
return array( | ||
new Step\Then(sprintf('la page "%s" s\'affiche correctement', $this->getPage('Signin')->path)), | ||
); | ||
} | ||
|
||
/** | ||
* @Given /^je me connecte avec les identifiants "([^"]*)"\/"([^"]*)"$/ | ||
*/ | ||
public function jeMeConnecteAvecLesIdentifiants($login, $password) | ||
{ | ||
|
||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace Aperophp\Test\Functional\Context; | ||
|
||
use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext; | ||
use Behat\Behat\Exception\PendingException; | ||
use Behat\Behat\Context\Step; | ||
|
||
class SignupContext extends PageObjectContext | ||
{ | ||
/** | ||
* @Given /^je vais sur la page d\'inscription$/ | ||
*/ | ||
public function jeVaisSurLaPageDInscription() | ||
{ | ||
$this->getPage('Signup')->open(); | ||
} | ||
|
||
/** | ||
* @Given /^la page d\'inscription s\'affiche correctement$/ | ||
*/ | ||
public function laPageDInscriptionSAfficheCorrectement() | ||
{ | ||
return array( | ||
new Step\Then(sprintf('la page "%s" s\'affiche correctement', $this->getPage('Signup')->path)), | ||
); | ||
} | ||
|
||
/** | ||
* @Given /^je me créé un compte "([^"]*)"\/"([^"]*)"\/"([^"]*)"$/ | ||
*/ | ||
public function jeMeCreeUnCompte($login, $password, $email) | ||
{ | ||
$this->getPage('Signup')->createAccount($login, $password, $email); | ||
} | ||
} |
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
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,15 @@ | ||
<?php | ||
|
||
namespace Aperophp\Test\Functional\Page; | ||
|
||
use SensioLabs\Behat\PageObjectExtension\PageObject; | ||
|
||
class Signin extends PageObject\Page | ||
{ | ||
/** | ||
* Page url | ||
* | ||
* @var string | ||
*/ | ||
public $path = '/member/signin.html'; | ||
} |
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,48 @@ | ||
<?php | ||
|
||
namespace Aperophp\Test\Functional\Page; | ||
|
||
use SensioLabs\Behat\PageObjectExtension\PageObject; | ||
|
||
class Signup extends PageObject\Page | ||
{ | ||
/** | ||
* Page url | ||
* | ||
* @var string | ||
*/ | ||
public $path = '/member/signup.html'; | ||
|
||
/** | ||
* Page elements | ||
* | ||
* @var array | ||
*/ | ||
protected $elements = array( | ||
'form' => array('css' => 'form#signup') | ||
); | ||
|
||
/** | ||
* Create an account | ||
* | ||
* @param string $username | ||
* @param string $password | ||
* @param string $email | ||
* @param string $firstname | ||
* @param string $lastname | ||
* | ||
* @return void | ||
*/ | ||
public function createAccount($username, $password, $email, $firstname=null, $lastname=null) | ||
{ | ||
$signupForm = $this->getElement('form'); | ||
|
||
$signupForm->fillField('signup_member_username', $username); | ||
$signupForm->fillField('signup_member_password', $password); | ||
$signupForm->fillField('signup_user_email', $email); | ||
$signupForm->fillField('signup_user_lastname', $lastname); | ||
$signupForm->fillField('signup_user_firstname', $firstname); | ||
|
||
return $signupForm->pressButton('S\'inscrire'); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
|
||
$app = require_once __DIR__.'/../app/app.php'; | ||
$app->run(); | ||
$app->run(); |
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,5 @@ | ||
<?php | ||
|
||
$app = require_once __DIR__.'/../app/app.php'; | ||
require_once __DIR__.'/../app/config_behat.php'; | ||
$app->run(); |