Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gui/components/community/create_community_popups.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _open_logo_file_dialog(self, attempt: int = 2):
@allure.step('Set community logo')
def logo(self, kwargs: dict):
self._open_logo_file_dialog().open_file(kwargs['fp'])
PictureEditPopup().wait_until_appears().make_picture(kwargs.get('zoom', None), kwargs.get('shift', None))
PictureEditPopup().wait_until_appears().set_zoom_shift_for_picture(kwargs.get('zoom', None), kwargs.get('shift', None))

@property
@allure.step('Get community banner')
Expand All @@ -101,7 +101,7 @@ def banner(self):
def banner(self, kwargs: dict):
self._add_banner_button.click()
OpenFileDialog().wait_until_appears().open_file(kwargs['fp'])
PictureEditPopup().wait_until_appears().make_picture(kwargs.get('zoom', None), kwargs.get('shift', None))
PictureEditPopup().wait_until_appears().set_zoom_shift_for_picture(kwargs.get('zoom', None), kwargs.get('shift', None))

@allure.step('Set community logo without file upload dialog')
def set_logo_without_file_upload_dialog(self, path):
Expand Down Expand Up @@ -164,9 +164,9 @@ def open_next_form(self):
@allure.step('Create community without file upload dialog usage')
def create_community(self, kwargs):
self.set_logo_without_file_upload_dialog(kwargs['logo']['fp'])
PictureEditPopup().make_picture(None, None)
PictureEditPopup().set_zoom_shift_for_picture(None, None)
self.set_banner_without_file_upload_dialog(kwargs['banner']['fp'])
PictureEditPopup().make_picture(None, None)
PictureEditPopup().set_zoom_shift_for_picture(None, None)
for key in list(kwargs):
if key in ['intro', 'outro'] and self._next_button.is_visible:
self._next_button.click()
Expand Down
2 changes: 1 addition & 1 deletion gui/components/picture_edit_popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self):
self._slider_handler = QObject(names.o_DropShadow)

