Skip to content

Instantly share code, notes, and snippets.

@sorokadima
Last active May 15, 2020 14:05
Show Gist options
  • Save sorokadima/b8e2fdf72cd93eeb8cdf1d86e8f3424c to your computer and use it in GitHub Desktop.
Save sorokadima/b8e2fdf72cd93eeb8cdf1d86e8f3424c to your computer and use it in GitHub Desktop.
codeception (php-unit, php unit, testing, test, тестування, тест, тестирование, codecept debug)

codecept debug

codecept_debug($I->grabTextFrom('body'));

before run testing

public function _before(\FunctionalTester $I)
{
	$I->amOnPage(['en/account/register']);
}

goto page

$I->amOnPage('/en/index');

check element (text, element selector)

$I->see('Sign Up', '.button');

check link (text, link address)

$I->see('Homepage', Locator::href('/en/index'));

run single test

vendor/bin/codecept run functional ContactFormCest:openContactFormByUser

login (user id)

$I->amLoggedInAs(111);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment