chore: do not hardcode fileuri so it becomes OS agnostic
This commit is contained in:
parent
4f999e3709
commit
5508cd96c9
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
import pathlib
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
|
@ -131,13 +132,15 @@ class CreateCommunityPopup(BasePopup):
|
||||||
@allure.step('Set community logo without file upload dialog')
|
@allure.step('Set community logo without file upload dialog')
|
||||||
def set_logo_without_file_upload_dialog(self, path):
|
def set_logo_without_file_upload_dialog(self, path):
|
||||||
self._scroll.vertical_scroll_to(self._add_logo_button)
|
self._scroll.vertical_scroll_to(self._add_logo_button)
|
||||||
self._cropped_image_logo_item.object.cropImage('file://' + str(path))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
self._cropped_image_logo_item.object.cropImage(fileuri)
|
||||||
return PictureEditPopup()
|
return PictureEditPopup()
|
||||||
|
|
||||||
@allure.step('Set community banner without file upload dialog')
|
@allure.step('Set community banner without file upload dialog')
|
||||||
def set_banner_without_file_upload_dialog(self, path):
|
def set_banner_without_file_upload_dialog(self, path):
|
||||||
self._scroll.vertical_scroll_to(self._add_banner_button)
|
self._scroll.vertical_scroll_to(self._add_banner_button)
|
||||||
self._cropped_image_banner_item.object.cropImage('file://' + str(path))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
self._cropped_image_banner_item.object.cropImage(fileuri)
|
||||||
return PictureEditPopup()
|
return PictureEditPopup()
|
||||||
|
|
||||||
@allure.step('Get community color')
|
@allure.step('Get community color')
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import pathlib
|
||||||
import time
|
import time
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
|
@ -180,12 +181,14 @@ class EditCommunityView(QObject):
|
||||||
|
|
||||||
@allure.step('Set community logo without file upload dialog')
|
@allure.step('Set community logo without file upload dialog')
|
||||||
def set_logo_without_file_upload_dialog(self, path):
|
def set_logo_without_file_upload_dialog(self, path):
|
||||||
self._cropped_image_edit_logo_item.object.cropImage('file://' + str(path))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
self._cropped_image_edit_logo_item.object.cropImage(fileuri)
|
||||||
return PictureEditPopup()
|
return PictureEditPopup()
|
||||||
|
|
||||||
@allure.step('Set community banner without file upload dialog')
|
@allure.step('Set community banner without file upload dialog')
|
||||||
def set_banner_without_file_upload_dialog(self, path):
|
def set_banner_without_file_upload_dialog(self, path):
|
||||||
self._cropped_image_edit_banner_item.object.cropImage('file://' + str(path))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
self._cropped_image_edit_banner_item.object.cropImage(fileuri)
|
||||||
return PictureEditPopup()
|
return PictureEditPopup()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import pathlib
|
||||||
import time
|
import time
|
||||||
import typing
|
import typing
|
||||||
from typing import List
|
from typing import List
|
||||||
|
@ -420,7 +421,8 @@ class ChatMessagesView(QObject):
|
||||||
|
|
||||||
@allure.step('Send image to chat')
|
@allure.step('Send image to chat')
|
||||||
def send_image_to_chat(self, path):
|
def send_image_to_chat(self, path):
|
||||||
self._chat_input.object.selectImageString('file://' + str(path))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
self._chat_input.object.selectImageString(fileuri)
|
||||||
for i in range(2):
|
for i in range(2):
|
||||||
driver.nativeType('<Return>')
|
driver.nativeType('<Return>')
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
import pathlib
|
||||||
import time
|
import time
|
||||||
import typing
|
import typing
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
@ -333,7 +334,8 @@ class YourProfileView(OnboardingView):
|
||||||
@allure.step('Set profile picture without file upload dialog')
|
@allure.step('Set profile picture without file upload dialog')
|
||||||
def set_profile_picture(self, path) -> PictureEditPopup:
|
def set_profile_picture(self, path) -> PictureEditPopup:
|
||||||
image_cropper = driver.waitForObjectExists(self._image_crop_workflow.real_name)
|
image_cropper = driver.waitForObjectExists(self._image_crop_workflow.real_name)
|
||||||
image_cropper.cropImage(('file://' + str(path)))
|
fileuri = pathlib.Path(str(path)).as_uri()
|
||||||
|
image_cropper.cropImage(fileuri)
|
||||||
return PictureEditPopup()
|
return PictureEditPopup()
|
||||||
|
|
||||||
@allure.step('Set profile picture with file dialog upload')
|
@allure.step('Set profile picture with file dialog upload')
|
||||||
|
|
Loading…
Reference in New Issue