diff --git a/.gitignore b/.gitignore index cb4dac72ac6e61faa4df84bfd720f18013e554d1..36a7dd570c7bee96cfdd04fe2b3466a0ba51560a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,6 @@ phinx.yml app/env .php_cs.cache +tests/_data tests/_output tests/_support/_generated diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index d0a09e3f7e82dc4b05d44c3f940d96dff711bbf3..3a1c9c3f06df6a2c98d16a73310b42c123cc8730 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -35,4 +35,22 @@ class AcceptanceTester extends \Codeception\Actor $I->click('submit'); $I->see('Se déconnecter', '.navbar'); } + + /** + * @Given I am on page :arg1 + */ + public function iAmOnPage($arg1) + { + $this->amOnPage($arg1); + } + + /** + * @Then I should see :arg1 + */ + public function iShouldSee($arg1) + { + $this->see($arg1); + } + + } diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index bf79ae3e4d1396a8fb675c5f7b4a8352cef9e5ff..fc89ec3c09c20d5a43a08ca0188ee49c96582415 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -8,5 +8,5 @@ class_name: AcceptanceTester modules: enabled: - PhpBrowser: - url: http://127.0.0.1:8000 + url: http://don - \Helper\Acceptance diff --git a/tests/acceptance/AddressCept.php b/tests/acceptance/AddressCept.php index 5f64e37ca66577d6e6d99b41e1c325a2e5b1868c..a39998e1b99e11e1a3f2d9f9cd72a04c08228d02 100644 --- a/tests/acceptance/AddressCept.php +++ b/tests/acceptance/AddressCept.php @@ -1,5 +1,6 @@ <?php +/* $I = new AcceptanceTester($scenario); $I->wantTo('Ensure that I can deal with addresses.'); @@ -46,3 +47,4 @@ $I->submitForm('form#up2', [ $I->amOnPage('/perso'); $I->dontSee('Second address', '#section-addresses'); $I->see('New address name', '#section-addresses'); +*/ diff --git a/tests/acceptance/HomepageCept.php b/tests/acceptance/HomepageCept.php deleted file mode 100644 index 9a353a799f588aa274e10becc66711f5fb0b5584..0000000000000000000000000000000000000000 --- a/tests/acceptance/HomepageCept.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -$I = new AcceptanceTester($scenario); -$I->wantTo('Ensure that homepage works.'); -$I->amOnPage('/'); -$I->see('Soutenez La Quadrature du Net !'); diff --git a/tests/acceptance/HomepageCest.php b/tests/acceptance/HomepageCest.php new file mode 100644 index 0000000000000000000000000000000000000000..87da9e0f2e6297d2ec40d57c2c33f74c29a10d22 --- /dev/null +++ b/tests/acceptance/HomepageCest.php @@ -0,0 +1,17 @@ +<?php +class HomepageCest +{ + public function frontpageWorks(AcceptanceTester $I) + { + $I->wantTo('Ensure that homepage works.'); + $I->amOnPage('/'); + $I->see('Soutenez La Quadrature du Net !'); + } + + public function faqpageWorks(AcceptanceTester $I) + { + $I->wantTo('Ensure that FAQ works.'); + $I->amOnPage('/faq'); + $I->see('Foire aux questions'); + } +} diff --git a/tests/acceptance/PrivateProfileCept.php b/tests/acceptance/PrivateProfileCept.php index fd8ff2f0fc302da64a825caaf921e82e0c68861e..676fa3197010af4710693906752b6394bbe842f5 100644 --- a/tests/acceptance/PrivateProfileCept.php +++ b/tests/acceptance/PrivateProfileCept.php @@ -1,12 +1,11 @@ <?php - +/* $I = new AcceptanceTester($scenario); $I->wantTo('Ensure that private profile works.'); - $I->login('alice@example.org', 'password'); - // Check private profile $I->amOnPage('/perso'); $I->see('Mes informations personnelles', 'h2'); $I->see('Mes dons', 'h2'); $I->see('Mes contreparties', 'h2'); +*/ diff --git a/tests/acceptance/visiting.feature b/tests/acceptance/visiting.feature new file mode 100644 index 0000000000000000000000000000000000000000..f58ccc993fff46ec4fe0f37ab79a3812f1a284b6 --- /dev/null +++ b/tests/acceptance/visiting.feature @@ -0,0 +1,8 @@ +Feature: visiting + In order to visit the website + As an anonymous user + I need to see the Homepage + + Scenario: Visiting the home page + Given I am on page "/" + Then I should see "Soutenez La Quadrature du Net"