Exemplo n.º 1
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');
 }
Exemplo n.º 2
0
 /**
  * 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');
 }
 public function teamMemberCanEditLog(FunctionalTester $I)
 {
     $I->am('a laser team member');
     $I->wantTo('make sure I can edit laser logs');
     //Load and login a known admin member
     $user = $I->loginLaserTeamMember();
     $otherUser = User::find(1);
     $I->amOnPage('/equipment/laser');
     $I->see($otherUser->name);
     $I->selectOption('form[name=equipmentLog] select[name=reason]', 'testing');
     $I->click('Update');
 }
Exemplo n.º 4
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateProject(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('edit an existing project details');
     $project = $I->createProject(1);
     $admin = $I->createUser(1, 4);
     $I->amLoggedAs($admin);
     $I->amOnAction('ProjectController@getEdit', ['project' => $project]);
     $I->selectOption('status', Project::STATUS_ARCHIVED);
     $I->click(trans('tinyissue.update'));
     $I->seeCurrentActionIs('ProjectsController@getIndex');
     $I->dontSeeLink('Project 1');
     $I->amOnAction('ProjectsController@getIndex', ['status' => Project::STATUS_ARCHIVED]);
     $I->seeLink('Project 1');
 }
Exemplo n.º 5
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateFirstLastName(FunctionalTester $I)
 {
     $I->am('Normal User');
     $I->wantTo('update my name');
     $I->lookForwardTo('be able to change my name');
     $user = $I->createUser(1);
     $I->amLoggedAs($user);
     $I->amOnAction('UserController@getSettings');
     $I->fillField('firstname', 'First');
     $I->fillField('lastname', 'Last');
     $I->selectOption('language', 'en');
     $I->click(trans('tinyissue.update'));
     $I->seeInField('firstname', 'First');
     $I->seeInField('lastname', 'Last');
     $I->seeLink('First', '/user/settings');
 }
Exemplo n.º 6
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function addUser(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('add new user');
     $admin = $I->createUser(1, 4);
     $I->amLoggedAs($admin);
     $I->amOnAction('Administration\\UsersController@getAdd');
     $I->fillField('firstname', 'user1');
     $I->fillField('lastname', 'lastname1');
     $I->fillField('email', 'email');
     $I->selectOption('role_id', 2);
     $I->click(trans('tinyissue.add_user'));
     $I->seeFormHasErrors();
     $I->fillField('email', '*****@*****.**');
     $I->click(trans('tinyissue.add_user'));
     $user = $I->fetchUserBy('email', '*****@*****.**');
     $I->see($user->fullname);
     $I->seeCurrentActionIs('Administration\\UsersController@getIndex');
 }
 public function memberCanViewVoteOnActiveProposal(FunctionalTester $I)
 {
     $I->am('a member');
     $I->wantTo('make sure I can view and vote on a proposal');
     //Create a proposal that's currently open
     $startDate = Carbon::now()->subDay()->format('Y-m-d');
     $endDate = Carbon::now()->addDays(2)->format('Y-m-d');
     $I->haveInDatabase('proposals', ['id' => 2, 'title' => 'Proposal 2', 'description' => 'Demo Description', 'user_id' => '1', 'start_date' => $startDate, 'end_date' => $endDate]);
     //Load and login a known member
     $user = User::find(1);
     Auth::login($user);
     //I can see the menu item
     $I->amOnPage('/proposals');
     $I->canSee('Proposals');
     //Goto the proposal page
     $I->click('Proposal 2');
     $I->canSee('Proposal 2');
     $I->canSee('Voting is Open');
     //Select the +1 vote option
     $I->selectOption('[name=vote]', '+1');
     $I->click('Vote');
     $I->canSeeInDatabase('proposal_votes', ['proposal_id' => 2, 'user_id' => $user->id, 'vote' => '+1']);
 }
$I->seeCurrentUrlEquals('/catalog/43up/input');
$I->seeFormErrorMessages(array('name1' => '姓は必須入力項目です。必ず入力してください。', 'name2' => '名は必須入力項目です。必ず入力してください。', 'kana1' => 'セイは必須入力項目です。必ず入力してください。', 'kana2' => 'メイは必須入力項目です。必ず入力してください。', 'sex' => '性別は必須入力項目です。必ず入力してください。', 'tel1' => 'TELは必須入力項目です。必ず入力してください。', 'post1' => '郵便番号は必須入力項目です。必ず入力してください。', 'area' => '都道府県は必須入力項目です。必ず入力してください。', 'address1' => '市町村区・町名は必須入力項目です。必ず入力してください。', 'address2' => '地名・番地・建物名は必須入力項目です。必ず入力してください。', 'email1' => 'E-mailは必須入力項目です。必ず入力してください。', 'age' => '年齢は必須入力項目です。必ず入力してください。', 'job' => 'ご職業は必須入力項目です。必ず入力してください。'));
//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', '98765-432-4321');
//length 14
$I->selectOption('area', '青森県');
$I->fillField('address1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('address2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('email1', INPUT_LENGTH_99 . '.vn');
//length 102
//submit_button form
$I->click('STEP3 入力情報の確認へ進む');
//check required
$I->seeCurrentUrlEquals('/catalog/43up/input');
$I->seeFormErrorMessages(array('name1' => '姓は50文字以下で入力してください。', 'name2' => '名は50文字以下で入力してください。', 'kana1' => 'セイは50文字以下で入力してください。', 'kana2' => 'メイは50文字以下で入力してください。', 'tel1' => 'TELは11文字以上、13文字以下で入力してください。', 'address1' => '市町村区・町名は50文字以下で入力してください。', 'address2' => '地名・番地・建物名は50文字以下で入力してください。', 'email1' => 'E-mailは100文字以下で入力してください。'));
//
//
//-----------------------------------check email can be apply-----------------------------------
//
Exemplo n.º 9
0
 public function update_role_with_data_changes(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('update a role with no data');
     $I->expectTo('see an error message explaining that the fields are required');
     /***************************************************************************************************************
      * settings
      **************************************************************************************************************/
     // we create the admin role
     $admin = $this->_createAdminRole();
     // we attach it to the logged user
     $admin->users()->attach($this->_user);
     // we create another role
     $operator = $this->_createUserRole();
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->amOnRoute('permissions.edit', ['id' => $operator->id]);
     $I->fillField('name_fr', 'Test FR');
     $I->fillField('slug', 'new_slug');
     $I->selectOption('parent_role_id', $admin->id);
     $I->checkOption('#settings' . config('permissions.separator') . 'view');
     $I->checkOption('#permissions');
     $I->checkOption('#permissions' . config('permissions.separator') . 'list');
     $I->checkOption('#permissions' . config('permissions.separator') . 'create');
     $I->checkOption('#permissions' . config('permissions.separator') . 'view');
     $I->checkOption('#permissions' . config('permissions.separator') . 'update');
     $I->checkOption('#permissions' . config('permissions.separator') . 'delete');
     $I->checkOption('#users');
     $I->checkOption('#users' . config('permissions.separator') . 'list');
     $I->checkOption('#users' . config('permissions.separator') . 'create');
     $I->checkOption('#users' . config('permissions.separator') . 'view');
     $I->checkOption('#users' . config('permissions.separator') . 'update');
     $I->checkOption('#users' . config('permissions.separator') . 'delete');
     $I->click(trans('permissions.page.action.edit'));
     $I->seeCurrentRouteIs('permissions.edit', ['id' => $operator->id]);
     $I->see(trans('global.modal.alert.title.success'), 'h3');
     $I->see(strip_tags(trans('permissions.message.update.success', ['name' => 'Test FR'])));
     $I->seeInField('name_fr', 'Test FR');
     $I->seeInField('slug', 'new-slug');
     $I->seeInField('position', 2);
     $I->seeOptionIsSelected('#input_parent_role', '1 - ' . $admin->name);
     $I->seeCheckboxIsChecked('#settings' . config('permissions.separator') . 'view');
     $I->seeCheckboxIsChecked('#permissions');
     $I->seeCheckboxIsChecked('#permissions' . config('permissions.separator') . 'list');
     $I->seeCheckboxIsChecked('#permissions' . config('permissions.separator') . 'create');
     $I->seeCheckboxIsChecked('#permissions' . config('permissions.separator') . 'view');
     $I->seeCheckboxIsChecked('#permissions' . config('permissions.separator') . 'update');
     $I->seeCheckboxIsChecked('#permissions' . config('permissions.separator') . 'delete');
     $I->seeCheckboxIsChecked('#users');
     $I->seeCheckboxIsChecked('#users' . config('permissions.separator') . 'list');
     $I->seeCheckboxIsChecked('#users' . config('permissions.separator') . 'create');
     $I->seeCheckboxIsChecked('#users' . config('permissions.separator') . 'view');
     $I->seeCheckboxIsChecked('#users' . config('permissions.separator') . 'update');
     $I->seeCheckboxIsChecked('#users' . config('permissions.separator') . 'delete');
     $I->seeRecord('roles', ['id' => $operator->id, 'slug' => 'new-slug', 'position' => 2, 'permissions' => '{"permissions":true,"users":true,"settings.view":true,"permissions.list":true,"permissions.create":true,"permissions.view":true,"permissions.update":true,"permissions.delete":true,"users.list":true,"users.create":true,"users.view":true,"users.update":true,"users.delete":true}']);
 }
