Михаил Боднарчук
Михаил Боднарчук
$I = new AcceptanceTester($scenario);
$I->amOnPage('/login');
$I->fillField('email','[email protected]');
$I->fillField('password','mysecurepassword');
$I->click('#loginForm input[type=submit]');
$I->seeCurrentUrlIs('/dashboard');
$I->see('Welcome back','.notice');
I = new AcceptanceTester
I amOnPage '/login'
I fillField 'email','[email protected]'
I fillField 'password','mysecurepassword'
I click '#loginForm input[type=submit]'
I seeCurrentUrlIs '/dashboard'
I see 'Welcome back', '.notice'
$I->click('Login');
$I->click('#loginForm input[type=submit]');
$I->click('./*[@id='loginForm']/input[@type='submit']');
$I->click(['name' => 'submit']);
$I->click(LoginPage::$submitButton);
LoginPage::of($I)
->login('[email protected]','mysecurepassword');
$I = new AcceptanceTester\UserSteps($scenario);
$I->logIn('myemail', 'mysecurepassword');
$I->see('Welcome back', '.notice');
function clickGreenButton() {
$this->webDriver->findElement(
WebDriverBy::cssSelector('#green button')
)->click();;
}
// в тесте:
$I->clickGreenButton();
$I = new FunctionalTester($scenario);
$I->amOnPage('/login');
$I->fillField('email','[email protected]');
$I->fillField('password','mysecurepassword');
$I->click('#loginForm input[type=submit]');
$I->seeCurrentUrlIs('/dashboard');
$I->see('Welcome back','.notice');
$I->seeInSession('user_name','me');
$I = new ApiTester($scenario);
$I->wantTo('get pending articles via REST API');
$I->amHttpAuthenticated('service_user','123456');
$I->sendGET('articles', ['type' => 'pending']);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContains('article: { title: "Article 1"}');
function testSavingUser() {
$user = new User();
$user->setName('Miles');
$user->save();
$this->assertEquals('Miles', $user->getFullName());
$this->tester->seeInDatabase('users',['name' => 'Miles']);
}
$this->assertEquals('users', User::tableName());
test::double('User', ['tableName' => 'fake_users']);
$this->assertEquals('fake_users', User::tableName());
$this->specify("returns full name", function() {
$this->user->firstName = 'Michael';
$this->user->lastName = 'Bodnarchuk';
verify($this->user->getFullName())
->equals('Michael Bodnarchuk');
});
codeception/robo-paracept