コード例 #1
0
 private function fill_in_form(FunctionalTester $I)
 {
     $I->fillField('name', self::NAME);
     $I->fillField('email', self::EMAIL);
     $I->fillField('password', self::PASSWORD);
     $I->fillField('password_confirmation', self::PASSWORD);
 }
コード例 #2
0
 public function cantCreateDuplicateKeyEntry(FunctionalTester $I)
 {
     $I->am('an equipment team member');
     $I->wantTo('make sure I cant create duplicate entries');
     //Load and login a known member
     $I->loginEquipmentTeamMember();
     $I->amOnPage('/equipment');
     $I->canSee('Record a new item');
     $name = $this->faker->word;
     $slug = substr($this->faker->slug, 0, 10);
     //First item
     $I->click('Record a new item');
     $I->fillField('Name', $name);
     $I->fillField('Slug', $slug);
     $I->click('Save');
     $I->seeCurrentUrlEquals('/equipment/' . $slug . '/edit');
     /*
     //Second item
     $I->click('Record a new item');
     $I->fillField('Name', $name);
     $I->fillField('Key', $slug);
     
     $I->assertTrue(
         $I->seeExceptionThrown('BB\Exceptions\FormValidationException', function() use ($I){
             $I->click('Save');
         })
     );
     */
 }
コード例 #3
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateIssue(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('edit an existing project issue details');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeLink('Issue 1');
     $I->dontSee(\Html::duration($issue->time_quote), '.issue-quote');
     $I->click('Issue 1', '.edit-issue');
     $I->seeCurrentActionIs('Project\\IssueController@getEdit', ['project' => $project, 'issue' => $issue]);
     $newTitle = 'Issue 1 update';
     $newTime = 3700;
     $I->fillField('title', $newTitle);
     $I->fillField('time_quote[h]', 1);
     $I->fillField('time_quote[s]', 100);
     $I->fillField('tag', 'type:tag1');
     $I->click(trans('tinyissue.update_issue'));
     $I->seeResponseCodeIs(200);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeLink($newTitle);
     $I->see(\Html::duration($newTime), '.issue-quote');
     $I->see('type', '.issue-tag');
     $I->see('tag1', '.issue-tag');
 }
コード例 #4
0
 /**
  * Define custom actions here
  */
 function checkIfLogin(\FunctionalTester $I)
 {
     //if ($I->loadSessionSnapshot('login')) return;
     $I->amOnPage('/login');
     $I->fillField(['name' => 'email'], Fixtures::get('username'));
     $I->fillField(['name' => 'password'], Fixtures::get('password'));
     $I->click('#loginButton');
     //$I->saveSessionSnapshot('login');
 }
コード例 #5
0
ファイル: AuthCest.php プロジェクト: richmartell/laravel
 public function loginFailsWhenPasswordIncorrect(FunctionalTester $I)
 {
     $I->amOnPage('/auth/login');
     $I->see('Login');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', 'incorrect');
     $I->click('Login');
     $I->seeCurrentUrlEquals('/auth/login');
     $I->dontSeeAuthentication();
     $I->see('These credentials do not match our records.');
 }
コード例 #6
0
ファイル: LoginCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @return void
  */
 public function invalidUsernamePassword(FunctionalTester $I)
 {
     $I->wantTo('login with invalid username/password');
     $I->amOnAction('HomeController@getIndex');
     $I->dontSeeAuthentication();
     $I->see('Login');
     $I->fillField('Email', '*****@*****.**');
     $I->fillField('Password', '1234');
     $I->click('Login');
     $I->dontSeeAuthentication();
 }
コード例 #7
0
 public function testRegisterSuccsess(FunctionalTester $I)
 {
     $I->wantTo('register a user');
     $I->amOnPage('/register');
     $I->fillField('name', 'JohnDoe');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', 'admin');
     $I->fillField('password_confirmation', 'admin');
     $I->click('Continue');
     $I->amOnPage('/');
 }
コード例 #8
0
 /**
  * @param \FunctionalTester $I
  */
 protected function authAsAdmin(\FunctionalTester $I)
 {
     $I->amOnPage(AuthorizationPage::$LOGOUT_URL);
     $I->amOnPage(AuthorizationPage::$LOGIN_URL);
     $I->fillField(AuthorizationPage::$USERNAME_FIELD, AuthorizationPage::$USERNAME);
     $I->fillField(AuthorizationPage::$PASSWORD_FIELD, AuthorizationPage::$PASSWORD);
     $I->click(AuthorizationPage::$SUBMIT_BUTTON);
     $I->expect(AuthorizationPage::$EXPECT_SUCCESS_LOGIN);
     $I->amOnPage(AuthorizationPage::$DASHBOARD_URL);
     $I->see(AuthorizationPage::$SEE_ELEMENT_ON_DASHBOARD);
 }
