From 659219d27920ed39de69fc904471061e690cf69f Mon Sep 17 00:00:00 2001 From: yeyartsev <46671418+yeyartsev@users.noreply.github.com> Date: Fri, 7 Jun 2019 16:18:19 +0300 Subject: [PATCH] Issue 384 (#427) * Cropped images for win, unblocked drop_pdf_file * Unblocked drop_jpeg_image * Changed 'drop_here' images, added private window logo * drop_image_data, drop_image_data_in_private_window * drop_jpeg_image * drop_jpeg_image_in_private_window * drop_pdf_file * drop_pdf_file_in_private_window * drop_png_image * drop_png_image_in_private_window * drop_txt_file * drop_txt_file_in_private_window * paste_image_data * paste_jpeg_file * paste... tests --- src/control_center/assets/index.html | 1 - .../firefox/drag_and_drop/drop_image_data.py | 3 +- .../drop_image_data_in_private_window.py | 55 ++++++++------ .../firefox/drag_and_drop/drop_jpeg_image.py | 64 +++++++++++++--- .../drop_jpeg_image_in_private_window.py | 51 +++++++++++-- tests/firefox/drag_and_drop/drop_pdf_file.py | 69 ++++++++++++++---- .../drop_pdf_file_in_private_window.py | 63 +++++++++++++--- tests/firefox/drag_and_drop/drop_png_image.py | 45 +++++++++++- .../drop_png_image_in_private_window.py | 66 ++++++++++++++--- tests/firefox/drag_and_drop/drop_txt_file.py | 63 +++++++++++++--- .../drop_txt_file_in_private_window.py | 45 +++++++++++- .../images/linux/private_window_logo.png | Bin 0 -> 499 bytes .../images/osx/private_window_logo.png | Bin 0 -> 499 bytes .../drag_and_drop/images/win/drop_here.png | Bin 672 -> 233 bytes .../drag_and_drop/images/win/jpg_file.png | Bin 331 -> 916 bytes .../drag_and_drop/images/win/pdf_file.png | Bin 220 -> 704 bytes .../drag_and_drop/images/win/png_file.png | Bin 321 -> 869 bytes .../images/win/private_window_logo.png | Bin 0 -> 499 bytes .../drag_and_drop/images/win/txt_file.png | Bin 277 -> 719 bytes .../drag_and_drop/images/win7/drop_here.png | Bin 672 -> 233 bytes .../images/win7/private_window_logo.png | Bin 0 -> 499 bytes .../firefox/drag_and_drop/paste_image_data.py | 10 +-- .../firefox/drag_and_drop/paste_jpeg_file.py | 4 +- tests/firefox/drag_and_drop/paste_pdf_file.py | 4 +- .../paste_pdf_file_in_private_window.py | 4 +- tests/firefox/drag_and_drop/paste_png_file.py | 4 +- .../paste_png_file_in_private_window.py | 4 +- tests/firefox/drag_and_drop/paste_txt_file.py | 4 +- .../paste_txt_file_in_private_window.py | 4 +- 29 files changed, 450 insertions(+), 113 deletions(-) delete mode 100644 src/control_center/assets/index.html create mode 100644 tests/firefox/drag_and_drop/images/linux/private_window_logo.png create mode 100644 tests/firefox/drag_and_drop/images/osx/private_window_logo.png create mode 100644 tests/firefox/drag_and_drop/images/win/private_window_logo.png create mode 100644 tests/firefox/drag_and_drop/images/win7/private_window_logo.png diff --git a/src/control_center/assets/index.html b/src/control_center/assets/index.html deleted file mode 100644 index 01b20335..00000000 --- a/src/control_center/assets/index.html +++ /dev/null @@ -1 +0,0 @@ -Iris Control Center
\ No newline at end of file diff --git a/tests/firefox/drag_and_drop/drop_image_data.py b/tests/firefox/drag_and_drop/drop_image_data.py index 8b6b3129..aa6a41dc 100644 --- a/tests/firefox/drag_and_drop/drop_image_data.py +++ b/tests/firefox/drag_and_drop/drop_image_data.py @@ -14,7 +14,8 @@ class Test(BaseTest): test_case_id='165086', test_suite_id='102', preferences={'devtools.chrome.enabled': True}, - ) + blocked_by={'id': '1288773', 'platform': OSPlatform.ALL} + ) def run(self, firefox): drop_image_data_radiobutton_selected_pattern = Pattern('drop_image_data_selected.png') drop_image_data_radiobutton_pattern = Pattern('drop_image_data.png') diff --git a/tests/firefox/drag_and_drop/drop_image_data_in_private_window.py b/tests/firefox/drag_and_drop/drop_image_data_in_private_window.py index 89af528a..77176849 100644 --- a/tests/firefox/drag_and_drop/drop_image_data_in_private_window.py +++ b/tests/firefox/drag_and_drop/drop_image_data_in_private_window.py @@ -13,14 +13,14 @@ class Test(BaseTest): locale=['en-US'], test_case_id='165087', test_suite_id='102', - set_profile_pref={'devtools.chrome.enabled': True}, - blocked_by='change_preference, drag_drop, 1328964' + preferences={'devtools.chrome.enabled': True}, + blocked_by={'id': '1288773', 'platform': OSPlatform.ALL} ) def run(self, firefox): drop_image_data_radiobutton_selected_pattern = Pattern('drop_image_data_selected.png') drop_image_data_radiobutton_pattern = Pattern('drop_image_data.png') browser_console_title_pattern = Pattern('browser_console_title.png') - iris_tab_favicon_pattern = Pattern('iris_tab.png') + private_tab_logo_pattern = Pattern('private_window_logo.png') drop_here_pattern = Pattern('drop_here.png') image_from_page_pattern = Pattern('image_from_wiki.png') link_from_page_pattern = Pattern('link.png') @@ -28,30 +28,20 @@ class Test(BaseTest): new_private_window() - if not Settings.is_mac(): - minimize_window() - iris_tab_location = find(iris_tab_favicon_pattern) - start_position = Location(Screen.SCREEN_WIDTH // 25, Screen.SCREEN_HEIGHT // 25) - drag_drop(iris_tab_location, start_position) + private_window_opened = exists(PrivateWindow.private_window_pattern) + assert private_window_opened, 'Private window is opened' - open_browser_console() - console_opened = exists(browser_console_title_pattern) - assert console_opened, 'Browser console opened' - - click(browser_console_title_pattern) - - paste('window.resizeTo({0}, {1})'.format(Screen.SCREEN_WIDTH * 0.45, Screen.SCREEN_HEIGHT * 0.9)) - type(Key.ENTER) - close_tab() + private_tab_opened = exists(private_tab_logo_pattern) + assert private_tab_opened, 'Private window is opened' navigate('https://mystor.github.io/dragndrop/') - test_page_opened = exists(drop_image_data_radiobutton_pattern, Settings.DEFAULT_SITE_LOAD_TIMEOUT) + test_page_opened = exists(drop_image_data_radiobutton_pattern, Settings.site_load_timeout) assert test_page_opened, 'Firefox started and test page loaded successfully.' click(drop_image_data_radiobutton_pattern) drop_image_data_selected = exists(drop_image_data_radiobutton_selected_pattern) assert drop_image_data_selected, \ - 'The \'drop-image-data\' changed color to red which indicates that it has been selected.' + 'The "drop-image-data" changed color to red which indicates that it has been selected.' drop_result_message_displayed = scroll_until_pattern_found(not_matching_message_pattern, type, (Key.DOWN,)) assert drop_result_message_displayed, \ @@ -59,7 +49,24 @@ class Test(BaseTest): 'to be displayed is present on the page after the scrolling' new_window() - opened_tab_location = find(Tabs.NEW_TAB_HIGHLIGHTED) + + if not OSHelper.is_mac(): + minimize_window() + + open_browser_console() + console_opened = exists(browser_console_title_pattern) + assert console_opened, 'Browser console opened' + + click(browser_console_title_pattern) + + paste('window.resizeTo({0}, {1})'.format(Screen.SCREEN_WIDTH * 9 // 20, Screen.SCREEN_HEIGHT * 9 // 10)) + type(Key.ENTER) + close_tab() + + new_window_opened = exists(Tabs.NEW_TAB_HIGHLIGHTED) + assert new_window_opened, 'New window is opened' + + opened_tab_location = find(Tabs.NEW_TAB_HIGHLIGHTED).right(Screen.SCREEN_WIDTH // 4) new_window_drop_location = Location(Screen.SCREEN_WIDTH * 11 // 20, Screen.SCREEN_HEIGHT // 20) drag_drop(opened_tab_location, new_window_drop_location) @@ -70,19 +77,19 @@ class Test(BaseTest): navigate(LocalWeb.SOAP_WIKI_TEST_SITE) page_loaded = exists(image_from_page_pattern, Settings.DEFAULT_SITE_LOAD_TIMEOUT) assert page_loaded, \ - 'Wiki page loaded and contains an image that will be dropped into \'Drop stuff here\' area' + 'Wiki page loaded and contains an image that will be dropped into "Drop stuff here" area' drag_drop(image_from_page_pattern, drop_here_pattern) not_matching_message_appears = exists(not_matching_message_pattern) assert not_matching_message_appears is False, \ - '\'Matching\' appears under the \'Drop Stuff Here\' area, the expected result is ' \ + '"Matching" appears under the "Drop Stuff Here" area, the expected result is ' \ 'identical to result and the image is displayed lower in the page.' link_displayed = exists(link_from_page_pattern) - assert link_displayed, 'Wiki page contains link that will be dropped into \'Drop stuff here\' area' + assert link_displayed, 'Wiki page contains link that will be dropped into "Drop stuff here" area' drag_drop(link_from_page_pattern, drop_here_pattern) not_matching_message_appears = exists(not_matching_message_pattern) - assert not_matching_message_appears, '\'Not Matching\' appears under the Drop Stuff Here ' \ + assert not_matching_message_appears, '"Not Matching" appears under the Drop Stuff Here ' \ 'area, the expected result is different to result.' diff --git a/tests/firefox/drag_and_drop/drop_jpeg_image.py b/tests/firefox/drag_and_drop/drop_jpeg_image.py index cd7816a7..d69fc906 100644 --- a/tests/firefox/drag_and_drop/drop_jpeg_image.py +++ b/tests/firefox/drag_and_drop/drop_jpeg_image.py @@ -6,7 +6,33 @@ from targets.firefox.fx_testcase import * -class Test(BaseTest): +class Test(FirefoxTest): + + def setup(self): + jpg_file_name = 'jpgimage.jpg' + png_file_name = 'pngimage.png' + + jpg_copy_name = 'jpgimage_bak.jpg' + png_copy_name = 'pngimage_bak.png' + + copies_directory_name = 'copies' + + copied_jpg_file = os.path.join(copies_directory_name, jpg_copy_name) + copied_png_file = os.path.join(copies_directory_name, png_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_jpgfile_path = self.get_asset_path(jpg_file_name) + backup_jpgfile_path = self.get_asset_path(copied_jpg_file) + + original_pngfile_path = self.get_asset_path(png_file_name) + backup_pngfile_path = self.get_asset_path(copied_png_file) + + copy_file(original_jpgfile_path, backup_jpgfile_path) + copy_file(original_pngfile_path, backup_pngfile_path) @pytest.mark.details( description='Drop .jpeg image File in demopage', @@ -14,8 +40,6 @@ class Test(BaseTest): test_case_id='165084', test_suite_id='102', set_profile_pref={'devtools.chrome.enabled': True}, - blocked_by='change_preference, drag_drop, 1328964' - ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON @@ -35,9 +59,9 @@ class Test(BaseTest): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - DRAG_AND_DROP_DURATION = 3 - PASTE_DELAY = 0.5 - folderpath = self.get_asset_path('') + drag_and_drop_duration = 3 + paste_delay = 0.5 + folderpath = self.get_asset_path('copies') navigate('https://mystor.github.io/dragndrop/') @@ -75,7 +99,7 @@ class Test(BaseTest): width=library_title_width * 2, height=library_title_height * 3) library_popup_tab_after = Location(Screen.SCREEN_WIDTH // 2, library_popup_tab_before.y) - drag_drop(library_popup_tab_before, library_popup_tab_after, duration=DRAG_AND_DROP_DURATION) + drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) library_popup_dropped = exists(library_popup_pattern, region=library_tab_region_after) assert library_popup_dropped, 'Library popup dropped to right half of screen successfully' @@ -104,7 +128,7 @@ class Test(BaseTest): type('2', KeyModifier.CMD) # change view of finder else: paste(folderpath) - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) if OSHelper.is_linux(): json_option_available = exists(file_type_json_pattern) @@ -119,9 +143,9 @@ class Test(BaseTest): else: type('*') # Show all files in Windows Explorer - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) - select_bookmark_popup_location_final = Location(Settings.SCREEN_WIDTH / 2, library_popup_tab_before.y) + select_bookmark_popup_location_final = Location(Screen.SCREEN_WIDTH // 2, library_popup_tab_before.y) # drag-n-drop right to prevent fails on osx drag_drop(select_bookmark_popup_before.right(library_title_width), select_bookmark_popup_location_final) @@ -131,7 +155,7 @@ class Test(BaseTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - drag_drop(jpg_bak_file_pattern, drop_here_pattern, duration=DRAG_AND_DROP_DURATION) + drag_drop(jpg_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) matching_message_displayed = exists(matching_message_pattern, region=matching_region) assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected ' \ @@ -143,7 +167,7 @@ class Test(BaseTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - drag_drop(png_bak_file_pattern, drop_here_pattern, duration=DRAG_AND_DROP_DURATION) + drag_drop(png_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) not_matching_message_displayed = exists(not_matching_message_pattern, region=not_matching_region) assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and ' \ @@ -152,3 +176,19 @@ class Test(BaseTest): type(Key.ESC) close_tab() + + def teardown(self): + jpg_file_name = 'jpgimage_bak.jpg' + png_file_name = 'pngimage_bak.png' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + png_backup_file = os.path.join(copies_directory_name, png_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + png_backup_path = self.get_asset_path(png_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(png_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_jpeg_image_in_private_window.py b/tests/firefox/drag_and_drop/drop_jpeg_image_in_private_window.py index 6b1c531a..ed992fbc 100644 --- a/tests/firefox/drag_and_drop/drop_jpeg_image_in_private_window.py +++ b/tests/firefox/drag_and_drop/drop_jpeg_image_in_private_window.py @@ -6,7 +6,33 @@ from targets.firefox.fx_testcase import * -class Test(BaseTest): +class Test(FirefoxTest): + + def setup(self): + jpg_file_name = 'jpgimage.jpg' + png_file_name = 'pngimage.png' + + jpg_copy_name = 'jpgimage_bak.jpg' + png_copy_name = 'pngimage_bak.png' + + copies_directory_name = 'copies' + + copied_pdf_file = os.path.join(copies_directory_name, jpg_copy_name) + copied_txt_file = os.path.join(copies_directory_name, png_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_pdffile_path = self.get_asset_path(jpg_file_name) + backup_pdffile_path = self.get_asset_path(copied_pdf_file) + + original_txtfile_path = self.get_asset_path(png_file_name) + backup_txtfile_path = self.get_asset_path(copied_txt_file) + + copy_file(original_pdffile_path, backup_pdffile_path) + copy_file(original_txtfile_path, backup_txtfile_path) @pytest.mark.details( description='Drop single and multiple .jpeg images in demopage opened in Private Window', @@ -14,8 +40,6 @@ class Test(BaseTest): test_case_id='165085', test_suite_id='102', set_profile_pref={'devtools.chrome.enabled': True}, - blocked_by='get_asset_path, drag_drop, 1328964' - ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON @@ -39,7 +63,7 @@ class Test(BaseTest): drag_and_drop_duration = 3 paste_delay = 0.5 - folderpath = self.get_asset_path('') + folderpath = self.get_asset_path('copies') new_private_window() @@ -82,7 +106,7 @@ class Test(BaseTest): width=library_title_width * 2, height=library_title_height * 3) library_popup_tab_after = Location(Screen.SCREEN_WIDTH // 2, library_popup_tab_before.y) - drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) + drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) library_popup_dropped = exists(library_popup_pattern, region=library_tab_region_after) assert library_popup_dropped, 'Library popup dropped to right half of screen successfully' @@ -160,3 +184,20 @@ class Test(BaseTest): type(Key.ESC) close_tab() close_tab() + + def teardown(self): + + jpg_file_name = 'jpgimage_bak.jpg' + png_file_name = 'pngimage_bak.png' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + png_backup_file = os.path.join(copies_directory_name, png_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + png_backup_path = self.get_asset_path(png_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(png_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_pdf_file.py b/tests/firefox/drag_and_drop/drop_pdf_file.py index e7a0c178..59d77adf 100644 --- a/tests/firefox/drag_and_drop/drop_pdf_file.py +++ b/tests/firefox/drag_and_drop/drop_pdf_file.py @@ -8,13 +8,38 @@ from targets.firefox.fx_testcase import * class Test(FirefoxTest): + def setup(self): + pdf_file_name = 'pdffile.pdf' + txt_file_name = 'testfile.txt' + + pdf_copy_name = 'pdffile_bak.pdf' + txt_copy_name = 'testfile_bak.txt' + + copies_directory_name = 'copies' + + copied_pdf_file = os.path.join(copies_directory_name, pdf_copy_name) + copied_txt_file = os.path.join(copies_directory_name, txt_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_pdffile_path = self.get_asset_path(pdf_file_name) + backup_pdffile_path = self.get_asset_path(copied_pdf_file) + + original_txtfile_path = self.get_asset_path(txt_file_name) + backup_txtfile_path = self.get_asset_path(copied_txt_file) + + copy_file(original_pdffile_path, backup_pdffile_path) + copy_file(original_txtfile_path, backup_txtfile_path) + @pytest.mark.details( description='Drop .pdf File in demopage', locale=['en-US'], test_case_id='165080', test_suite_id='102', set_profile_pref={'devtools.chrome.enabled': True}, - blocked_by='change_preference, drag_drop, 270' ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON @@ -29,14 +54,16 @@ class Test(FirefoxTest): matching_message_pattern = Pattern('matching_message_precise.png') pdf_bak_file_pattern = Pattern('pdf_bak_file.png') txt_bak_file_pattern = Pattern('txt_bak_file.png') + file_type_json_pattern = None + file_type_all_files_pattern = None - if Settings.is_linux(): + if OSHelper.is_linux(): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - DRAG_AND_DROP_DURATION = 3 - PASTE_DELAY = 0.5 - folderpath = self.get_asset_path('') + drag_and_drop_duration = 2 + paste_delay = 0.5 + folderpath = self.get_asset_path('copies') navigate('https://mystor.github.io/dragndrop/') @@ -74,7 +101,7 @@ class Test(FirefoxTest): width=library_title_width * 2, height=library_title_height * 3) library_popup_tab_after = Location(Screen.SCREEN_WIDTH // 2, library_popup_tab_before.y) - drag_drop(library_popup_tab_before, library_popup_tab_after, duration=DRAG_AND_DROP_DURATION) + drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) library_popup_dropped = exists(library_popup_pattern, region=library_tab_region_after) assert library_popup_dropped, 'Library popup dropped to right half of screen successfully' @@ -97,16 +124,16 @@ class Test(FirefoxTest): select_bookmark_popup_before = find(select_bookmark_popup_pattern) - if Settings.is_mac(): + if OSHelper.is_mac(): type('g', modifier=KeyModifier.CMD + KeyModifier.SHIFT) # open folder in Finder paste(folderpath) type(Key.ENTER) type('2', KeyModifier.CMD) # change view of finder else: paste(folderpath) - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) - if Settings.is_linux(): + if OSHelper.is_linux(): json_option_available = exists(file_type_json_pattern) assert json_option_available, '"File type JSON" option in file picker window is available' @@ -119,7 +146,7 @@ class Test(FirefoxTest): else: type('*') # Show all files in Windows Explorer - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) select_bookmark_popup_location_final = Location(Screen.SCREEN_WIDTH // 2, library_popup_tab_before.y) # drag-n-drop right to prevent fails on osx @@ -131,7 +158,7 @@ class Test(FirefoxTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - drag_drop(pdf_bak_file_pattern, drop_here_pattern, DRAG_AND_DROP_DURATION) + drag_drop(pdf_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) matching_message_displayed = exists(matching_message_pattern, region=matching_region) assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected ' \ @@ -142,8 +169,8 @@ class Test(FirefoxTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - - drag_drop(txt_bak_file_pattern, drop_here_pattern, duration=DRAG_AND_DROP_DURATION) + open_browser_console() + drag_drop(txt_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) not_matching_message_displayed = exists(not_matching_message_pattern, region=not_matching_region) assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and ' \ @@ -151,3 +178,19 @@ class Test(FirefoxTest): type(Key.ESC) close_tab() + + def teardown(self): + pdf_file_name = 'pdffile_bak.pdf' + txt_file_name = 'testfile_bak.txt' + copies_directory_name = 'copies' + + pdf_backup_file = os.path.join(copies_directory_name, pdf_file_name) + txt_backup_file = os.path.join(copies_directory_name, txt_file_name) + + pdf_backup_path = self.get_asset_path(pdf_backup_file) + txt_backup_path = self.get_asset_path(txt_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(pdf_backup_path) + delete_file(txt_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_pdf_file_in_private_window.py b/tests/firefox/drag_and_drop/drop_pdf_file_in_private_window.py index 6e675bd5..c3c98d80 100644 --- a/tests/firefox/drag_and_drop/drop_pdf_file_in_private_window.py +++ b/tests/firefox/drag_and_drop/drop_pdf_file_in_private_window.py @@ -8,13 +8,37 @@ from targets.firefox.fx_testcase import * class Test(FirefoxTest): + def setup(self): + pdf_file_name = 'pdffile.pdf' + txt_file_name = 'testfile.txt' + + pdf_copy_name = 'pdffile_bak.pdf' + txt_copy_name = 'testfile_bak.txt' + + copies_directory_name = 'copies' + + copied_pdf_file = os.path.join(copies_directory_name, pdf_copy_name) + copied_txt_file = os.path.join(copies_directory_name, txt_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_pdffile_path = self.get_asset_path(pdf_file_name) + backup_pdffile_path = self.get_asset_path(copied_pdf_file) + + original_txtfile_path = self.get_asset_path(txt_file_name) + backup_txtfile_path = self.get_asset_path(copied_txt_file) + + copy_file(original_pdffile_path, backup_pdffile_path) + copy_file(original_txtfile_path, backup_txtfile_path) + @pytest.mark.details( description='Drop .pdf File in demopage', locale=['en-US'], test_case_id='165080', test_suite_id='102', - set_profile_pref={'devtools.chrome.enabled': True}, - blocked_by='shutil, os, 270' ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON @@ -32,13 +56,14 @@ class Test(FirefoxTest): file_type_all_files_pattern = None file_type_json_pattern = None - PASTE_DELAY = 0.5 - if OSHelper.is_linux(): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - folderpath = self.get_asset_path('') + paste_delay = 0.5 + drag_and_drop_duration = 2 + + folderpath = self.get_asset_path('copies') new_private_window() @@ -47,7 +72,7 @@ class Test(FirefoxTest): navigate('https://mystor.github.io/dragndrop/') - drop_pdf_file_button_displayed = exists(drop_pdf_file_button_pattern, Settings.DEFAULT_SITE_LOAD_TIMEOUT) + drop_pdf_file_button_displayed = exists(drop_pdf_file_button_pattern, Settings.site_load_timeout) assert drop_pdf_file_button_displayed, 'The demo website loaded successfully' click(drop_pdf_file_button_pattern) @@ -81,7 +106,7 @@ class Test(FirefoxTest): width=library_title_width * 2, height=library_title_height * 3) library_popup_tab_after = Location(Screen.SCREEN_WIDTH / 2, library_popup_tab_before.y) - drag_drop(library_popup_tab_before, library_popup_tab_after, Settings.DRAG_AND_DROP_DURATION) + drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) library_popup_dropped = exists(library_popup_pattern, region=library_tab_region_after) assert library_popup_dropped, 'Library popup dropped to right half of screen successfully' @@ -111,7 +136,7 @@ class Test(FirefoxTest): type('2', KeyModifier.CMD) # change view of finder else: paste(folderpath) - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) if OSHelper.is_linux(): json_option_available = exists(file_type_json_pattern) @@ -126,7 +151,7 @@ class Test(FirefoxTest): else: type('*') # Show all files in Windows Explorer - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) select_bookmark_popup_location_final = Location(Screen.SCREEN_WIDTH / 2, library_popup_tab_before.y) # drag-n-drop right to prevent fails on osx @@ -138,7 +163,7 @@ class Test(FirefoxTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - drag_drop(pdf_bak_file_pattern, drop_here_pattern, Settings.DRAG_AND_DROP_DURATION) + drag_drop(pdf_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) matching_message_displayed = exists(matching_message_pattern, region=matching_region) assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected ' \ @@ -150,7 +175,7 @@ class Test(FirefoxTest): drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern is available' - drag_drop(txt_bak_file_pattern, drop_here_pattern, Settings.DRAG_AND_DROP_DURATION) + drag_drop(txt_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) not_matching_message_displayed = exists(not_matching_message_pattern, region=not_matching_region) assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and ' \ @@ -159,3 +184,19 @@ class Test(FirefoxTest): type(Key.ESC) close_tab() close_tab() + + def teardown(self): + pdf_file_name = 'pdffile_bak.pdf' + txt_file_name = 'testfile_bak.txt' + copies_directory_name = 'copies' + + pdf_backup_file = os.path.join(copies_directory_name, pdf_file_name) + txt_backup_file = os.path.join(copies_directory_name, txt_file_name) + + pdf_backup_path = self.get_asset_path(pdf_backup_file) + txt_backup_path = self.get_asset_path(txt_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(pdf_backup_path) + delete_file(txt_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_png_image.py b/tests/firefox/drag_and_drop/drop_png_image.py index 25f2e6ea..095c69bb 100644 --- a/tests/firefox/drag_and_drop/drop_png_image.py +++ b/tests/firefox/drag_and_drop/drop_png_image.py @@ -8,12 +8,37 @@ from targets.firefox.fx_testcase import * class Test(FirefoxTest): + def setup(self): + jpg_file_name = 'jpgimage.jpg' + png_file_name = 'pngimage.png' + + jpg_copy_name = 'jpgimage_bak.jpg' + png_copy_name = 'pngimage_bak.png' + + copies_directory_name = 'copies' + + copied_jpg_file = os.path.join(copies_directory_name, jpg_copy_name) + copied_png_file = os.path.join(copies_directory_name, png_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_jpgfile_path = self.get_asset_path(jpg_file_name) + backup_jpgfile_path = self.get_asset_path(copied_jpg_file) + + original_png_file_path = self.get_asset_path(png_file_name) + backup_png_file_path = self.get_asset_path(copied_png_file) + + copy_file(original_jpgfile_path, backup_jpgfile_path) + copy_file(original_png_file_path, backup_png_file_path) + @pytest.mark.details( description='Drop html data in demopage opened in Private Window', locale=['en-US'], test_case_id='165089', test_suite_id='102', - blocked_by='270, drag_drop' ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON @@ -37,7 +62,7 @@ class Test(FirefoxTest): drag_and_drop_duration = 3 paste_delay = 0.5 - folderpath = self.get_asset_path('') + folderpath = self.get_asset_path('copies') navigate('https://mystor.github.io/dragndrop/') @@ -152,3 +177,19 @@ class Test(FirefoxTest): type(Key.ESC) close_tab() + + def teardown(self): + jpg_file_name = 'jpgimage_bak.jpg' + png_file_name = 'pngimage_bak.png' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + png_backup_file = os.path.join(copies_directory_name, png_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + png_backup_path = self.get_asset_path(png_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(png_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_png_image_in_private_window.py b/tests/firefox/drag_and_drop/drop_png_image_in_private_window.py index 704290ff..6edb3333 100644 --- a/tests/firefox/drag_and_drop/drop_png_image_in_private_window.py +++ b/tests/firefox/drag_and_drop/drop_png_image_in_private_window.py @@ -8,12 +8,38 @@ from targets.firefox.fx_testcase import * class Test(FirefoxTest): + def setup(self): + jpg_file_name = 'jpgimage.jpg' + png_file_name = 'pngimage.png' + + jpg_copy_name = 'jpgimage_bak.jpg' + png_copy_name = 'pngimage_bak.png' + + copies_directory_name = 'copies' + + copied_jpg_file = os.path.join(copies_directory_name, jpg_copy_name) + copied_png_file = os.path.join(copies_directory_name, png_copy_name) + + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + + os.mkdir(copies_directory_path) + + original_jpgfile_path = self.get_asset_path(jpg_file_name) + backup_jpgfile_path = self.get_asset_path(copied_jpg_file) + + original_png_file_path = self.get_asset_path(png_file_name) + backup_png_file_path = self.get_asset_path(copied_png_file) + + copy_file(original_jpgfile_path, backup_jpgfile_path) + copy_file(original_png_file_path, backup_png_file_path) + @pytest.mark.details( description='Drop single and multiple .png images in demopage opened in Private Window', locale=['en-US'], test_case_id='165086', test_suite_id='102', - ) + ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON library_import_restore_submenu_pattern = Library.ImportAndBackup.RESTORE @@ -32,9 +58,9 @@ class Test(FirefoxTest): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - drag_and_drop_duration = 3 + drag_and_drop_duration = 2 paste_delay = 0.5 - folderpath = self.get_asset_path('') + folderpath = self.get_asset_path('copies') new_private_window() @@ -49,8 +75,8 @@ class Test(FirefoxTest): click(drop_png_file_button_pattern) drop_png_option_selected = exists(drop_png_file_selected_button_pattern) - assert drop_png_option_selected, 'The drop-png-file changed color to red which indicates that it '\ - 'has been selected.' + assert drop_png_option_selected, 'The drop-png-file changed color to red which indicates that it ' \ + 'has been selected.' matching_block_available = scroll_until_pattern_found(not_matching_message_pattern, scroll_down, (5,), 30, paste_delay) @@ -86,8 +112,8 @@ class Test(FirefoxTest): click(library_import_backup_pattern) restore_context_available = exists(library_import_restore_submenu_pattern) - assert restore_context_available, '\'Restore\' option from \'Import and Backup\'context menu is '\ - 'available' + assert restore_context_available, '\'Restore\' option from \'Import and Backup\'context menu is ' \ + 'available' click(library_import_restore_submenu_pattern) @@ -138,8 +164,8 @@ class Test(FirefoxTest): drag_drop(png_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) matching_message_displayed = exists(matching_message_pattern, region=matching_region) - assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected '\ - 'result is identical to result.' + assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected ' \ + 'result is identical to result.' test_file_jpg_located = exists(jpg_bak_file_pattern) assert test_file_jpg_located, 'JPG test file is available' @@ -150,9 +176,25 @@ class Test(FirefoxTest): drag_drop(jpg_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) not_matching_message_displayed = exists(not_matching_message_pattern, region=not_matching_region) - assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and '\ - 'expected result is different from result.' + assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and ' \ + 'expected result is different from result.' type(Key.ESC) close_tab() - close_tab() \ No newline at end of file + close_tab() + + def teardown(self): + jpg_file_name = 'jpgimage_bak.jpg' + png_file_name = 'pngimage_bak.png' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + png_backup_file = os.path.join(copies_directory_name, png_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + png_backup_path = self.get_asset_path(png_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(png_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/drop_txt_file.py b/tests/firefox/drag_and_drop/drop_txt_file.py index 6152844c..8d104a0d 100644 --- a/tests/firefox/drag_and_drop/drop_txt_file.py +++ b/tests/firefox/drag_and_drop/drop_txt_file.py @@ -6,14 +6,39 @@ from targets.firefox.fx_testcase import * -class Test(BaseTest): +class Test(FirefoxTest): + + def setup(self): + + copies_directory_name = 'copies' + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + os.mkdir(copies_directory_path) + + jpg_file_name = 'jpgimage.jpg' + jpg_copy_name = 'jpgimage_bak.jpg' + copied_jpg_file = os.path.join(copies_directory_name, jpg_copy_name) + + original_jpgfile_path = self.get_asset_path(jpg_file_name) + backup_jpgfile_path = self.get_asset_path(copied_jpg_file) + + copy_file(original_jpgfile_path, backup_jpgfile_path) + + txt_file_name = 'testfile.txt' + txt_copy_name = 'testfile_bak.txt' + copied_txt_file = os.path.join(copies_directory_name, txt_copy_name) + + original_txtfile_path = self.get_asset_path(txt_file_name) + backup_txtfile_path = self.get_asset_path(copied_txt_file) + + copy_file(original_txtfile_path, backup_txtfile_path) @pytest.mark.details( description='Drop .txt File in demopage', locale=['en-US'], test_case_id='165086', test_suite_id='102', - ) + ) def run(self, firefox): library_import_backup_pattern = Library.IMPORT_AND_BACKUP_BUTTON drop_txt_file_button_pattern = Pattern('drop_txt_file_button.png') @@ -30,10 +55,10 @@ class Test(BaseTest): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - folderpath = self.get_asset_path('') + folderpath = self.get_asset_path('copies') - DRAG_AND_DROP_DURATION = 3 - PASTE_DELAY = 0.5 + drag_and_drop_duration = 2 + paste_delay = 0.5 navigate('https://mystor.github.io/dragndrop/') drop_html_data_button_displayed = exists(drop_txt_file_button_pattern,) @@ -70,7 +95,7 @@ class Test(BaseTest): width=library_title_width * 2, height=library_title_height * 3) library_popup_tab_after = Location(Screen.SCREEN_WIDTH / 2, library_popup_tab_before.y) - drag_drop(library_popup_tab_before, library_popup_tab_after, duration=DRAG_AND_DROP_DURATION) + drag_drop(library_popup_tab_before, library_popup_tab_after, duration=drag_and_drop_duration) library_popup_dropped = exists(library_popup_pattern, region=library_tab_region_after) assert library_popup_dropped, 'Library popup dropped to right half of screen successfully' @@ -99,7 +124,7 @@ class Test(BaseTest): type('1', KeyModifier.CMD) else: paste(folderpath) - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) if OSHelper.is_linux(): json_option = exists(file_type_json_pattern) @@ -114,7 +139,7 @@ class Test(BaseTest): else: type('*') - type(Key.ENTER, interval=PASTE_DELAY) + type(Key.ENTER, interval=paste_delay) select_bookmark_popup_location_final = Location(Screen.SCREEN_WIDTH / 2, library_popup_tab_before.y) # drag-n-drop right to prevent fails on osx @@ -126,7 +151,7 @@ class Test(BaseTest): drop_here = exists(drop_here_pattern) assert drop_here, '"Drop here" pattern available' - drag_drop(txt_bak_file_pattern, drop_here_pattern, duration=DRAG_AND_DROP_DURATION) + drag_drop(txt_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) matching_message_displayed = exists(matching_message_pattern, region=matching_region) assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected '\ @@ -135,11 +160,27 @@ class Test(BaseTest): test_file_jpg = exists(jpg_bak_file_pattern) assert test_file_jpg, 'JPG test file is available' - drag_drop(jpg_bak_file_pattern, drop_here_pattern, DRAG_AND_DROP_DURATION) + drag_drop(jpg_bak_file_pattern, drop_here_pattern, duration=drag_and_drop_duration) not_matching_message_displayed = exists(not_matching_message_pattern, region=not_matching_region) assert not_matching_message_displayed, 'Not Matching appears under the "Drop Stuff Here" area and '\ 'expected result is different from result.' type(Key.ESC) - close_tab() \ No newline at end of file + close_tab() + + def teardown(self): + jpg_file_name = 'jpgimage_bak.jpg' + txt_file_name = 'testfile_bak.txt' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + txt_backup_file = os.path.join(copies_directory_name, txt_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + txt_backup_path = self.get_asset_path(txt_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(txt_backup_path) + os.rmdir(copies_directory) \ No newline at end of file diff --git a/tests/firefox/drag_and_drop/drop_txt_file_in_private_window.py b/tests/firefox/drag_and_drop/drop_txt_file_in_private_window.py index a4078519..22e9719e 100644 --- a/tests/firefox/drag_and_drop/drop_txt_file_in_private_window.py +++ b/tests/firefox/drag_and_drop/drop_txt_file_in_private_window.py @@ -8,6 +8,31 @@ from targets.firefox.fx_testcase import * class Test(FirefoxTest): + def setup(self): + + copies_directory_name = 'copies' + asset_dir = self.get_asset_path('') + copies_directory_path = os.path.join(asset_dir, copies_directory_name) + os.mkdir(copies_directory_path) + + jpg_file_name = 'jpgimage.jpg' + jpg_copy_name = 'jpgimage_bak.jpg' + copied_jpg_file = os.path.join(copies_directory_name, jpg_copy_name) + + original_jpgfile_path = self.get_asset_path(jpg_file_name) + backup_jpgfile_path = self.get_asset_path(copied_jpg_file) + + copy_file(original_jpgfile_path, backup_jpgfile_path) + + txt_file_name = 'testfile.txt' + txt_copy_name = 'testfile_bak.txt' + copied_txt_file = os.path.join(copies_directory_name, txt_copy_name) + + original_txtfile_path = self.get_asset_path(txt_file_name) + backup_txtfile_path = self.get_asset_path(copied_txt_file) + + copy_file(original_txtfile_path, backup_txtfile_path) + @pytest.mark.details( description='Drop single and multiple .txt files in demopage opened in Private Window.', locale=['en-US'], @@ -32,9 +57,9 @@ class Test(FirefoxTest): file_type_all_files_pattern = Pattern('file_type_all_files.png') file_type_json_pattern = Pattern('file_type_json.png') - folderpath = self.get_asset_path('') + folderpath = self.get_asset_path('copies') - drag_and_drop_duration = 3 + drag_and_drop_duration = 2 paste_delay = 0.5 new_private_window() @@ -150,3 +175,19 @@ class Test(FirefoxTest): type(Key.ESC) close_tab() + + def teardown(self): + jpg_file_name = 'jpgimage_bak.jpg' + txt_file_name = 'testfile_bak.txt' + copies_directory_name = 'copies' + + jpg_backup_file = os.path.join(copies_directory_name, jpg_file_name) + txt_backup_file = os.path.join(copies_directory_name, txt_file_name) + + jpg_backup_path = self.get_asset_path(jpg_backup_file) + txt_backup_path = self.get_asset_path(txt_backup_file) + copies_directory = self.get_asset_path(copies_directory_name) + + delete_file(jpg_backup_path) + delete_file(txt_backup_path) + os.rmdir(copies_directory) diff --git a/tests/firefox/drag_and_drop/images/linux/private_window_logo.png b/tests/firefox/drag_and_drop/images/linux/private_window_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..cd59fc6e470bb49660eca899062136cac8eb2f7e GIT binary patch literal 499 zcmV?ZwXB#jYI`Oq_9NwmL<)XW!ep8tmE?ir1P5_wMUa$c`+a z@9vjbS`!tq7_|AjOwxoYG+gf+s`HK*=h0`ZaRdbuCr9Wm)6&gpQ9wcc#u|g^x!lvk zOQ}@in_oST4s0MOUrqqPBzsyw;kPAur&Pla7(EhD&_9*p`SI1;r|8kaP4x~6CQgo2 z3QtQ+KtcaU8v>Wd*MNvT<;(F^DYPblQDeX@q#%*;=FrCEp*H6H+6AKZ008C}CPIa# zEHXhJMG6GWYeYWQ6hu%kadHG;+9FeX0R{7`3}yQ|cfgUqv zc(hg=878O7Xjv1oGowG?dpax}Mf3-}Jm$_Up?s9~&002ovPDHLkV1lvh>ns2O literal 0 HcmV?d00001 diff --git a/tests/firefox/drag_and_drop/images/osx/private_window_logo.png b/tests/firefox/drag_and_drop/images/osx/private_window_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..cd59fc6e470bb49660eca899062136cac8eb2f7e GIT binary patch literal 499 zcmV?ZwXB#jYI`Oq_9NwmL<)XW!ep8tmE?ir1P5_wMUa$c`+a z@9vjbS`!tq7_|AjOwxoYG+gf+s`HK*=h0`ZaRdbuCr9Wm)6&gpQ9wcc#u|g^x!lvk zOQ}@in_oST4s0MOUrqqPBzsyw;kPAur&Pla7(EhD&_9*p`SI1;r|8kaP4x~6CQgo2 z3QtQ+KtcaU8v>Wd*MNvT<;(F^DYPblQDeX@q#%*;=FrCEp*H6H+6AKZ008C}CPIa# zEHXhJMG6GWYeYWQ6hu%kadHG;+9FeX0R{7`3}yQ|cfgUqv zc(hg=878O7Xjv1oGowG?dpax}Mf3-}Jm$_Up?s9~&002ovPDHLkV1lvh>ns2O literal 0 HcmV?d00001 diff --git a/tests/firefox/drag_and_drop/images/win/drop_here.png b/tests/firefox/drag_and_drop/images/win/drop_here.png index 22702f03598b43fb4cf5c07def83e61cefa6fedc..c00b6dc7bcb22d687d48e03a10a1583310808e79 100644 GIT binary patch literal 233 zcmVL2nE^5i5!S+7{+~C#0Ei0YTLx5eCZ2tA|f0c4fetcCQwUQs_Hbz^btb2C4s)Z zK+a{JW(t(IP|N6ztwW53^@&*#C5L?Xz)y1If-F$CDg#s=Nm3#3dY!(#4dwOTnO zY8j2jPYd~cKKPYN1%4YAPUrBuAb^99m==RH$XQ59NERneI z6=bnk=7v7q-`}TFDfSY1cXx;UKp^m|0K@HK#3<&T-!t;*=}9CKVJK#^ z897iUlR*jE9gW=X?k?UIHet8hsj(PKOaQma<#Hh{9*;Mh&6Cp;3?TX4ZrAO0)1S;w zBsPM35-fx@^dX&2C_Nzn diff --git a/tests/firefox/drag_and_drop/images/win/jpg_file.png b/tests/firefox/drag_and_drop/images/win/jpg_file.png index 03b868fb55fa293497f72002676921dcd37c70d5..00490e3dd6e9d61ee35a5791c6f6fdbc84c238b1 100644 GIT binary patch literal 916 zcmeAS@N?(olHy`uVBq!ia0vp^CLlHk8<2d)>)QvU7>k44ofy`glX(ebM`ngZltlRY zSS9D@>LsS+C#C9DVstT4fPE4;bsH1+JHo@{EISEfi{E8w==W>t3(ll+GC>+ zvK+}V5TAlYfnK%aveAbJn;nBfb}*_J=(Oxkx$k{wz8=rx9lbLZRVpjrSMT>!*crO9H3+46B9I9SZcj}FKoO1_v@31`7Uk| z45gbwKD|p7TX^hY=|Sn)W?in*RVIo~m!h^$I)x|yw z#q0y}|7;~I8_o!S=xqL}a`yC#3tA7CMa`RH*_30?+&w36?uK#Vopvt^lV|15rgvLJlR`GdcrJz1{&X`0=owoz0&3hj|yG>3v4K|c8!BQGXYvL|_$WV7J8L!ZXhe(5 zjqv#8jjLvg+^Q2_xsqKkLH>2;l-CJr?(f75l_F{seuUr1ZCSRVV_DYiEdH6_3?5c@ zbOo|;tjIrRtRGoA)2ycJ=l@+ZBdnfw$*1_{2$!hVoS-(&y)002ovPDHLkV1hS3k_!L; diff --git a/tests/firefox/drag_and_drop/images/win/pdf_file.png b/tests/firefox/drag_and_drop/images/win/pdf_file.png index 852e4e2d00f7213253e497774a773772f09fb4e6..e45509006e6c9635f58b42709312c7f3e6c0954d 100644 GIT binary patch literal 704 zcmeAS@N?(olHy`uVBq!ia0vp^A|N&g8<1QX;1>s^7>k44ofy`glX(ebM`ngZltlRY zSS9D@>LsS+C#C9DVstT4fPE4;bsH1+JHo@{EISEfi{E8w==W>t3(ll+GC>+ zvK+}V5TAlYfnK%aveAbJn;n=`i;ZZl9@I zYpr*-9GmN1p6QagYs))c{f@W?g^a&WKWz~?I=SLW;-lGu#Yv^BZ`*P{I>7umQ}TL4 zug1k&0j4<$Ee#sCJvL7;xK?=RNhteO;TN0x4%l&siuL*0C9 zj>Y|#ciy^s<%NR_PS(#=f91)@vNE$sc$SH$$EDB5l6A8CJiX-}n0}jEeW$iLh4XKq za`E?c)3Q?!jCQ_ro3r#-*;DD$uVjCGO1bmlLXwSo_M`*_6N`C=qBp3^^d4IMTC3VE zQECtWyu;h7zv;>b78OSRHlJ#)@r!xSDN(+?PT@Zj*M2MuH~JIsZ`SYR&zs(~wP$*M dztApR$9Q$sap@b<7yUqK&C}J-Wt~$(696)N1+f4C literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^njkg@6Oi0(f1wdbE%tPA45^5FI{CCBW z?O7RZNmKsFbU1Q~^S|RX`^*t(D05#k<8Xkd;xnz&YB$%OJh1Y?E8YyPU4NEozI*#t zTGI3=bF`{^$71bkr%#>;i2Huxd*LfxHU=wsnHq)$ diff --git a/tests/firefox/drag_and_drop/images/win/png_file.png b/tests/firefox/drag_and_drop/images/win/png_file.png index 90f88efc37853bf74435101fcbd8301fde51f9cd..9795b572ff8159e1ddb2c66dbbce9d63345767ba 100644 GIT binary patch literal 869 zcmeAS@N?(olHy`uVBq!ia0vp^HbBh9!3HE>+_yahq!^2X+?^QKos)S9WJhL(M3hAM z`dB6B=jtV<VstT4fPE4;bsH1+JHo@{EISEfi{E8w==W>t3(ll+GC>+ zvK+}V5TAlYfnK%aveAbJn;nYaSZX`eHv<5)NCLS^Hf*SwN1Q3{6^@i zE$z(LOfGR|>RBH9>TKVoUU!~%dxE{7`@JUyeHvU_P722R_4rTX?XErC`Ki34 z{l1}@(X^I;UO&&dm$thm-+wUi%!O%vYmYy7|MQ;z_#V^g3~#lx{Mx0N- zm6kw|bO$O#-pIzRrL8QpJiV@1>T6}=Rd}7(;e`c;T9;l3$B3jJhZjm0b{gxFNnhV0 zv@N~P<>p26dLUAtl=!MM#K++$g&`)N?S_{6?b-?E+`P_*;nC`?gvIvo+Ddho`i(Zj z>zvn~pIWDt1Tp93vDhA7b9Q4V{mvf4`0+UBn~#x~OAdJ{QAL2=AKt8BhbFD7`K`VX z0r)d5JkG~&eiwJ!_zP_5d!2tdJkAkCa-NJwySotmdw84!uZAD@@7H*%?{)qG8fscT T=SVsY00000NkvXXu0mjfu^p5C diff --git a/tests/firefox/drag_and_drop/images/win/private_window_logo.png b/tests/firefox/drag_and_drop/images/win/private_window_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..cd59fc6e470bb49660eca899062136cac8eb2f7e GIT binary patch literal 499 zcmV?ZwXB#jYI`Oq_9NwmL<)XW!ep8tmE?ir1P5_wMUa$c`+a z@9vjbS`!tq7_|AjOwxoYG+gf+s`HK*=h0`ZaRdbuCr9Wm)6&gpQ9wcc#u|g^x!lvk zOQ}@in_oST4s0MOUrqqPBzsyw;kPAur&Pla7(EhD&_9*p`SI1;r|8kaP4x~6CQgo2 z3QtQ+KtcaU8v>Wd*MNvT<;(F^DYPblQDeX@q#%*;=FrCEp*H6H+6AKZ008C}CPIa# zEHXhJMG6GWYeYWQ6hu%kadHG;+9FeX0R{7`3}yQ|cfgUqv zc(hg=878O7Xjv1oGowG?dpax}Mf3-}Jm$_Up?s9~&002ovPDHLkV1lvh>ns2O literal 0 HcmV?d00001 diff --git a/tests/firefox/drag_and_drop/images/win/txt_file.png b/tests/firefox/drag_and_drop/images/win/txt_file.png index 8fcd14ade472f6fc9a48d40f304dd68a85c896a8..5cc4fd4efbef3ce1218a8826c56f41accbeee909 100644 GIT binary patch literal 719 zcmeAS@N?(olHy`uVBq!ia0vp^DnQJ|!3HGnEc8? ztx|+mh4pF`@Az(7{` z>f0o8uxa@JO71jb^a=Qwv8#KdGjpzo_7amIE$fZ7=YED2aOTz*#qh$)LuC0O- zy1pEjV?VmT@u84i#}9?r)Z`qXvKzkBa8r)8C|o0${Y#`W}E zORKr`{g~XFh5I%YzuJ6h`_ef*m#-E}xHL|z>|Dbc9kb=3)HdEz$Ghi#`Mt3=`c#QT z&cD7jxdD$Glcyii%*zerj zpOh|r_kPlEt^^ioujvtsk7TxVeko{AG`#A|61-UAk5^iwyM=1jKH;}J{&$N$3U4_a t<1fwZTUpK=SS}$m-@|$1lk+qGGp+a(dHTXr_B>G1^K|udS?83{1OQq>3PJz? literal 277 zcmV+w0qXvVP)>ua=9&G^obk~Z6QZuqUCc1Z b;-BLUY0tFNGdVoI00000NkvXXu0mjfj3aaS diff --git a/tests/firefox/drag_and_drop/images/win7/drop_here.png b/tests/firefox/drag_and_drop/images/win7/drop_here.png index 22702f03598b43fb4cf5c07def83e61cefa6fedc..c00b6dc7bcb22d687d48e03a10a1583310808e79 100644 GIT binary patch literal 233 zcmVL2nE^5i5!S+7{+~C#0Ei0YTLx5eCZ2tA|f0c4fetcCQwUQs_Hbz^btb2C4s)Z zK+a{JW(t(IP|N6ztwW53^@&*#C5L?Xz)y1If-F$CDg#s=Nm3#3dY!(#4dwOTnO zY8j2jPYd~cKKPYN1%4YAPUrBuAb^99m==RH$XQ59NERneI z6=bnk=7v7q-`}TFDfSY1cXx;UKp^m|0K@HK#3<&T-!t;*=}9CKVJK#^ z897iUlR*jE9gW=X?k?UIHet8hsj(PKOaQma<#Hh{9*;Mh&6Cp;3?TX4ZrAO0)1S;w zBsPM35-fx@^dX&2C_Nzn diff --git a/tests/firefox/drag_and_drop/images/win7/private_window_logo.png b/tests/firefox/drag_and_drop/images/win7/private_window_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..cd59fc6e470bb49660eca899062136cac8eb2f7e GIT binary patch literal 499 zcmV?ZwXB#jYI`Oq_9NwmL<)XW!ep8tmE?ir1P5_wMUa$c`+a z@9vjbS`!tq7_|AjOwxoYG+gf+s`HK*=h0`ZaRdbuCr9Wm)6&gpQ9wcc#u|g^x!lvk zOQ}@in_oST4s0MOUrqqPBzsyw;kPAur&Pla7(EhD&_9*p`SI1;r|8kaP4x~6CQgo2 z3QtQ+KtcaU8v>Wd*MNvT<;(F^DYPblQDeX@q#%*;=FrCEp*H6H+6AKZ008C}CPIa# zEHXhJMG6GWYeYWQ6hu%kadHG;+9FeX0R{7`3}yQ|cfgUqv zc(hg=878O7Xjv1oGowG?dpax}Mf3-}Jm$_Up?s9~&002ovPDHLkV1lvh>ns2O literal 0 HcmV?d00001 diff --git a/tests/firefox/drag_and_drop/paste_image_data.py b/tests/firefox/drag_and_drop/paste_image_data.py index 349f452b..0d76a281 100644 --- a/tests/firefox/drag_and_drop/paste_image_data.py +++ b/tests/firefox/drag_and_drop/paste_image_data.py @@ -23,7 +23,7 @@ class Test(FirefoxTest): copy_image_context_menu_pattern = Pattern('copy_image_option.png') navigate('https://mystor.github.io/dragndrop/') - test_page_opened = exists(paste_image_data_radiobutton_pattern, DEFAULT_SITE_LOAD_TIMEOUT) + test_page_opened = exists(paste_image_data_radiobutton_pattern, Settings.site_load_timeout) assert test_page_opened, 'Firefox started and page loaded successfully.' click(paste_image_data_radiobutton_pattern) @@ -32,7 +32,7 @@ class Test(FirefoxTest): 'it has been selected.' new_tab() - select_tab(2) + select_tab('2') navigate(LocalWeb.POCKET_TEST_SITE) two_images_displayed_on_the_page = exists(first_picture_pattern) and exists(second_picture_pattern) assert two_images_displayed_on_the_page, 'Web page successfully loads.' @@ -43,20 +43,20 @@ class Test(FirefoxTest): 'clicking at the first image' click(copy_image_context_menu_pattern) - select_tab(1) + select_tab('1') edit_paste() matching_message_appears = scroll_until_pattern_found(matching_message_pattern, type, (Key.PAGE_DOWN,)) assert matching_message_appears, '"Matching" appears under the "Drop Stuff Here" area, the expected ' \ 'result is identical to the result.' - select_tab(2) + select_tab('2') right_click(second_picture_pattern) copy_image_option_available = exists(copy_image_context_menu_pattern) assert copy_image_option_available, '"Copy Image" option is available in the context menu after right ' \ 'clicking at the second image' click(copy_image_context_menu_pattern) - select_tab(1) + select_tab('1') edit_paste() matching_message_appears = exists(matching_message_pattern) assert matching_message_appears, '"Matching" appears under the "Drop Stuff Here" area, the expected result ' \ diff --git a/tests/firefox/drag_and_drop/paste_jpeg_file.py b/tests/firefox/drag_and_drop/paste_jpeg_file.py index 9a47f3d4..12550d60 100644 --- a/tests/firefox/drag_and_drop/paste_jpeg_file.py +++ b/tests/firefox/drag_and_drop/paste_jpeg_file.py @@ -51,7 +51,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) + select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -64,7 +64,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected' \ 'result is identical to result. ' - # select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) + select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_pdf_file.py b/tests/firefox/drag_and_drop/paste_pdf_file.py index 3476033a..8181581a 100644 --- a/tests/firefox/drag_and_drop/paste_pdf_file.py +++ b/tests/firefox/drag_and_drop/paste_pdf_file.py @@ -51,7 +51,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) + select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -64,7 +64,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected' \ 'result is identical to result. ' - # select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) + select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_pdf_file_in_private_window.py b/tests/firefox/drag_and_drop/paste_pdf_file_in_private_window.py index 18e0df0a..0efafadd 100644 --- a/tests/firefox/drag_and_drop/paste_pdf_file_in_private_window.py +++ b/tests/firefox/drag_and_drop/paste_pdf_file_in_private_window.py @@ -55,7 +55,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) + select_file_in_folder(folderpath, pdf_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -68,7 +68,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected' \ 'result is identical to result. ' - # select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) + select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_png_file.py b/tests/firefox/drag_and_drop/paste_png_file.py index fdb7ae1c..34a95104 100644 --- a/tests/firefox/drag_and_drop/paste_png_file.py +++ b/tests/firefox/drag_and_drop/paste_png_file.py @@ -51,7 +51,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, png_file_pattern, edit_copy) + select_file_in_folder(folderpath, png_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -64,7 +64,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected '\ 'result is identical to result. ' - # select_file_in_folder(folderpath, txt_file_pattern, edit_copy) + select_file_in_folder(folderpath, txt_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_png_file_in_private_window.py b/tests/firefox/drag_and_drop/paste_png_file_in_private_window.py index 149b5c99..c18de0a2 100644 --- a/tests/firefox/drag_and_drop/paste_png_file_in_private_window.py +++ b/tests/firefox/drag_and_drop/paste_png_file_in_private_window.py @@ -55,7 +55,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, png_file_pattern, edit_copy) + select_file_in_folder(folderpath, png_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -68,7 +68,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected '\ 'result is identical to result. ' - # select_file_in_folder(folderpath, txt_file_pattern, edit_copy) + select_file_in_folder(folderpath, txt_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_txt_file.py b/tests/firefox/drag_and_drop/paste_txt_file.py index 83bf3c29..f5138880 100644 --- a/tests/firefox/drag_and_drop/paste_txt_file.py +++ b/tests/firefox/drag_and_drop/paste_txt_file.py @@ -50,7 +50,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, txt_file_pattern, edit_copy) + select_file_in_folder(folderpath, txt_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -63,7 +63,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected'\ 'result is identical to result. ' - # select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) + select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' diff --git a/tests/firefox/drag_and_drop/paste_txt_file_in_private_window.py b/tests/firefox/drag_and_drop/paste_txt_file_in_private_window.py index 68ec6dd4..2d78fa6f 100644 --- a/tests/firefox/drag_and_drop/paste_txt_file_in_private_window.py +++ b/tests/firefox/drag_and_drop/paste_txt_file_in_private_window.py @@ -54,7 +54,7 @@ class Test(FirefoxTest): matching_region = Region(not_matching_message_location.x, not_matching_message_location.y, width=matching_message_width + 10, height=matching_message_height * 2) - # select_file_in_folder(folderpath, txt_file_pattern, edit_copy) + select_file_in_folder(folderpath, txt_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available' @@ -67,7 +67,7 @@ class Test(FirefoxTest): assert matching_message_displayed, 'Matching appears under the "Drop Stuff Here" area and expected'\ 'result is identical to result. ' - # select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) + select_file_in_folder(folderpath, jpg_file_pattern, edit_copy) drop_here_available = exists(drop_here_pattern) assert drop_here_available, '"Drop here" pattern available'