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}")
|
|
|
|
def set(self, value: bool, x: int = None, y: int = None):
|
|
|
|
if self.is_checked is not value:
|
|
|
|
self.click(x, y)
|
|
|
|
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)
|