2023-11-30 23:32:06 +01:00
|
|
|
import logging
|
|
|
|
|
|
|
|
import allure
|
|
|
|
|
|
|
|
import configs
|
|
|
|
import driver
|
|
|
|
from gui.elements.object import QObject
|
|
|
|
|
2023-12-01 14:58:22 +01:00
|
|
|
LOG = logging.getLogger(__name__)
|
2023-11-30 23:32:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
class CheckBox(QObject):
|
|
|
|
|
|
|
|
@allure.step("Set {0} value: {1}")
|
2024-03-13 11:44:28 +03:00
|
|
|
def set(self, value: bool):
|
2023-11-30 23:32:06 +01:00
|
|
|
if self.is_checked is not value:
|
2024-03-13 11:44:28 +03:00
|
|
|
self.click()
|
2023-11-30 23:32:06 +01:00
|
|
|
assert driver.waitFor(
|
|
|
|
lambda: self.is_checked is value, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), 'Value not changed'
|
2023-12-04 19:16:52 +01:00
|
|
|
LOG.info('%s: value changed to "%s"', self, value)
|