forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGeneratePageObjectCest.php
More file actions
30 lines (25 loc) · 1.06 KB
/
Copy pathGeneratePageObjectCest.php
File metadata and controls
30 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* @guy CliGuy\GeneratorSteps
*/
class GeneratePageObjectCest
{
public function generateGlobalPageObject(CliGuy\GeneratorSteps $I) {
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:page Login');
$I->seeFileWithGeneratedClass('LoginPage','tests/_pages');
$I->seeInThisFile('const URL = ');
$I->dontSeeInThisFile('public static function of(DummyGuy $I)');
$I->seeFileFound('tests/_bootstrap.php');
$I->seeInThisFile("\\Codeception\\Util\\Autoload::registerSuffix('Page', __DIR__.DIRECTORY_SEPARATOR.'_pages'");
}
public function generateSuitePageObject(CliGuy\GeneratorSteps $I) {
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:page dummy Login');
$I->seeFileWithGeneratedClass('LoginPage','tests/dummy/_pages');
$I->seeInThisFile('class LoginPage');
$I->seeInThisFile('protected $dumbGuy;');
$I->seeInThisFile('public static function of(DumbGuy $I)');
$I->seeAutoloaderWasAdded('Page', 'tests/dummy');
}
}