fix(e2e): Fixing ComboBox isChecked flag to allow 3 state checkboxes

This commit is contained in:
Alex Jbanca 2024-06-21 10:28:44 +03:00 committed by Alex Jbanca
parent 901362dfc1
commit eb6f037df0
2 changed files with 10 additions and 2 deletions

View File

@ -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)

View File

@ -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}')