コード例 #9
0
ファイル: LoginCest.php プロジェクト: inoplate/account
 public function trySigninWithInvalidCredentials(FunctionalTester $I)
 {
     $I->wantTo('Login as user with invalid credentials');
     $I->dontSeeAuthentication();
     $I->amOnPage('/login');
     $I->fillField('identifier', 'spectator');
     $I->fillField('password', 'invalid');
     $I->click('button[type=submit]');
     $I->seeCurrentUrlEquals('/login');
     $I->dontSeeAuthentication();
 }
コード例 #10
0
ファイル: FormPageFragment.php プロジェクト: rhamlet1/Hazid
 /**
  * Submit the project create/update form.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param array                               $fields
  */
 public static function submit($I, $fields)
 {
     if ($fields['image']) {
         $I->attachFile('#uploadform-newimage', $fields['image']);
     }
     $I->fillField(['name' => 'Project[name]'], $fields['name']);
     $I->selectOption(['name' => 'Project[coordinator]'], $fields['coordinator']);
     $I->fillField(['name' => 'Project[status]'], $fields['status']);
     $I->fillField(['name' => 'UploadForm[newImageDescription][]'], $fields['imageDescription']);
     $I->click('#project-form button');
 }
コード例 #11
0
ファイル: RegisterCest.php プロジェクト: inoplate/account
 public function tryRegisterDesiredInputWithDefaultRole(FunctionalTester $I)
 {
     $I->haveRecord('roles', ['id' => 2, 'name' => 'Spectator', 'slug' => 'spectator', 'landing' => 'admin/profile', 'is_default' => true, 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->wantTo('Register a user with desired input');
     $I->amOnPage('/register');
     $I->fillField('username', 'usertest');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', '123456');
     $I->fillField('password_confirmation', '123456');
     $I->click('button[type=submit]');
     $I->seeRecord('users', ['username' => 'usertest']);
     $I->seeCurrentUrlEquals('/login');
 }
コード例 #12
0
ファイル: PasswordCest.php プロジェクト: inoplate/account
 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');
 }
コード例 #13
0
ファイル: AuthControllerCest.php プロジェクト: lembarek/auth
 public function it_register_a_valide_user(FunctionalTester $I)
 {
     $name = 'joe';
     $email = '*****@*****.**';
     $password = '******';
     $I->amOnRoute('user:register');
     $I->fillField('username', $name);
     $I->fillField('email', $email);
     $I->fillField('password', $password);
     $I->fillField('password_confirmation', $password);
     $I->click(Lang::get('form.register'));
     //$I->seePageIs(route('home'));
     //$I->seeInDatabase('users', ['username' => $name, 'email' => $email]);
 }
コード例 #14
0
ファイル: UserCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateEmail(FunctionalTester $I)
 {
     $I->am('Normal User');
     $I->wantTo('update my email');
     $I->lookForwardTo('be able to change my email');
     $user = $I->createUser(1);
     $I->amLoggedAs($user);
     $I->amOnAction('UserController@getSettings');
     $I->fillField('email', 'email');
     $I->click(trans('tinyissue.update'));
     $I->seeFormHasErrors();
     $I->fillField('email', '*****@*****.**');
     $I->click(trans('tinyissue.update'));
     $I->seeInField('email', '*****@*****.**');
 }
コード例 #15
0
 public function editAProfile(FunctionalTester $I, UserSteps $userSteps)
 {
     $userSteps->loginAsFirstUser();
     $I->click('Profile');
     $I->dontSeeInFormFields('#profileForm', ['name' => 'John Doe']);
     $I->fillField('name', 'John Doe');
     $I->click('Update');
     $I->click('Log Out');
     $I->see('Goodbye John Doe!');
 }
コード例 #16
0
ファイル: CrudUserCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateUser(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('edit an existing user details');
     $admin = $I->createUser(1, 4);
     $user = $I->createUser(2, 1);
     $I->amLoggedAs($admin);
     $I->amOnAction('Administration\\UsersController@getIndex');
     $I->click("//a[contains(.,'" . $user->fullname . "')]");
     $I->fillField('firstname', 'user1-update');
     $I->click(trans('tinyissue.update'));
     $I->seeCurrentActionIs('Administration\\UsersController@getIndex');
     $user = $I->fetchUserBy('id', $user->id);
     $I->see($user->fullname);
 }
コード例 #17
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function addComment(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('add new comment to an issue');
     $admin = $I->createUser(2, 4);
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$admin]);
     $issue = $I->createIssue(1, $admin, $admin, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->fillField('comment', 'Comment one');
     $I->click(trans('tinyissue.comment'));
     $I->seeResponseCodeIs(200);
     $comment = $issue->comments->last();
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue->id . '#comment' . $comment->id]);
     $I->see('Comment one', '.comment .content');
 }
