$I->wantTo('ensure AccountAccountController lost password works'); // check we are not logged in $I->amOnPage('/'); $I->see('Hello guest'); // lost password with invalid username $I->amOnPage('/account/account/lostPassword'); $I->fillField('AccountLostPassword_email_or_username', 'admin123'); $I->click('Recover Password'); $I->see('Please fix the following input errors:'); $I->see('Username does not exist.'); // lost password with invalid email $I->amOnPage('/account/account/lostPassword'); $I->fillField('AccountLostPassword_email_or_username', '*****@*****.**'); $I->click('Recover Password'); $I->see('Please fix the following input errors:'); $I->see('Email does not exist.'); // lost password with correct username $I->amOnPage('/account/account/lostPassword'); $I->fillField('AccountLostPassword_email_or_username', 'admin'); $I->click('Recover Password'); $I->see('Password reset instructions have been sent to admin@mailinator.com. Please check your email.'); $I->seeInDatabase('email_spool', array('template' => 'account_lost_password', 'status' => 'pending', 'model_name' => 'AccountUser', 'model_id' => 1, 'to_address' => '{"*****@*****.**":"admin admin"}', 'from_address' => '{"webmaster@localhost":"My Application"}')); $I->seeInDatabase('token', array('model_name' => 'AccountLostPassword', 'model_id' => 1, 'uses_allowed' => 1, 'uses_remaining' => 1)); // lost password with correct email $I->amOnPage('/account/account/lostPassword'); $I->fillField('AccountLostPassword_email_or_username', '*****@*****.**'); $I->click('Recover Password'); $I->see('Password reset instructions have been sent to admin@mailinator.com. Please check your email.'); // check guest $I->amOnPage('/'); $I->see('Hello guest');
$I->fillField('input#name', 'Some User'); $I->fillField('input#website', 'http://google.com'); $I->fillField('input#work_phone', '+308123456789'); $I->fillField('input#address1', 'Test Address 1'); $I->fillField('input#address2', 'Test Address 2 APPTMT SUITE'); $I->fillField('input#city', 'Zaporozhe'); $I->fillField('input#state', 'Test Province'); $I->fillField('input#postal_code', 'postcode 123455677'); $option = 'Net 7'; $I->selectOption("#payment_terms", $option); $option = 'Euro'; $I->selectOption("#currency_id", $option); $option = '500+'; $I->selectOption("#size_id", $option); $option = 'Aerospace'; $I->selectOption("#industry_id", $option); //----private notes $I->fillField('#private_notes', 'Test Note Note Notes'); //-----------------------Form is Finished-- $I->click('Save'); $I->seeInCurrentUrl('/clients/'); $I->dontSeeInCurrentUrl('/users/'); $I->dontSeeInCurrentUrl('/user/'); $I->see('Details'); $I->see('Contacts'); $I->see('*****@*****.**'); $I->seeInDatabase('contacts', ['email' => '*****@*****.**']); $I->seeInDatabase('contacts', ['email' => '*****@*****.**']); $I->seeInDatabase('contacts', ['email' => '*****@*****.**']); $I->seeInDatabase('clients', array('currency_id' => 3, 'name' => 'Some User', 'address1' => 'Test Address 1', 'address2' => 'Test Address 2 APPTMT SUITE', 'city' => 'Zaporozhe', 'state' => 'Test Province', 'postal_code' => 'postcode 123455677', 'work_phone' => '+308123456789', 'private_notes' => 'Test Note Note Notes', 'payment_terms' => 7, 'industry_id' => 3, 'size_id' => 6)); //$I->seeInDatabase('clients', ['email' => '*****@*****.**']);
<?php $I = new WebGuy($scenario); $I->wantTo('click invoice now'); $I->amOnPage('/'); $I->click('#startButton'); $I->seeInDatabase('users', ['id' => 1]); $I->wantTo('create a client'); $I->click('#createClientLink'); $I->fillField('input#email', '*****@*****.**'); $I->click('#clientDoneButton'); $I->click('#saveButton'); $I->seeInDatabase('contacts', ['email' => '*****@*****.**']); $I->seeInField('input#email', '*****@*****.**');