Skip to content

Commit

Permalink
[TASK] Adjust some configuration for the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Dec 20, 2024
1 parent 585cb82 commit b7ccb47
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ test-acceptance: .selenium-start
sleep 2 && \
./.Build/bin/codecept clean && \
./.Build/bin/codecept build && \
./.Build/bin/codecept run acceptance"
./.Build/bin/codecept run acceptance --debug"
echo "$(EMOJI_broom) Cleaning up selenium services"; \
make .selenium-stop; \
exit $${EXIT_CODE:-0}
Expand Down
46 changes: 46 additions & 0 deletions Tests/Acceptance/_support/Helper/MiscellaneousHelper.php
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]);
}
}
2 changes: 1 addition & 1 deletion Tests/Acceptance/acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ modules:
host: seleniarm-hub
port: 4444
path: '/wd/hub'
window_size: 1920x1080
connection_timeout: 5
restart: true
window_size: maximize
capabilities:
browserName: "chrome"
acceptInsecureCerts: true
Expand Down
36 changes: 36 additions & 0 deletions Tests/Acceptance/acceptance/Backend/AnalyseDashboardCest.php
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']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use In2code\Lux\Tests\AcceptanceTester;

class BackendLoginCest
class ModulesExistingCest
{
public function _before(AcceptanceTester $I)
{
Expand Down

0 comments on commit b7ccb47

Please sign in to comment.