コード例 #18
0
 public function testSpamRegistration(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->fillField('agreement', 'yes');
     $I->click('Register', 'button');
     $I->dontSeeFormErrors();
     $I->click('Logout');
     $I->click('Login');
     $I->fillField('email', $this->tester['email']);
     $I->fillField('password', $this->tester['password']);
     $I->click('Login', 'button');
     $I->seeFormHasErrors();
     $I->dontSeeAuthentication();
 }
コード例 #19
0
ファイル: TicketCest.php プロジェクト: richmartell/laravel
 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');
 }
コード例 #20
0
<?php

$I = new FunctionalTester($scenario);
//setup
$I->am('a guest');
$I->wantTo('register an account');
//action
$I->amOnPage('/register');
$I->see('Inscription');
$I->fillField(['name' => 'firstname'], 'John');
$I->fillField(['name' => 'lastname'], 'Doe');
$I->fillField(['name' => 'email'], '*****@*****.**');
$I->fillField(['name' => 'password'], 'password');
$I->fillField(['name' => 'password_confirmation'], 'password');
$I->click('submit-register');
//verify
$I->canSeeAuthentication();
$I->seeRecord('users', array('email' => '*****@*****.**'));
コード例 #21
0
<?php

/**
 * ------------------------------------
 *          Notify user being "@"
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Notify a User when he/she is being AT on a newly Reply');
$SuperMan = $I->have('User', ['name' => 'SuperMan']);
$user = $I->signIn();
$topic = $I->postATopic(['title' => 'My Awsome Topic.', 'user_id' => $user->id]);
// another user leave a reply
$randomUser = $I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->fillField(['name' => 'body'], 'The Awsome Reply. @SuperMan');
$I->click('#reply-create-submit');
$I->see('The Awsome Reply. <a href="' . route('users.show', $SuperMan->id) . '">@SuperMan</a>');
// sign in the author
$user = $I->signIn($SuperMan);
$I->seeRecord('users', ['id' => $user->id, 'notification_count' => 1]);
$I->amOnRoute('notifications.index');
$I->see('My Awsome Topic.');
$I->see('The Awsome Reply. <a href="' . route('users.show', $SuperMan->id) . '">@SuperMan</a>');
$I->see($randomUser->name);
$I->seeRecord('users', ['id' => $user->id, 'notification_count' => 0]);
コード例 #22
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('Create Article Tests');
// Not signed tests
$I->amOnRoute('article.create');
$I->seeCurrentUrlEquals('/auth/login');
// Sign in
$I->signIn();
// Create article
$I->amOnRoute('article.create');
$I->see('Create Article');
$I->fillField('form input[name=title]', 'New Article by FunctionalTester');
$I->selectOption('form select[name=category_id]', '1');
$I->fillField('form textarea[name=body]', 'bodybodybody \\n by FunctionalTester');
$I->click('form [type=submit]');
$I->seeCurrentUrlMatches('~^/article/(\\d+)$~');
コード例 #23
0
<?php

use Laracasts\TestDummy\Factory;
$I = new FunctionalTester($scenario);
$I->am('a USC Todo member');
$I->wantTo('post a new project');
$email = '*****@*****.**';
$password = '******';
Factory::create('App\\User', ['email' => $email, 'password' => $password]);
$I->amOnPage('/auth/login');
$I->fillField('email', $email);
$I->fillField('password', $password);
$I->click('Login!');
//$I->signIn();
$I->seeCurrentUrlEquals('/projects');
コード例 #24
0
ファイル: SignUpCept.php プロジェクト: stoodz/larabook
<?php 
$I = new FunctionalTester($scenario);
$I->wantTo('Sign up for a larabook account');

$I->amOnPage('/');
$I->click('Sign Up!');
$I->seeCurrentUrlEquals('/register');

$I->fillField('username', 'JohnDoe');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'demo');
$I->fillField('password_confirmation', 'demo');
$I->click('Sign Up');

$I->seeCurrentUrlEquals('');
$I->see('Welcome to Larabook!');
$I->seeRecord('users', [
   'username' => 'JohnDoe',
   'email' => '*****@*****.**'
]);

コード例 #25
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a guest');
$I->wantTo('sign up for a Larabook account');
$I->amOnPage('/');
$I->click('Sign Up!');
$I->seeCurrentUrlEquals('/register');
$I->fillField('Username:'******'JohnDoe');
$I->fillField('Email:', '*****@*****.**');
$I->fillField('Password:'******'demo');
$I->fillField('Password Confirmation:', 'demo');
$I->click(['class' => 'submitbutton']);
$I->seeCurrentUrlEquals('');
$I->see('Welcome to Larabook!');
$I->seeRecord('users', ['username' => 'JohnDoe', 'email' => '*****@*****.**']);
$I->assertTrue(Auth::check());
コード例 #26
0
<?php

$I = new FunctionalTester($scenario);
// Prep
$sentry = $I->grabService('sentry');
$user = $sentry->findUserByLogin('*****@*****.**');
$group = $sentry->findGroupByName('Users');
// Test
$I->amActingAs('*****@*****.**');
$I->wantTo('edit a group name');
$I->amOnPage('/groups/' . $group->id . '/edit');
$I->seeElement('input', ['class' => 'form-control', 'name' => 'name']);
$I->fillField('name', 'Prozorovs');
$I->click('Save Changes');
$I->seeRecord('groups', ['name' => 'Prozorovs', 'id' => $group->id]);
コード例 #27
0
require_once __DIR__ . '../../ConstantFunctional.php';
$I = new FunctionalTester($scenario);
$I->wantTo('Check validate for Catalog input');
$I->amOnPage('/catalog/senior/input');
//submit form
//$I->checkOption('#dct195');
//$I->click('STEP2 お届け先の入力へ進む');
//url
//$I->seeCurrentUrlEquals('/catalog/senior/input');
//submit_button form
$I->click('STEP2 お届け先の入力へ進む');
//check required
$I->seeCurrentUrlEquals('/catalog/senior/input');
$I->seeFormErrorMessages(array('name1' => '姓は必須入力項目です。必ず入力してください。', 'name2' => '名は必須入力項目です。必ず入力してください。', 'kana1' => 'セイは必須入力項目です。必ず入力してください。', 'kana2' => 'メイは必須入力項目です。必ず入力してください。', 'tel1' => 'TELは必須入力項目です。必ず入力してください。', 'post1' => '郵便番号は必須入力項目です。必ず入力してください。', 'area' => '都道府県は必須入力項目です。必ず入力してください。', 'address1' => '市町村区・町名は必須入力項目です。必ず入力してください。', 'address2' => '地名・番地・建物名は必須入力項目です。必ず入力してください。', 'email1' => 'E-mailは必須入力項目です。必ず入力してください。'));
//check max length
$I->fillField('name1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('name2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('tel1', '12456-545-4564');
//length 14
$I->fillField('post1', '060-0000');
//length 14
$I->selectOption('area', '青森県');
$I->fillField('address1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('address2', INPUT_LENGTH_50 . '𪚲');
コード例 #28
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a member');
$I->wantTo('view my profile.');
// setup
$I->signIn();
$I->amOnPage('statuses');
// action
$I->fillField('body', 'walla yalla');
$I->click(Lang::get('status.Send'));
$I->click(Lang::get('account.Your Profile'));
// watching if status actually is posted to my wall
$I->seeCurrentUrlEquals('/@Foobar');
$I->see('walla yalla');
コード例 #29
0
<?php

use schmunk42\giiant\tests\_pages\LoginPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that crud works with access rules');
$I->amOnPage('/crud/actor');
$I->dontSee('Actor', 'h2');
$I->see('Sign in', 'h3');
$I->amGoingTo('try to login with correct credentials');
// TODO: use LoginPage class
$username = '******';
$password = '******';
$I->fillField('input[name="login-form[login]"]', $username);
$I->fillField('input[name="login-form[password]"]', $password);
$I->click('Sign in');
$I->see('Actor', 'h2');
コード例 #30
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('register a user');
$I->amOnPage('/auth/register');
$I->fillField('name', 'John Doe');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->fillField('password_confirmation', 'password');
$I->click('button[type=submit]');
$I->amOnPage('/');
$I->seeRecord('users', ['email' => '*****@*****.**']);
$I->seeAuthentication();