Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-09-24 03:02:50 +0300
committerChristopher Ng <chrng8@gmail.com>2022-09-28 20:12:56 +0300
commit295d03869eabcb67bddf14dbde09b36c2e291a18 (patch)
tree2fd3bbe9b080b2a7df031a6e808096339a554bc8 /tests/acceptance
parentf6f0195a3f6643db871f9b857de5e6864a800863 (diff)
Fix various theming bugs
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/features/app-theming.feature12
-rw-r--r--tests/acceptance/features/bootstrap/ThemingAppContext.php16
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/acceptance/features/app-theming.feature b/tests/acceptance/features/app-theming.feature
index 676b90ab06e..1da12679d04 100644
--- a/tests/acceptance/features/app-theming.feature
+++ b/tests/acceptance/features/app-theming.feature
@@ -1,7 +1,7 @@
@apache
Feature: app-theming
- Scenario: changing the color updates the header color
+ Scenario: changing the color updates the primary color
Given I am logged in as the admin
And I visit the admin settings page
And I open the "Theming" section
@@ -9,19 +9,19 @@ 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 background color is eventually "#0082C9"
+ And I see that the primary 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 background color is eventually "#C9C9C9"
+ And I see that the primary color is eventually "#C9C9C9"
- Scenario: resetting the color updates the header color
+ Scenario: resetting the color updates the primary color
Given I am logged in as the admin
And I visit the admin settings page
And I open the "Theming" section
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 background color is eventually "#C9C9C9"
+ And I see that the primary 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 background color is eventually "#0082C9"
+ And I see that the primary color is eventually "#0082C9"
diff --git a/tests/acceptance/features/bootstrap/ThemingAppContext.php b/tests/acceptance/features/bootstrap/ThemingAppContext.php
index 248d58a1794..de5da5950d2 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 background color is eventually :color
+ * @Then I see that the primary color is eventually :color
*/
- public function iSeeThatTheBackgroundColorIsEventually($color) {
- $backgroundColorMatchesCallback = function () use ($color) {
- $headerColor = $this->actor->getSession()->evaluateScript("return $('body').css('background-color');");
- $headerColor = $this->getRGBArray($headerColor);
+ public function iSeeThatThePrimaryColorIsEventually($color) {
+ $primaryColorMatchesCallback = function () use ($color) {
+ $primaryColor = $this->actor->getSession()->evaluateScript("return getComputedStyle(document.documentElement).getPropertyValue('--color-primary').trim();");
+ $primaryColor = $this->getRGBArray($primaryColor);
$color = $this->getRGBArray($color);
- return $headerColor == $color;
+ return $primaryColor == $color;
};
- if (!Utils::waitFor($backgroundColorMatchesCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) {
- Assert::fail("The background color is not $color yet after $timeout seconds");
+ if (!Utils::waitFor($primaryColorMatchesCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) {
+ Assert::fail("The primary color is not $color yet after $timeout seconds");
}
}