LoggedInCest.php 551 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types = 1);
  3. class LoggedInCest
  4. {
  5. public function _before(AcceptanceTester $I)
  6. {
  7. $I->wantTo('Login');
  8. $I->amOnPage('/main/login');
  9. $I->fillField('_username', 'taken_user');
  10. $I->fillField('_password', 'foobar');
  11. $I->click('Sign in');
  12. }
  13. private function run(AcceptanceTester $I, string $page, string $see): void
  14. {
  15. $I->amOnPage($page);
  16. $I->see($see);
  17. }
  18. public function root(AcceptanceTester $I)
  19. {
  20. $this->run($I, '/', 'Feed');
  21. }
  22. }