Vladimir Druzhinin 0c63fc6f93 Ci/74 jenkins file (#142)
* OS native dialog replaced on Qt dialog

* Starting fluxbox added to make File Dialog visible
2023-10-06 10:33:42 +02:00

35 lines
995 B
Python

import allure
import configs
import driver
from gui.elements.object import QObject
class TextEdit(QObject):
@property
@allure.step('Get current text {0}')
def text(self) -> str:
return str(self.object.text)
@text.setter
@allure.step('Type text {1} {0}')
def text(self, value: str):
self.clear()
self.type_text(value)
assert driver.waitFor(lambda: self.text == value, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), \
f'Type text failed, value in field: "{self.text}", expected: {value}'
@allure.step('Type: {1} in {0}')
def type_text(self, value: str):
driver.type(self.object, value)
return self
@allure.step('Clear {0}')
def clear(self, verify: bool = True):
self.object.clear()
if verify:
assert driver.waitFor(lambda: not self.text), \
f'Clear text field failed, value in field: "{self.text}"'
return self