diff --git a/test/e2e/gui/elements/check_box.py b/test/e2e/gui/elements/check_box.py index e88aa493b..95ee62226 100644 --- a/test/e2e/gui/elements/check_box.py +++ b/test/e2e/gui/elements/check_box.py @@ -13,8 +13,9 @@ class CheckBox(QObject): @allure.step("Set {0} value: {1}") def set(self, value: bool): - if self.is_checked is not value: + checked = self.checkState != 0 + if checked is not value: self.click() assert driver.waitFor( - lambda: self.is_checked is value, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), 'Value not changed' + lambda: value == (self.checkState != 0), configs.timeouts.UI_LOAD_TIMEOUT_MSEC), 'Value not changed' LOG.info('%s: value changed to "%s"', self, value) diff --git a/test/e2e/gui/elements/object.py b/test/e2e/gui/elements/object.py index 0d04cd187..71007eef6 100644 --- a/test/e2e/gui/elements/object.py +++ b/test/e2e/gui/elements/object.py @@ -72,6 +72,13 @@ class QObject: @allure.step('Get checked {0}') def is_checked(self) -> bool: return getattr(self.object, 'checked') + + @property + @allure.step('Get checkState {0}') + def checkState(self) -> int: + if hasattr(self.object, 'checkState'): + return getattr(self.object, 'checkState') + return 2 if self.is_checked else 0 @property @allure.step('Get visible {0}')