@allure.step('Make picture')
def make_picture(
def set_zoom_shift_for_picture(
self,
zoom: int = None,
shift: shift_image = None
Expand Down
2 changes: 1 addition & 1 deletion gui/objects_map/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
mainWindow_EmojiHash = {"container": statusDesktop_mainWindow, "objectName": "publicKeyEmojiHash", "type": "EmojiHash", "visible": True}
mainWindow_Header_Title = {"container": statusDesktop_mainWindow, "objectName": "onboardingHeaderText", "type": "StyledText", "visible": True}
mainWindow_userImageCopy_StatusSmartIdenticon = {"container": mainWindow_InsertDetailsView, "id": "userImageCopy", "type": "StatusSmartIdenticon", "unnamed": 1, "visible": True}

profileImageCropper = {"container": statusDesktop_mainWindow, "objectName": "imageCropWorkflow", "type": "ImageCropWorkflow", "visible": True}

# Create Password View
mainWindow_CreatePasswordView = {"container": statusDesktop_mainWindow, "type": "CreatePasswordView", "unnamed": 1, "visible": True}
Expand Down
8 changes: 4 additions & 4 deletions gui/screens/community_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def logo(self) -> Image:
def logo(self, kwargs: dict):
self._add_logo_button.click()
OpenFileDialog().wait_until_appears().open_file(kwargs['fp'])
PictureEditPopup().wait_until_appears().make_picture(kwargs.get('zoom', None), kwargs.get('shift', None))
PictureEditPopup().wait_until_appears().set_zoom_shift_for_picture(kwargs.get('zoom', None), kwargs.get('shift', None))

@property
@allure.step('Get community banner')
Expand All @@ -163,7 +163,7 @@ def banner(self) -> Image:
def banner(self, kwargs: dict):
self._add_banner_button.click()
OpenFileDialog().wait_until_appears().open_file(kwargs['fp'])
PictureEditPopup().wait_until_appears().make_picture(kwargs.get('zoom', None), kwargs.get('shift', None))
PictureEditPopup().wait_until_appears().set_zoom_shift_for_picture(kwargs.get('zoom', None), kwargs.get('shift', None))

@allure.step('Set community logo without file upload dialog')
def set_logo_without_file_upload_dialog(self, path):
Expand Down Expand Up @@ -233,9 +233,9 @@ def pin_message_checkbox_state(self) -> bool:
@allure.step('Edit community')
def edit(self, kwargs):
self.set_logo_without_file_upload_dialog(kwargs['logo']['fp'])
PictureEditPopup().make_picture(None, None)
PictureEditPopup().set_zoom_shift_for_picture(None, None)
self.set_banner_without_file_upload_dialog(kwargs['banner']['fp'])
PictureEditPopup().make_picture(None, None)
PictureEditPopup().set_zoom_shift_for_picture(None, None)
for key in list(kwargs):
setattr(self, key, kwargs.get(key))
self._save_changes_button.click()
Expand Down
9 changes: 8 additions & 1 deletion gui/screens/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def __init__(self):
self._clear_icon = QObject(names.mainWindow_clear_icon_StatusIcon)
self._identicon_ring = QObject(names.mainWindow_IdenticonRing)
self._view_header_title = TextLabel(names.mainWindow_Header_Title)
self._image_crop_workflow = QObject(names.profileImageCropper)

def verify_profile_view_present(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
driver.waitFor(lambda: self._view_header_title.exists, timeout_msec)
Expand Down Expand Up @@ -311,7 +312,13 @@ def clear_field(self):
self._clear_icon.click()
return self

@allure.step('Set user image')
@allure.step('Set profile picture without file upload dialog')
def set_profile_picture(self, path) -> PictureEditPopup:
image_cropper = driver.waitForObjectExists(self._image_crop_workflow.real_name)
image_cropper.cropImage(('file://' + str(path)))
return PictureEditPopup()

@allure.step('Set profile picture with file dialog upload')
def set_user_image(self, fp: SystemPath) -> PictureEditPopup:
allure.attach(name='User image', body=fp.read_bytes(), attachment_type=allure.attachment_type.PNG)
self._upload_picture_button.hover()
Expand Down
9 changes: 4 additions & 5 deletions tests/onboarding/test_onboarding_generate_new_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import configs.timeouts
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.picture_edit_popup import shift_image
from gui.components.picture_edit_popup import shift_image, PictureEditPopup
from gui.components.splash_screen import SplashScreen
from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, BiometricsView, KeysView

Expand All @@ -29,7 +29,7 @@ def keys_screen(main_window) -> KeysView:

@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703421', 'Generate new keys')
@pytest.mark.case(703421)
# @pytest.mark.critical TODO: https://github.com/status-im/status-desktop/issues/13483
@pytest.mark.critical
@pytest.mark.parametrize('user_name, password, user_image, zoom, shift', [
pytest.param(
''.join((random.choice(
Expand Down Expand Up @@ -59,9 +59,8 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
f'Error message {profile_view.get_error_message} is present when it should not'

with step('Click plus button and add user picture'):
if user_image is not None:
profile_picture_popup = profile_view.set_user_image(configs.testpath.TEST_IMAGES / user_image)
profile_picture_popup.make_picture(zoom=zoom, shift=shift)
profile_view.set_profile_picture(configs.testpath.TEST_IMAGES / user_image)
PictureEditPopup().set_zoom_shift_for_picture(zoom=zoom, shift=shift)
# TODO: find a way to verify the picture is there (changed to the custom one)
assert profile_view.get_profile_image is not None, f'Profile picture was not set / applied'
assert profile_view.is_identicon_ring_visible, f'Identicon ring is not present when it should'
Expand Down
2 changes: 1 addition & 1 deletion tests/onboarding/test_onboarding_import_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

pytestmark = marks


@pytest.fixture
def keys_screen(main_window) -> KeysView:
with step('Open Generate new keys view'):
Expand Down Expand Up @@ -63,4 +64,3 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au
user_canvas = main_window.left_panel.open_online_identifier()
profile_popup = user_canvas.open_profile_popup_from_online_identifier()
assert profile_popup.user_name == user_account.name

Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@


@pytest.mark.timeout(timeout=180)
@pytest.mark.critical
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703005',
'Change the password and login with new password')
@pytest.mark.case(703005)
@pytest.mark.parametrize('user_account, user_account_changed_password',
[pytest.param(constants.user.user_account_one,
constants.user.user_account_one_changed_password)])
@pytest.mark.xfail(reason='https://github.com/status-im/status-desktop/issues/13013')
@pytest.mark.flaky
# reason='https://github.com/status-im/status-desktop/issues/13013'
def test_change_password_and_login(aut: AUT, main_screen: MainWindow, user_account, user_account_changed_password):
with step('Open profile settings'):
settings_scr = main_screen.left_panel.open_settings()
Expand Down
2 changes: 2 additions & 0 deletions tests/settings/settings_profile/test_settings_profile_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from gui.main_window import MainWindow

pytestmark = marks


@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703006',
'Set display name, bio and social links')
@pytest.mark.case(703006)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
[
pytest.param('GenAcc2', '#2a4af5', 'sunglasses', '1f60e')
])
@pytest.mark.critical
def test_add_generated_account_restart_add_again(
aut: AUT, main_screen: MainWindow, user_account,
color: str, emoji: str, emoji_unicode: str, name: str,
Expand Down