chore: added random selection of pictures (diff types)

This commit is contained in:
Anastasiya Semenkevich 2023-12-21 13:21:57 +03:00 committed by Anastasiya
parent f31ffc21f5
commit 838c916fc2
7 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,7 @@ RESULTS: SystemPath = TEMP / 'results'
RUN: SystemPath = RESULTS / RUN_ID RUN: SystemPath = RESULTS / RUN_ID
VP: SystemPath = ROOT / 'ext' / 'vp' VP: SystemPath = ROOT / 'ext' / 'vp'
TEST_FILES: SystemPath = ROOT / 'ext' / 'test_files' TEST_FILES: SystemPath = ROOT / 'ext' / 'test_files'
TEST_IMAGES: SystemPath = ROOT / 'ext' / 'test_images'
TEST_USER_DATA: SystemPath = ROOT / 'ext' / 'user_data' TEST_USER_DATA: SystemPath = ROOT / 'ext' / 'user_data'
# Driver Directories # Driver Directories

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 KiB

View File

@ -1,7 +1,9 @@
import logging import logging
import os import os
import pathlib
import random import random
import string import string
import glob
import allure import allure
import pytest import pytest
@ -41,7 +43,8 @@ def keys_screen(main_window) -> KeysView:
string.ascii_letters + string.digits + string.punctuation) string.ascii_letters + string.digits + string.punctuation)
for _ in range(10, 28)) for _ in range(10, 28))
), ),
'tv_signal.jpeg', # TODO: add .tiff and .heif if https://github.com/status-im/status-desktop/issues/13077 is fixed
random.choice(['sample_JPEG_1920×1280.jpeg', 'file_example_PNG_3MB.png', 'file_example_JPG_2500kB.jpg']),
5, 5,
shift_image(0, 1000, 1000, 0)) shift_image(0, 1000, 1000, 0))
]) ])
@ -61,7 +64,7 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
with step('Click plus button and add user picture'): with step('Click plus button and add user picture'):
if user_image is not None: if user_image is not None:
profile_picture_popup = profile_view.set_user_image(configs.testpath.TEST_FILES / user_image) profile_picture_popup = profile_view.set_user_image(configs.testpath.TEST_IMAGES / user_image)
profile_picture_popup.make_picture(zoom=zoom, shift=shift) profile_picture_popup.make_picture(zoom=zoom, shift=shift)
assert not profile_view.get_error_message, \ assert not profile_view.get_error_message, \
f'Error message {profile_view.get_error_message} is present when it should not' f'Error message {profile_view.get_error_message} is present when it should not'