GherkinCest.php
3.01 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* @group gherkin
*/
class GherkinCest
{
public function _before(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
}
public function steps(CliGuy $I)
{
$I->executeCommand('gherkin:steps scenario');
$I->seeInShellOutput('I have terminal opened');
$I->seeInShellOutput('ScenarioGuy::terminal');
$I->seeInShellOutput('there is a file :name');
$I->seeInShellOutput('I see file :name');
$I->seeInShellOutput('ScenarioGuy::matchFile');
}
public function snippets(CliGuy $I)
{
$I->executeCommand('gherkin:snippets scenario');
$I->seeInShellOutput('@Given I have only idea of what\'s going on here');
$I->seeInShellOutput('public function iHaveOnlyIdeaOfWhatsGoingOnHere');
}
public function snippetsScenarioFile(CliGuy $I)
{
$I->executeCommand('gherkin:snippets scenario FileExamples.feature');
$I->dontSeeInShellOutput('@Given I have only idea of what\'s going on here');
$I->dontSeeInShellOutput('public function iHaveOnlyIdeaOfWhatsGoingOnHere');
}
public function snippetsScenarioFolder(CliGuy $I)
{
$I->executeCommand('gherkin:snippets scenario subfolder');
$I->seeInShellOutput('Given I have a feature in a subfolder');
$I->seeInShellOutput('public function iHaveAFeatureInASubfolder');
$I->dontSeeInShellOutput('@Given I have only idea of what\'s going on here');
$I->dontSeeInShellOutput('public function iHaveOnlyIdeaOfWhatsGoingOnHere');
}
public function snippetsPyStringArgument(CliGuy $I)
{
$I->executeCommand('gherkin:snippets scenario PyStringArgumentExample.feature');
$I->seeInShellOutput('@Given I have PyString argument :arg1');
$I->seeInShellOutput('public function iHavePyStringArgument($arg1)');
$I->dontSeeInShellOutput('public function iSeeOutput($arg1)');
}
public function runIncompletedStepWithPyStringArgument(CliGuy $I)
{
$I->executeCommand('run scenario "PyStringArgumentExample.feature:PyString argument" --steps');
$I->seeInShellOutput('Step definition for `I have PyString argument ""` not found in contexts');
$I->dontSeeInShellOutput('Step definition for `I see output` not found in contexts');
}
public function runSameStepWithInlineAndPyStringArgument(CliGuy $I)
{
$I->executeCommand('run scenario "InlineArgumentExample.feature:Running step with inline argument" --steps');
$I->seeInShellOutput("Argument: test");
$I->executeCommand('run scenario "PyStringArgumentExample.feature:Running step with PyString argument" --steps');
$I->seeInShellOutput("Argument: First line\nSecond line");
}
public function snippetsScenarioUtf8(CliGuy $I)
{
$I->executeCommand('gherkin:snippets scenario Utf8Example.feature');
$I->seeInShellOutput('@Given я написал сценарий на языке :arg1');
$I->seeInShellOutput('public function step_62e20dc62($arg1)');
}
}