From 6dac33ee562316f0ed3bb89b66885693b51ff10d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Thu, 1 Sep 2022 08:22:43 +0200 Subject: [PATCH] Adjust theming acceptance tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/acceptance/features/app-theming.feature | 8 ++++---- .../features/bootstrap/ThemingAppContext.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/features/app-theming.feature b/tests/acceptance/features/app-theming.feature index b6364ae4f44..676b90ab06e 100644 --- a/tests/acceptance/features/app-theming.feature +++ b/tests/acceptance/features/app-theming.feature @@ -9,10 +9,10 @@ Feature: app-theming # The "eventually" part is not really needed here, as the colour is not # being animated at this point, but there is no need to create a specific # step just for this. - And I see that the header color is eventually "#0082C9" + And I see that the background color is eventually "#0082C9" When I set the "Color" parameter in the Theming app to "#C9C9C9" Then I see that the parameters in the Theming app are eventually saved - And I see that the header color is eventually "#C9C9C9" + And I see that the background color is eventually "#C9C9C9" Scenario: resetting the color updates the header color Given I am logged in as the admin @@ -21,7 +21,7 @@ Feature: app-theming And I see that the color selector in the Theming app has loaded And I set the "Color" parameter in the Theming app to "#C9C9C9" And I see that the parameters in the Theming app are eventually saved - And I see that the header color is eventually "#C9C9C9" + And I see that the background color is eventually "#C9C9C9" When I reset the "Color" parameter in the Theming app to its default value Then I see that the parameters in the Theming app are eventually saved - And I see that the header color is eventually "#0082C9" + And I see that the background color is eventually "#0082C9" diff --git a/tests/acceptance/features/bootstrap/ThemingAppContext.php b/tests/acceptance/features/bootstrap/ThemingAppContext.php index d17d9c18109..248d58a1794 100644 --- a/tests/acceptance/features/bootstrap/ThemingAppContext.php +++ b/tests/acceptance/features/bootstrap/ThemingAppContext.php @@ -125,19 +125,19 @@ class ThemingAppContext implements Context, ActorAwareInterface { } /** - * @Then I see that the header color is eventually :color + * @Then I see that the background color is eventually :color */ - public function iSeeThatTheHeaderColorIsEventually($color) { - $headerColorMatchesCallback = function () use ($color) { - $headerColor = $this->actor->getSession()->evaluateScript("return $('#header').css('background-color');"); + public function iSeeThatTheBackgroundColorIsEventually($color) { + $backgroundColorMatchesCallback = function () use ($color) { + $headerColor = $this->actor->getSession()->evaluateScript("return $('body').css('background-color');"); $headerColor = $this->getRGBArray($headerColor); $color = $this->getRGBArray($color); return $headerColor == $color; }; - if (!Utils::waitFor($headerColorMatchesCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) { - Assert::fail("The header color is not $color yet after $timeout seconds"); + if (!Utils::waitFor($backgroundColorMatchesCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) { + Assert::fail("The background color is not $color yet after $timeout seconds"); } } -- 2.39.5