forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneratePageObjectCest.php
More file actions
43 lines (36 loc) · 1.67 KB
/
Copy pathGeneratePageObjectCest.php
File metadata and controls
43 lines (36 loc) · 1.67 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
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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('static $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->seeInThisFile('@return LoginPage');
$I->seeAutoloaderWasAdded('Page', 'tests/dummy');
}
public function generateGlobalPageObjectInDifferentPath(CliGuy\GeneratorSteps $I)
{
$I->executeCommand('generate:page Login -c tests/data/sandbox');
$I->amInPath('tests/data/sandbox');
$I->seeFileWithGeneratedClass('LoginPage','tests/_pages');
$I->seeInThisFile('static $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'");
}
}