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