<?php

$I = new SeleniumTester($scenario);
$I->am('a guest');
$I->wantTo('see cookie exist and be redirect to paper if input correct password');
$I->amOnPage('/password');
$I->fillField('#password', '123456');
$I->click('Login');
$I->seeCookie('password');
$I->amOnPage('/password');
<?php

$I = new SeleniumTester($scenario);
$I->am('a guest');
$I->wantTo('content will be updated if having correct cookie');
$I->amOnPage('/password');
$I->fillField('#password', '123456');
$I->click('Login');
$I->fillField('#content', 'Some demo text that will make all the way to database');
$I->wait(2);
$I->seeInDatabase('manhgiays', ['slug' => 'password', 'content' => 'Some demo text that will make all the way to database']);
コード例 #3
0
<?php

$I = new SeleniumTester($scenario);
$I->wantTo('perform actions and see result');
$I->amOnUrl('http://localhost/~hab/test/web/app_dev.php');
$I->see('Hello World!');
$I->fillField('username', 'hamza');
$I->click('submit');
//$I->seeCurrentUrlEquals('/~hab/test/web/app_dev.php/testform');
//$I->seeInCurrentUrl('/testform');
<?php

$I = new SeleniumTester($scenario);
$I->am('a guest');
$I->wantTo('be redirected to login page if input wrong password');
$I->amOnPage('/password');
$I->fillField('#password', 'thewrongpassword');
$I->click('Login');
$I->seeCurrentUrlEquals('/password/login');