Skip to content

Instantly share code, notes, and snippets.

@yupe
Created September 13, 2013 06:21
Show Gist options
  • Save yupe/6547244 to your computer and use it in GitHub Desktop.
Save yupe/6547244 to your computer and use it in GitHub Desktop.
А вот так тесты писать приятнее +) Codeception рулит =)
<?php
use \WebGuy;
class UserLoginCest
{
public function testLoginPage(WebGuy $I) {
$I->amOnPage('/user/account/login');
$I->seeInTitle('Войти');
$I->seeLink('Забыли пароль?');
$I->see('Войти');
$I->seeLink('Регистрация');
$I->seeInField('LoginForm[email]','');
$I->seeInField('LoginForm[password]','');
}
public function testAuthWrongFormat(WebGuy $I) {
$I->amOnPage('/user/account/login');
$I->fillField('LoginForm[email]','test');
$I->fillField('LoginForm[password]','test');
$I->click('Войти');
$I->see('Email не является правильным E-Mail адресом','.alert-error');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment