<?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']);
<?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');