From 73227535a424691ececa1043a5bd02ed6901eca4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 23 Mar 2023 15:12:08 +0100 Subject: [PATCH] SquishTests: Adapt to dark theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depending on the OS QC may be started with dark theming. As we use the color of the buttons on the welcome page to decide whether a button is active or not we need to adapt the expected colors to cover dark theming as well. Change-Id: I844b1e2cf4b44ce9501a4ef4a850331ca9983e3c Reviewed-by: Robert Löhning --- tests/system/suite_WELP/tst_WELP01/test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index 23e974b9a75..b64edcd2b7f 100644 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -19,11 +19,14 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): "Verifying: '%s' button is being displayed." % getStarted) def buttonActive(button): # colors of the default theme for active button on Welcome page - (activeRed, activeGreen, activeBlue) = (69, 206, 85) + defaultActiveRGB = (69, 206, 85) + # colors of the dark theme for active button on Welcome page + darkActiveRGB = (54, 193, 72) # QPalette::Window (used background color of Welcome page buttons) enumQPaletteWindow = 10 color = button.palette.color(enumQPaletteWindow) - return color.red == activeRed and color.green == activeGreen and color.blue == activeBlue + current = (color.red, color.green, color.blue) + return current == defaultActiveRGB or current == darkActiveRGB def waitForButtonsState(projectsActive, examplesActive, tutorialsActive, timeout=5000): projButton = getWelcomeScreenSideBarButton('Projects')[0]