Exemplo n.º 10
0
$I->see('E-mail');
$I->see('TEL');
$I->see('性別');
$I->see('男');
$I->see('女');
$I->see('年齢');
$I->see('ご職業');
$I->see('FAX');
//fill value
$I->fillField('ext53', '全角4000文字以内');
$I->fillField('name1', '積水');
$I->fillField('name2', '太郎');
$I->fillField('kana1', 'セキスイ');
$I->fillField('kana2', 'タロウ');
$I->fillField('post1', '060-0000');
$I->selectOption('form select[name=area]', '山形県');
$I->fillField('address1', '東京都港区虎ノ門');
$I->fillField('address2', '2-3-17虎ノ門2丁目タワー');
$I->fillField('email1', '*****@*****.**');
$I->fillField('tel1', '01-1234-5678');
$I->selectOption('sex', '男');
$I->selectOption('age', '21~25歳');
$I->selectOption('job', '公務員');
$I->fillField('fax1', '1234-123-1234');
//submit form
$I->click('入力内容確認へ進む');
//
//
//
//
//-------------------------------inquiry confirm page-------------------------------
Exemplo n.º 11
0
$I->seeCurrentUrlEquals('/admin/sections/create');
$I->see('New section', 'h1');
$I->amGoingTo('Omit the name field in order to submit an invalid form');
// When
$I->fillField('Slug URL', 'our-company');
$I->click('Create section');
// Then
$I->expectTo('See the form again with the errors');
$I->seeCurrentUrlEquals('/admin/sections/create');
$I->seeInField('slug_url', 'our-company');
$I->see('The name field is required', '.error');
$I->amGoingTo('Fill a valid form');
// When
$I->fillField('Name', 'Our company');
$I->fillField('Slug URL', 'our-company');
$I->selectOption('type', 'blog');
$I->selectOption('menu', 1);
$I->fillField('menu_order', 2);
$I->selectOption('published', 0);
// And
$I->click('Create section');
// Then
$I->seeCurrentUrlEquals('/admin/sections/1');
$I->see('Our company', 'h1');
/*
$I->seeRecord('sections', [
    'name' => 'Our company',
    'menu_order' => 2,
    'menu' => 1,
    'published' => 0
]);
<?php

$I = new FunctionalTester($scenario);
$I->amOnPage('/extensions-manager/extensions/search');
$I->seeResponseCodeIs(200);
$I->canSeeElement('[name="query"]');
$I->fillField(['name' => 'query'], 'devgroup/');
$I->selectOption('select[name=type]', 'dotplant-extension');
$I->click('form button[type="submit"]');
$I->canSeeElement('[data-action="ext-info"]');
// rbac
$I->amOnPage('/extensions-manager/extensions/search?guest');
$I->cantSeeElement('[name="query"]');
Exemplo n.º 13
0
$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('filter the section list');
// When
$I->haveSection();
// Created "Our company" section
$sections = $I->haveSections();
// Random sections
// And
$I->amOnPage('admin/sections');
// Then
$I->seeElement('input', ['name' => 'search']);
// When
$I->fillField('search', 'company');
$I->selectOption('published', '1');
// And
$I->click('Filter sections');
// Then
$I->seeCurrentUrlEquals('/admin/sections?search=company&published=1&menu=');
$I->expect('not to see the our company record');
// Then
$I->see('There are no sections, please create the first one');
$I->dontSee('Our company', 'td.name');
$I->seeInField('search', 'company');
// When
$I->selectOption('published', '0');
$I->selectOption('menu', '0');
// And
$I->click('Filter sections');
// Then
Exemplo n.º 14
0
 public function update_slide_with_data_changed(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('update slide data');
     $I->expectTo('see a success confirmation message and see that the user data has changed');
     /***************************************************************************************************************
      * settings
      **************************************************************************************************************/
     // we create the admin role
     $admin_role = $this->_createAdminRole();
     // we attach it to the logged user
     $admin_role->users()->attach($this->_user);
     // we create a slide
     $this->_createSlide();
     // we create another slide
     $slide = $this->_slide_repo->create(['title' => 'Aviron universitaire', 'quote' => 'Other quote', 'picto' => 'picto_2.png', 'background_image' => 'bg_img_2.jpg', 'position' => 2, 'active' => true]);
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->amOnRoute('slides.edit', ['id' => $this->_slide->id]);
     $I->fillField('title', 'Test');
     $I->fillField('quote', 'Rejoignez le plus grand club d\'aviron universitaire de France. Nous proposons des tarifs avantageux pour tous les étudiants nantais !');
     $I->selectOption('#input_previous_slide_id', $slide->position . ' - ' . $slide->title);
     $I->checkOption('#input_active');
     $I->click(trans('home.page.action.slide.update'));
     $I->seeCurrentRouteIs('slides.edit', ['id' => $this->_slide->id]);
     $I->see(trans('global.modal.alert.title.success'), 'h3');
     $I->see(strip_tags(trans('home.message.slide.update.success', ['slide' => 'Test'])));
     $I->seeInField('title', 'Test');
     $I->seeInField('quote', 'Rejoignez le plus grand club d\'aviron universitaire de France. Nous proposons des tarifs avantageux pour tous les étudiants nantais !');
     $I->seeOptionIsSelected('#input_previous_slide_id', '1 - ' . $slide->title);
     $I->seeCheckboxIsChecked('#input_active');
     $I->seeRecord('slides', ['title' => 'Test', 'quote' => 'Rejoignez le plus grand club d\'aviron universitaire de France. Nous proposons des tarifs avantageux pour tous les étudiants nantais !', 'position' => 2, 'active' => true]);
 }
