Пример #1
0
 public function _after(FunctionalTester $I)
 {
     $I->amOnPage(PostsPage::$url);
     $I->seeCurrentUrlEquals(PostsPage::$url);
     $I->seeAuthentication();
     $I->logout();
     $I->dontSeeAuthentication();
 }
Пример #2
0
 public function createATicketSuccessfully(FunctionalTester $I)
 {
     $I->amLoggedAs(User::where('email', '*****@*****.**')->first());
     $I->seeAuthentication();
     $I->amOnPage('/ticket/create');
     $I->see('Create Ticket', 'h1');
     $I->fillField('customer_name', 'Evie Martell');
     $I->fillField('customer_address', 'Luton, LU1 9AB');
     $I->fillField('customer_tel', '07710999888');
     $I->fillField('customer_email', '*****@*****.**');
     $I->selectOption('select[name=type]', 'Fault');
     $I->selectOption('select[name=category_id]', '1');
     $I->fillField('post_serial', '2997');
     $I->fillField('description', 'Testing the post fault');
     $I->seeAuthentication();
     $I->click('Create');
     $I->see('Ticket created');
 }
Пример #3
0
 public function trySigninWithDifferentRole(FunctionalTester $I)
 {
     $I->wantTo('Login as user with different role');
     $I->dontSeeAuthentication();
     $I->amOnPage('/login');
     $I->fillField('identifier', 'spectator');
     $I->fillField('password', '123456');
     $I->click('button[type=submit]');
     $I->seeCurrentUrlEquals('/admin/profile');
     $I->seeAuthentication();
 }
 public function testValidRegistration(FunctionalTester $I)
 {
     $I->fillField('name', $this->tester['name']);
     $I->fillField('email', $this->tester['email']);
     $I->fillField('password', $this->tester['password']);
     $I->fillField('password_confirmation', $this->tester['password']);
     $I->click('Register', 'button');
     $I->dontSeeFormErrors();
     $I->seeRecord('users', ['name' => $this->tester['name'], 'email' => $this->tester['email']]);
     $I->seeAuthentication();
 }
 public function testLoginSuccsess(FunctionalTester $I)
 {
     $I->wantTo('login as a user');
     $I->haveRecord('users', ['name' => 'john', 'email' => '*****@*****.**', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->amOnPage('auth/login');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', '123456');
     $I->click('Login');
     $I->amOnPage('/');
     $I->seeAuthentication();
 }
Пример #6
0
 public function loginUsingCredentials(FunctionalTester $I)
 {
     $I->dontSeeAuthentication();
     $I->haveRecord('users', $this->userAttributes);
     $I->amLoggedAs(['email' => '*****@*****.**', 'password' => 'password']);
     $I->amOnPage(PostsPage::$url);
     $I->seeCurrentUrlEquals(PostsPage::$url);
     $I->seeAuthentication();
     $I->logout();
     $I->dontSeeAuthentication();
 }
Пример #7
0
 public function tryToResetPasswordWithValidToken(FunctionalTester $I)
 {
     $I->seeRecord('password_resets', ['email' => '*****@*****.**']);
     $I->wantTo('Reset my password invalid token');
     $I->amOnPage('/password/reset/reset-token');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', '123456');
     $I->fillField('password_confirmation', '123456');
     $I->click('button[type=submit]');
     $I->dontSeeRecord('password_resets', ['email' => '*****@*****.**']);
     $I->seeAuthentication();
     $I->seeCurrentUrlEquals('/admin/dashboard');
 }
Пример #8
0
 public function registrationWorks(FunctionalTester $I)
 {
     $I->amOnPage('/auth/register');
     $I->dontSeeAuthentication();
     $I->see('Register', 'h1');
     $I->fillField('name', 'Wayne');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', 'secret');
     $I->fillField('password_confirmation', 'secret');
     $I->click('Register');
     $I->seeCurrentUrlEquals('/dashboard');
     $I->see('This is the dashboard');
     $I->seeAuthentication();
 }
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('create a currency without data');
$I->am('a Administrator user');
$I->dontSeeAuthentication();
$I->amLoggedAs(['email' => '*****@*****.**', 'password' => 'admin']);
$I->seeAuthentication();
//When
$I->amOnPage('/settings/currency');
//And
$I->see('Create');
$I->click('Create');
//Then
$I->seeCurrentUrlEquals('/settings/currency/create');
//When
$form = ['name' => '', 'symbol' => ''];
//And
$I->submitForm('//form', $form, 'Create');
//Then
$I->seeFormErrorMessage('name', 'The name field is required.');
//