/**
  * @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);
 }
Ejemplo n.º 2
0
$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
$I->see('There are no sections, please create the first one');
$I->dontSee('Our company', 'td.name');
// When
$I->selectOption('menu', '1');
// And
Ejemplo n.º 3
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('redirect back using /back route');
$I->amOnPage('/');
$I->amOnPage('/back');
$I->expect('I am redirected back to /');
$I->seeCurrentUrlEquals('/');
Ejemplo n.º 4
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('paginate the sections results');
$I->amGoingTo('Go to page 1');
// When
$sections = $I->haveSections(16);
// And
$I->amOnPage('/admin/sections');
// Then
$I->see('There are 16 sections, showing page 1 of 2');
$I->expectTo('see the first section');
$I->see($sections->first()->name, 'tbody tr:first-child td.name');
$I->expect('not to see the last section');
$I->dontSee($sections->last()->name);
$I->expectTo('see the page 2 link');
$I->see('2', '.pagination a');
$I->amGoingTo('go to page 2');
// When
$I->click('2', '.pagination a');
// Then
$I->expectTo('see the pagination parameter in the URL');
$I->seeCurrentUrlEquals('/admin/sections?page=2');
$I->expect('not to see the first section');
$I->dontSee($sections->first()->name);
$I->expectTo('see the last section');
$I->see($sections->last()->name);
$I->expectTo('See the section #15 as first item on page 2');
$I->see($sections->get(15)->name, 'tbody tr:first-child td.name');
$I->amGoingTo('go back to page 1');
Ejemplo n.º 5
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');