Exemplo n.º 15
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('Register with Share-A-Meal');
$I->amOnPage('/');
$I->click('Don\'t have an account?');
$I->seeCurrentUrlEquals('/register');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '12345');
$I->selectOption('gender', 'male');
$I->click('Register');
$I->seeCurrentUrlEquals('/verify');
$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 . '𪚲');
//length 51
$I->fillField('email1', INPUT_LENGTH_99 . '.vn');
//length 102
$I->fillField('ext6', INPUT_LENGTH_99 . 'vn');
//length 101
$I->fillField('ext7', INPUT_LENGTH_99 . 'vn');
//length 101
$I->fillField('ext8', INPUT_LENGTH_99 . 'vn');
//length 101
//submit_button form
$I->click('STEP2 お届け先の入力へ進む');
//check required
Exemplo n.º 17
0
<?php
/**
 * Created by PhpStorm.
 * User: Evhanz
 * Date: 2/11/2015
 * Time: 7:28 PM
 */


$I = new FunctionalTester($scenario);

//when
$I->wantTo('Probar el registro de prestamos');
$I->amOnPage('prestamos/getViewNewPrestamo');
$I->see('Formulario de Registro','h3');
$I->fillField('dniProveedor','qw');
$I->dontSeeElement('#dniProveedor', ['value' => 'qw']);
$I->click(':::');
$I->see('Exito');
$I->selectOption('#selRecuso','1');
$I->fillField('#descripcion','prestamo rapido');
$I->fillField('#cantidad','a');
$I->dontSeeElement('#cantidad', ['value' => 'a']);
$I->click('#btnGuardar');

