Skip to content
Snippets Groups Projects
Commit 0c4c1e64 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Tests: Use existing session

Using Admin->useExistingSession() of Admin actor
instead of Kasper actor speeds up the tests a bit
and should make them more reliable.

Change-Id: Ibb462e87e1ce3725cdc40a7a6afa4e3c668b2b5c
Resolves: #75798
Releases: master
Reviewed-on: https://review.typo3.org/47800


Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 0ca254b5
Branches
Tags
No related merge requests found
...@@ -14,7 +14,7 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Page; ...@@ -14,7 +14,7 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Page;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Kasper; use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
/** /**
* This testcase is used to check if a page can be added with the page module. * This testcase is used to check if a page can be added with the page module.
...@@ -22,20 +22,19 @@ use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Kasper; ...@@ -22,20 +22,19 @@ use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Kasper;
*/ */
class AddPageInPageModuleCest class AddPageInPageModuleCest
{ {
public function _before(Kasper $I) public function _before(Admin $I)
{ {
$I->loginAsAdmin(); $I->useExistingSession();
} // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
$I->switchToIFrame('content');
public function _after(Kasper $I) $I->waitForText('Web>Page module');
{ $I->switchToIFrame();
$I->logout();
} }
/** /**
* @param Kasper $I * @param Admin $I
*/ */
public function tryToTest(Kasper $I) public function tryToTest(Admin $I)
{ {
// Select page module // Select page module
$I->wantToTest('Add a page with page module'); $I->wantToTest('Add a page with page module');
......
...@@ -44,8 +44,8 @@ class BookmarkCest ...@@ -44,8 +44,8 @@ class BookmarkCest
public function _before(Admin $I) public function _before(Admin $I)
{ {
$I->useExistingSession(); $I->useExistingSession();
$I->switchToIFrame('content');
// Ensure main content frame is fully loaded, otherwise there are load-race-conditions // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
$I->switchToIFrame('content');
$I->waitForText('Web>Page module'); $I->waitForText('Web>Page module');
} }
......
...@@ -23,10 +23,10 @@ use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\Topbar; ...@@ -23,10 +23,10 @@ use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\Topbar;
class HelpCest class HelpCest
{ {
/** /**
* Selector for the module container in the topbar * Selector for the module container in the topbar
* *
* @var string * @var string
*/ */
public static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-helptoolbaritem'; public static $topBarModuleSelector = '#typo3-cms-backend-backend-toolbaritems-helptoolbaritem';
/** /**
...@@ -35,8 +35,8 @@ class HelpCest ...@@ -35,8 +35,8 @@ class HelpCest
public function _before(Admin $I) public function _before(Admin $I)
{ {
$I->useExistingSession(); $I->useExistingSession();
$I->switchToIFrame('content');
// Ensure main content frame is fully loaded, otherwise there are load-race-conditions // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
$I->switchToIFrame('content');
$I->waitForText('Web>Page module'); $I->waitForText('Web>Page module');
$I->switchToIFrame(); $I->switchToIFrame();
} }
......
...@@ -27,6 +27,10 @@ class LogoCest ...@@ -27,6 +27,10 @@ class LogoCest
public function _before(Admin $I) public function _before(Admin $I)
{ {
$I->useExistingSession(); $I->useExistingSession();
// Ensure main content frame is fully loaded, otherwise there are load-race-conditions
$I->switchToIFrame('content');
$I->waitForText('Web>Page module');
$I->switchToIFrame();
} }
/** /**
......
<?php <?php
namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Profile; namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Topbar;
/* /*
* This file is part of the TYPO3 CMS project. * This file is part of the TYPO3 CMS project.
...@@ -14,27 +14,26 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Profile; ...@@ -14,27 +14,26 @@ namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Profile;
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Kasper; use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
/** /**
* This testcase is used to check if username is visible in the toolbar. * This test case is used to check if username is visible in the toolbar.
*/ */
class UsernameOnAvatarCest class UsernameOnAvatarCest
{ {
public function _before(Kasper $I) public function _before(Admin $I)
{ {
$I->loginAsAdmin(); $I->useExistingSession();
} // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
$I->switchToIFrame('content');
public function _after(Kasper $I) $I->waitForText('Web>Page module');
{ $I->switchToIFrame();
$I->logout();
} }
/** /**
* @param Kasper $I * @param Admin $I
*/ */
public function tryToTest(Kasper $I) public function tryToTest(Admin $I)
{ {
$I->see('admin', '#typo3-cms-backend-backend-toolbaritems-usertoolbaritem'); $I->see('admin', '#typo3-cms-backend-backend-toolbaritems-usertoolbaritem');
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment