-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Adjust some configuration for the tests
- Loading branch information
1 parent
585cb82
commit b7ccb47
Showing
5 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace In2code\Lux\Tests\Helper; | ||
|
||
class MiscellaneousHelper extends \Codeception\Module | ||
{ | ||
/** | ||
* This function allows to enable the fullScreenShot feature | ||
* for a specific test. | ||
* | ||
* The configuration is only valid vor the test where the function is called. | ||
* After the test the configuration is restored to the default. | ||
* | ||
* | ||
* @throws \Codeception\Exception\ModuleConfigException | ||
* @throws \Codeception\Exception\ModuleException | ||
*/ | ||
public function enableFullScreenShot() | ||
{ | ||
$this | ||
->getModule('WebDriver') | ||
->moduleContainer | ||
->getModule('VisualCeption') | ||
->_reconfigure(['fullScreenShot' => true]); | ||
} | ||
|
||
/** | ||
* This function allows to disable the fullScreenShot feature | ||
* for a specific test. | ||
* | ||
* The configuration is only valid vor the test where the function is called. | ||
* After the test the configuration is restored to the default. | ||
* | ||
* | ||
* @throws \Codeception\Exception\ModuleConfigException | ||
* @throws \Codeception\Exception\ModuleException | ||
*/ | ||
public function disableFullScreenShot() | ||
{ | ||
$this | ||
->getModule('WebDriver') | ||
->moduleContainer | ||
->getModule('VisualCeption') | ||
->_reconfigure(['fullScreenShot' => false]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace In2code\Lux\Tests\Acceptance\Backend; | ||
|
||
use In2code\Lux\Tests\AcceptanceTester; | ||
|
||
class AnalyseDashboardCest | ||
{ | ||
public function _before(AcceptanceTester $I) | ||
{ | ||
$I->loginToBackend($I); | ||
} | ||
|
||
public function loginToBackendSuccessfully(AcceptanceTester $I) | ||
{ | ||
$I->click('Analyse'); | ||
|
||
// Warte auf den Container, in dem die AJAX-Inhalte geladen werden | ||
$I->waitForElement('.panel-heading', 30); | ||
|
||
// Alternative Methoden zum Warten: | ||
$I->waitForText('Top 10', 30); // Wartet bis zu 30 Sekunden auf den Text | ||
// ODER | ||
$I->waitForAjax(30); // Wartet auf AJAX-Requests | ||
|
||
// Jetzt erst nach dem Text suchen | ||
$I->see('Top 10'); | ||
|
||
// Optional: Debug-Hilfen | ||
$I->makeScreenshot('after_ajax_load'); | ||
|
||
// Weitere Tests... | ||
//$I->see('Seitenaufrufe'); | ||
//$I->selectOption('#time', ['value' => '1']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters