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'); }
protected function checkAllSuitesExecuted(\CliGuy $I) { $I->seeInShellOutput('[ToastPack]'); $I->seeInShellOutput('ToastPack.unit Tests'); $I->seeInShellOutput('[EwokPack]'); $I->seeInShellOutput('EwokPack.unit Tests'); $I->seeInShellOutput('[AcmePack]'); $I->seeInShellOutput('AcmePack.unit Tests'); $I->dontSeeInShellOutput('[Spam]'); $I->dontSeeInShellOutput('[SpamPack]'); }
public function runOneGroup(\CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run skipped -g notorun'); $I->seeInShellOutput("Incomplete"); $I->dontSeeInShellOutput("Skipped"); }
public function useAlternativeFormatter(CliGuy $I) { $I->wantTo('use alternative formatter delivered through extensions'); $I->amInPath('tests/data/sandbox'); $I->executeCommand('run tests/dummy/FileExistsCept.php -c codeception_extended.yml'); $I->dontSeeInShellOutput("Check config"); $I->seeInShellOutput('[+] FileExistsCept'); $I->seeInShellOutput('Modules used: Filesystem, DumbHelper'); }
public function runOneTestFromCest(\CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run tests/dummy/AnotherCest.php:optimistic'); $I->seeShellOutputMatches("~\\(AnotherCest.optimistic\\)\\s*?Ok~"); $I->dontSeeInShellOutput('AnotherCest.pessimistic'); }
public function runTestWithFailFast(\CliGuy $I) { $I->executeCommand('run unit --no-exit'); $I->seeInShellOutput('Running FailingTest::testMe'); $I->seeInShellOutput("PassingTest::testMe"); $I->executeCommand('run unit --fail-fast --no-exit'); $I->seeInShellOutput('There was 1 failure'); $I->dontSeeInShellOutput("PassingTest::testMe"); }
public function runEnvironmentForCept(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run messages --env email'); $I->seeInShellOutput('Test emails'); $I->dontSeeInShellOutput('Multiple env given'); $I->executeCommand('run messages --env env1'); $I->dontSeeInShellOutput('Test emails'); }
public function runTestWithException(\CliGuy $I) { $I->executeCommand('run unit ExceptionTest --no-exit -v'); $I->seeInShellOutput('There was 1 error'); $I->seeInShellOutput('Helllo!'); $I->expect('Exceptions are not wrapped into ExceptionWrapper'); $I->dontSeeInShellOutput('PHPUnit_Framework_ExceptionWrapper'); $I->seeInShellOutput('RuntimeException'); }
<?php $I = new CliGuy($scenario); $I->wantTo('use alternative formatter delivered through extensions'); $I->amInPath('tests/data/sandbox'); $I->executeCommand('run tests/skipped/CommentsCept.php -c codeception_extended.yml'); $I->dontSeeInShellOutput("Trying to talk, just talk"); $I->dontSeeInShellOutput('As a very lazy qa'); $I->seeInShellOutput('[+] talk, just talk');
<?php $I = new CliGuy($scenario); $I->wantTo('see that my group extension works'); $I->amInPath('tests/data/sandbox'); $I->executeCommand('run skipped -g notorun -c codeception_grouped.yml'); $I->dontSeeInShellOutput("======> Entering NoGroup Test Scope\nMake it incomplete"); $I->dontSeeInShellOutput('<====== Ending NoGroup Test Scope'); $I->executeCommand('run dummy -g ok -c codeception_grouped.yml'); $I->dontSeeInShellOutput("======> Entering Ok Test Scope\nMake it incomplete"); $I->dontSeeInShellOutput('<====== Ending Ok Test Scope');
<?php $I = new CliGuy($scenario); $I->wantTo('see that my group events fire only once'); $I->amInPath('tests/data/claypit'); $I->executeCommand('run dummy -g countevents -c codeception_grouped.yml'); $I->seeInShellOutput('Group Before Events: 1'); $I->dontSeeInShellOutput('Group Before Events: 2'); $I->seeInShellOutput('Group After Events: 1'); $I->dontSeeInShellOutput('Group After Events: 2');