aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-09-29 01:38:23 +0000
committerChristopher Ng <chrng8@gmail.com>2022-10-05 06:19:08 +0000
commit7044191eb69bb1e2aa4c3edaf03ce73c77971793 (patch)
tree6d9d6bb8ed5e17ba8ded049fd521024d4d900b01 /tests
parente962d3fba4430f3a13cda70db9009784fc24112a (diff)
downloadnextcloud-server-7044191eb69bb1e2aa4c3edaf03ce73c77971793.tar.gz
nextcloud-server-7044191eb69bb1e2aa4c3edaf03ce73c77971793.zip
Use brand color for background only and keep accessible color as color primary
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/app-theming.feature8
-rw-r--r--tests/acceptance/features/bootstrap/ThemingAppContext.php17
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/acceptance/features/app-theming.feature b/tests/acceptance/features/app-theming.feature
index 1da12679d04..6f11a61455f 100644
--- a/tests/acceptance/features/app-theming.feature
+++ b/tests/acceptance/features/app-theming.feature
@@ -9,10 +9,12 @@ 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 primary color is eventually "#0082C9"
+ And I see that the primary color is eventually "#00639a"
+ And I see that the non-plain background color variable 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 primary color is eventually "#C9C9C9"
+ And I see that the non-plain background color variable is eventually "#C9C9C9"
Scenario: resetting the color updates the primary color
Given I am logged in as the admin
@@ -22,6 +24,8 @@ Feature: app-theming
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 primary color is eventually "#C9C9C9"
+ And I see that the non-plain background color variable 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 primary color is eventually "#0082C9"
+ And I see that the primary color is eventually "#00639a"
+ And I see that the non-plain background color variable is eventually "#0082c9"
diff --git a/tests/acceptance/features/bootstrap/ThemingAppContext.php b/tests/acceptance/features/bootstrap/ThemingAppContext.php
index de5da5950d2..adf04eaca00 100644
--- a/tests/acceptance/features/bootstrap/ThemingAppContext.php
+++ b/tests/acceptance/features/bootstrap/ThemingAppContext.php
@@ -142,6 +142,23 @@ class ThemingAppContext implements Context, ActorAwareInterface {
}
/**
+ * @Then I see that the non-plain background color variable is eventually :color
+ */
+ public function iSeeThatTheNonPlainBackgroundColorVariableIsEventually($color) {
+ $colorVariableMatchesCallback = function () use ($color) {
+ $colorVariable = $this->actor->getSession()->evaluateScript("return getComputedStyle(document.documentElement).getPropertyValue('--color-main-background-not-plain').trim();");
+ $colorVariable = $this->getRGBArray($colorVariable);
+ $color = $this->getRGBArray($color);
+
+ return $colorVariable == $color;
+ };
+
+ if (!Utils::waitFor($colorVariableMatchesCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) {
+ Assert::fail("The non-plain background color variable is not $color yet after $timeout seconds");
+ }
+ }
+
+ /**
* @Then I see that the parameters in the Theming app are eventually saved
*/
public function iSeeThatTheParametersInTheThemingAppAreEventuallySaved() {