diff --git a/tests/Acceptance/PremierCest.php b/tests/Acceptance/PremierCest.php index 000be141338b459291322875986f56ad82d8d8be..a948bfb9298b8796f9b2a48763d1d29e7cfef507 100644 --- a/tests/Acceptance/PremierCest.php +++ b/tests/Acceptance/PremierCest.php @@ -11,8 +11,38 @@ class PremierCest { } - // tests - public function tryToTest(AcceptanceTester $I) + + /** + * Test if the home page is accessible by seeking the word "Example :" in the page + */ + public function homePageTest(AcceptanceTester $I) { + $I->amOnPage('/'); + $I->see('Example :'); + } + + + /** + * Test if there is a changement in the page when the form is filled and the button is clicked + */ + public function fillFormTest(AcceptanceTester $I) + { + $I->amOnPage('/'); + $I->fillField('question', 'Check if word is a palindromic word'); + $I->click('Envoyer'); + $I->see('Request :'); + } + + + /** + * Test if the code is generated when the form is filled by seeking in the source + * This is the only way to test if the code is generated because the code is generated in a textarea + */ + public function checkAnswerTest(AcceptanceTester $I) + { + $I->amOnPage('/'); + $I->fillField('question', 'Check if word is a palindromic word'); + $I->click('Envoyer'); + $I->seeInSource('public'); } }