Exemplo n.º 18
0
$product = $I->createModel(DanPowell\Shop\Models\Product::class, [], 'inStock', 1);
$options[] = $I->makeModel(DanPowell\Shop\Models\Option::class, [], 'radio', 1);
$options[] = $I->makeModel(DanPowell\Shop\Models\Option::class, [], 'select', 1);
$options[] = $I->makeModel(DanPowell\Shop\Models\Option::class, [], 'text', 1);
$product->options()->saveMany($options);
// Create another product so we can try and force it's option on to the 'correct' product
$unrelatedProduct = $I->createModel(DanPowell\Shop\Models\Product::class, [], 'inStock', 1);
$unrelatedOption = $I->makeModel(DanPowell\Shop\Models\Option::class, [], 'select', 1);
$unrelatedProduct->options()->save($unrelatedOption);
$I->amOnRoute('shop.product.show', $product->slug);
// Randomly choose the option values
$option_values = [];
foreach ($options as $option) {
    if ($option->type == 'radio' || $option->type == 'select') {
        $option_values[$option->id] = $option->config[array_rand($option->config)];
        $I->selectOption('option[' . $option->id . ']', $option_values[$option->id]);
    } else {
        $option_values[$option->id] = "Testing";
        $I->fillField('option[' . $option->id . ']', "Testing");
    }
}
// Submit the form
$I->submitForm('#addToCart', ['option[' . $unrelatedOption->id . ']' => $unrelatedOption->config[0]]);
$I->seeCurrentRouteIs('shop.cart.show');
// Check that we see the product
$I->see('Product added to cart', '.alert');
$I->see($product->title, '.CartTable-product-title');
// Check that the selected options have been sent through
foreach ($options as $option) {
    $I->see($option->title, '.CartTable-item-options');
    $I->see($option_values[$option->id], '.CartTable-item-options');
Exemplo n.º 19
0
<?php

/**
 * ------------------------------------
 * 			Topic creation
 * ------------------------------------
 */
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Creating a new topic as a visitor and member.');
// Test Login Redirect
$I->am('a Phphub visitor');
$I->amOnRoute('topics.create');
$I->seeCurrentRouteIs('login-required');
// Test as a member
$I->signIn();
$I->am('as a Phphub member');
$I->amOnRoute('topics.create');
$I->selectOption('form select[name=node_id]', 'php');
$I->fillField(['name' => 'title'], 'My first post!');
$I->fillField(['name' => 'body'], 'My first post body.');
$I->click('#topic-create-submit');
$I->see('My first post!');
Exemplo n.º 20
0
 public function update_my_personal_profile_with_changes(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('update my profile and change some informations');
     $I->expectTo('see a success confirmation message and see that my data have changed');
     /***************************************************************************************************************
      * settings
      **************************************************************************************************************/
     // we create the admin role
     $admin_role = $this->_createAdminRole();
     // we attach it to the logged user
     $admin_role->users()->attach($this->_user);
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->amOnRoute('users.profile');
     $I->see(trans('users.page.title.profile'), 'h2');
     $I->selectOption('gender', config('user.gender_key.male'));
     $I->fillField('last_name', 'OTHER');
     $I->fillField('first_name', 'Other');
     $I->fillField('birth_date', '01/01/1999');
     $I->fillField('phone_number', '0101010101');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('address', '1 impasse Commandant Cousteau');
     $I->fillField('zip_code', 99456);
     $I->fillField('city', 'Toulon');
     $I->fillField('country', 'Maroc');
     $I->fillField('password', 'password');
     $I->fillField('password_confirmation', 'password');
     $I->click(trans('global.action.save'));
     $I->seeCurrentRouteIs('users.profile');
     $I->see(trans('global.modal.alert.title.success'), 'h3');
     $I->see(trans('users.message.account.success'));
     $this->_user->fresh();
     $I->seeRecord('users', ['last_name' => 'OTHER', 'first_name' => 'Other', 'gender' => config('user.gender_key.male'), 'birth_date' => '1999-01-01', 'status_id' => $this->_user->status_id, 'board_id' => $this->_user->board_id, 'phone_number' => '+33 1 01 01 01 01', 'email' => '*****@*****.**', 'address' => '1 impasse Commandant Cousteau', 'zip_code' => 99456, 'city' => 'Toulon', 'country' => 'Maroc']);
     $I->seeRecord('role_users', ['user_id' => $this->_user->id, 'role_id' => Sentinel::findRoleBySlug('admin')->id]);
     $I->seeRecord('activations', ['user_id' => $this->_user->id, 'completed' => true]);
     $user = Sentinel::getUserRepository()->findByCredentials(['email' => '*****@*****.**']);
     $I->assertTrue(Hash::check('test', $user->password));
 }
Exemplo n.º 21
0
// Then
$I->seeCurrentUrlEquals('/admin/sections/' . $id . '/edit');
$I->see('Edit section "Our company"', 'h1');
$I->seeInField('name', 'Our company');
$I->seeInField('slug_url', 'our-company');
$I->seeInField('menu_order', 2);
$I->seeOptionIsSelected('published', 0);
$I->seeOptionIsSelected('menu', 1);
$I->seeOptionIsSelected('type', 'Page');
$I->amGoingTo('Submit an invalid form');
// When
$I->fillField('name', '');
// And
$I->click('Update section');
// Then
$I->expectTo('see the form back with data and errors');
$I->seeCurrentUrlEquals('/admin/sections/' . $id . '/edit');
$I->seeInField('name', '');
$I->seeInField('slug_url', 'our-company');
$I->see('The name field is required', '.error');
$I->amGoingTo('Submit a valid form');
// When
$I->fillField('name', 'Who we are');
$I->selectOption('published', 1);
// And
$I->click('Update section');
// Then
$I->expectTo('see the section details with the new changes');
$I->seeCurrentUrlEquals('/admin/sections/' . $id);
$I->see('Who we are', 'h1');
$I->seeRecord('sections', ['id' => $id, 'name' => 'Who we are', 'published' => 1, 'slug_url' => 'our-company', 'type' => 'page', 'menu_order' => 2, 'menu' => 1]);
Exemplo n.º 22
0
$I->see('TEL');
$I->see('FAX');
$I->see('E-mail');
$I->see('ご住所');
$I->see('郵便番号');
$I->see('都道府県');
$I->see('市町村区・町名');
$I->see('現在の検討状況等についてお聞かせください。');
$I->see('建築予定時期');
$I->see('現在の状況');
//fill value
$I->fillField('name1', '積水');
$I->fillField('name2', '太郎');
$I->fillField('kana1', 'セキスイ');
$I->fillField('kana2', 'タロウ');
$I->selectOption('sex', '男');
$I->fillField('tel1', '01-1234-5678');
$I->fillField('fax1', '1234-123-1234');
$I->fillField('post1', '060-0000');
$I->selectOption('area', '青森県');
$I->fillField('address1', '東京都港区虎ノ門');
$I->fillField('address2', '2-3-17虎ノ門2丁目タワー');
$I->fillField('email1', '*****@*****.**');
$I->selectOption('age', '21~25歳');
$I->selectOption('job', '公務員');
$I->selectOption('ext7', 'h');
$I->selectOption('ext8', 'すぐ');
$I->selectOption('ext41[]', '住まいづくりを考えはじめた');
$I->selectOption('ext19', 'あり(現住所と同じ)');
$I->selectOption('ext19', 'あり(現住所と違う)');
//submit form
Exemplo n.º 23
0
<?php

$I = new FunctionalTester($scenario);
$I->am('HRis User');
$I->wantTo('Add Work Shifts. [Positive Test]');
# Authorize User
$I->amOnPage('/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'retardko');
$I->click('Login');
# Dashboard
$I->seeCurrentUrlEquals('/dashboard');
# Profile
$I->click('Profile');
$I->seeCurrentUrlEquals('/profile/personal-details');
# Qualifications
$I->click('Work Shifts');
$I->seeCurrentUrlEquals('/profile/work-shifts');
# Add new record
$I->click('Modify');
$I->seeCurrentUrlEquals('/profile/work-shifts/edit');
$I->selectOption('form select[name=work_shift_id]', 0);
$I->fillField('effective_date', Carbon::now()->toDateString());
$I->click('Save changes');
$I->seeCurrentUrlEquals('/profile/work-shifts');
$I->see('Record successfully updated.');
Exemplo n.º 24
0
$I->see('ご職業');
$I->see('TEL');
$I->see('FAX');
$I->see('E-mail');
$I->see('ご住所');
$I->see('郵便番号');
$I->see('都道府県');
$I->see('市町村区・町名');
$I->see('現在の検討状況等についてお聞かせください。');
$I->see('建築予定時期');
//fill value
$I->fillField('name1', '積水');
$I->fillField('name2', '太郎');
$I->fillField('kana1', 'セキスイ');
$I->fillField('kana2', 'タロウ');
$I->selectOption('sex', '男');
$I->fillField('tel1', '01-1234-5678');
$I->fillField('fax1', '1234-123-1234');
$I->fillField('post1', '060-0000');
$I->selectOption('area', '青森県');
$I->fillField('address1', '東京都港区虎ノ門');
$I->fillField('address2', '2-3-17虎ノ門2丁目タワー');
$I->fillField('email1', '*****@*****.**');
$I->selectOption('age', '21~25歳');
$I->selectOption('job', '公務員');
$I->selectOption('ext6', '0');
$I->selectOption('ext8', 'すぐ');
$I->selectOption('ext8', 'すぐ');
$I->selectOption('ext19', 'あり(現住所と同じ)');
$I->selectOption('apart_reason[]', '相続税対策');
$I->selectOption('apart_reason[]', '固定資産税対策');
Exemplo n.º 25
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+)$~');
Exemplo n.º 26
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('filter and paginate the section list');
// When
$sections = $I->haveSections(90);
// Random sections
// And
$I->amOnPage('admin/sections');
$I->selectOption('published', '1');
$I->click('Filter sections');
$I->click('2', '.pagination a');
// Then
$I->expectTo('see published sections');
$I->see('Published', 'td');
$I->expect('not to see draft sections');
$I->dontSee('Draft', 'td');