GeneratePageObjectCest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @guy CliGuy\GeneratorSteps
  4. */
  5. class GeneratePageObjectCest
  6. {
  7. public function generateGlobalPageObject(CliGuy\GeneratorSteps $I)
  8. {
  9. $I->amInPath('tests/data/sandbox');
  10. $I->executeCommand('generate:page Login');
  11. $I->seeFileWithGeneratedClass('Login', 'tests/_support/Page');
  12. $I->seeInThisFile('static $URL = ');
  13. $I->dontSeeInThisFile('public function __construct(\DumbGuy $I)');
  14. $I->seeFileFound('tests/_bootstrap.php');
  15. }
  16. public function generateSuitePageObject(CliGuy\GeneratorSteps $I)
  17. {
  18. $I->amInPath('tests/data/sandbox');
  19. $I->executeCommand('generate:page dummy Login');
  20. $I->seeFileWithGeneratedClass('Login', 'tests/_support/Page/Dummy');
  21. $I->seeInThisFile('namespace Page\\Dummy;');
  22. $I->seeInThisFile('class Login');
  23. $I->seeInThisFile('protected $dumbGuy;');
  24. $I->seeInThisFile('public function __construct(\DumbGuy $I)');
  25. }
  26. public function generateGlobalPageObjectInDifferentPath(CliGuy\GeneratorSteps $I)
  27. {
  28. $I->executeCommand('generate:page Login -c tests/data/sandbox');
  29. $I->amInPath('tests/data/sandbox');
  30. $I->seeFileWithGeneratedClass('Login', 'tests/_support/Page');
  31. $I->seeInThisFile('static $URL = ');
  32. $I->dontSeeInThisFile('public function __construct(\DumbGuy $I)');
  33. $I->seeFileFound('tests/_bootstrap.php');
  34. }
  35. }