2023-10-06 08:33:42 +00:00
|
|
|
import logging
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-10-06 08:33:42 +00:00
|
|
|
import allure
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-10-06 08:33:42 +00:00
|
|
|
import driver
|
|
|
|
from gui.elements.text_edit import TextEdit
|
|
|
|
from gui.elements.window import Window
|
|
|
|
from scripts.utils.system_path import SystemPath
|
2023-08-04 18:27:03 +00:00
|
|
|
|
2023-12-01 13:58:22 +00:00
|
|
|
LOG = logging.getLogger(__name__)
|
2023-10-06 08:33:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
class OpenFileDialog(Window):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(OpenFileDialog, self).__init__('chooseAnImageALogo_QQuickWindow')
|
|
|
|
self._file_path_text_edit = TextEdit('titleBar_currentPathField_TextField')
|
|
|
|
|
|
|
|
@allure.step('Open file')
|
|
|
|
def open_file(self, fp: SystemPath):
|
|
|
|
driver.type(self._file_path_text_edit.object, "<Ctrl+A>")
|
|
|
|
driver.type(self._file_path_text_edit.object, str(fp))
|
|
|
|
driver.type(self._file_path_text_edit.object, "<Return>")
|
|
|
|
self.wait_until_hidden()
|