<?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('be redirect to login and lost cookie if choose to remove password'); $I->amOnPage('/password'); $I->fillField('#password', '123456'); $I->click('Login'); $I->click('Remove Password'); $I->acceptPopup(); $I->seeCurrentUrlEquals('/password'); $I->wait(1); $I->dontSee('Remove Password'); $I->dontSeeCookie('password'); ##Now let put back password together $I->click('Add Password?'); $I->typeInPopup('123456'); $I->acceptPopup(); $I->typeInPopup('123456'); $I->acceptPopup(); $I->wait(1); $I->seeCurrentUrlEquals('/password'); $I->see('Remove Password');
<?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('see cookie be deleted and redirect to login if log out and having correct cookie'); $I->amOnPage('/password'); $I->fillField('#password', '123456'); $I->click('Login'); $I->seeCurrentUrlEquals('/password'); $I->click('Log Out'); $I->wait(1); $I->dontSeeCookie('password'); $I->seeCurrentUrlEquals('/password/login');