From 1caaf094df8359a68aeeb573b39fd43d7a9d0e1b Mon Sep 17 00:00:00 2001 From: Luquor <signorellilucas7@gmail.com> Date: Fri, 17 Feb 2023 22:29:26 +0100 Subject: [PATCH] Tests' implementation --- tests/Acceptance/PremierCest.php | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/tests/Acceptance/PremierCest.php b/tests/Acceptance/PremierCest.php index 000be14..a948bfb 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'); } } -- GitLab