def select_throttling(option):
    open_web_console()

    try:
        wait(Pattern('network.png'), 10)
        click(Pattern('network.png'))
    except FindError:
        raise APIHelperError('Can\'t find the network menu in the page, aborting test.')

    try:
        wait(Pattern('no_throttling.png'), 10)
        click(Pattern('no_throttling.png'))
    except FindError:
        raise APIHelperError('Can\'t find the throttling menu in the page, aborting test.')

    for i in range(option + 1):
        type(Key.DOWN)
    type(Key.ENTER)
示例#2
0
def _get_pattern_click_location(ps: Pattern, region: Rectangle = None, align: Alignment = None):
    """Returns the click location based on the pattern/string found location and alignment."""
    if align is None:
        align = Alignment.CENTER

    width, height = ps.get_size()
    find_location = image_find(ps, region=region)

    if find_location is None:
        raise FindError('Unable to click on: %s' % ps.get_file_path())

    if ps.get_target_offset():
        target_offset = ps.get_target_offset()
        find_location.x += target_offset.x
        find_location.y += target_offset.y

    rect = Rectangle(find_location.x, find_location.y, width, height)
    return rect.apply_alignment(align)
示例#3
0
def click_cancel_button():
    """Click cancel button."""
    cancel_button_pattern = Pattern('cancel_button.png')
    try:
        wait(cancel_button_pattern, 10)
        logger.debug('Cancel button found.')
        click(cancel_button_pattern)
    except FindError:
        raise APIHelperError('Can\'t find the cancel button, aborting.')
示例#4
0
class FindToolbar(object):
    FIND_CLOSEBUTTON = Pattern('find_closebutton.png')
    FINDBAR_TEXTBOX = Pattern('findbar_textbox.png')
    FIND_PREVIOUS = Pattern('find_previous.png')
    FIND_NEXT = Pattern('find_next.png')
    HIGHLIGHT = Pattern('highlight.png')
    FIND_CASE_SENSITIVE = Pattern('find_case_sensitive.png')
    FIND_ENTIRE_WORD = Pattern('find_entire_word.png')
示例#5
0
 class ShowColumns(object):
     NAME = Pattern('menucol_placesContentTitle.png')
     TAGS = Pattern('menucol_placesContentTags.png')
     LOCATION = Pattern('menucol_placesContentUrl.png')
     MOST_RECENT_VISIT = Pattern('menucol_placesContentDate.png')
     VISIT_COUNT = Pattern('menucol_placesContentVisitCount.png')
     ADDED = Pattern('menucol_placesContentDateAdded.png')
     LAST_MODIFIED = Pattern('menucol_placesContentLastModified.png')
示例#6
0
def close_customize_page():
    """Close the 'Customize...' page by pressing the 'Done' button."""
    customize_done_button_pattern = Pattern('customize_done_button.png')
    try:
        wait(customize_done_button_pattern, 10)
        logger.debug('Done button found.')
        click(customize_done_button_pattern)
    except FindError:
        raise APIHelperError(
            'Can\'t find the Done button in the page, aborting.')
示例#7
0
    class Themes(object):
        DARK_THEME = Pattern('dark_theme.png')
        LIGHT_THEME = Pattern('light_theme.png')
        DEFAULT_THEME = Pattern('default_theme.png')

        ENABLE_BUTTON = Pattern('enable_button.png')
        DISABLE_BUTTON = Pattern('disable_button.png')
        IRIS_TAB_LIGHT_OR_DEFAULT_THEME = Pattern('iris_tab_light_theme.png').similar(0.75)
        IRIS_TAB_DARK_THEME = Pattern('iris_tab_dark_theme.png').similar(0.75)
示例#8
0
 class DownloadsContextMenu(object):
     OPEN_CONTAINING_FOLDER = Pattern(
         'downloads_open_containing_folder.png')
     CLEAR_PREVIEW_PANEL = Pattern('downloads_clear_preview_panel.png')
     COPY_DOWNLOAD_LINK = Pattern('downloads_copy_download_link.png')
     GO_TO_DOWNLOAD_PAGE = Pattern('downloads_go_to_download_page.png')
     REMOVE_FROM_HISTORY = Pattern('downloads_remove_from_history.png')
     PAUSE = Pattern('downloads_pause.png')
     RESUME = Pattern('downloads_resume.png')
示例#9
0
class Utils(object):
    # Checkbox.
    CHECKEDBOX = Pattern('checked_box.png')
    UNCHECKEDBOX = Pattern('unchecked_box.png')

    # Back Arrow.
    LIBRARY_BACK_BUTTON = Pattern('subview_button_back.png')

    TOP_SITES = Pattern('top_sites.png')

    SAVE_BUTTON_GOOGLE = Pattern('save_button_google.png')

    # Folder view.
    NEW_FOLDER = Pattern('new_folder.png')
    NEW_FOLDER_HIGHLIGHTED = Pattern('new_folder_highlighted.png')
    SELECT_FOLDER = Pattern('select_folder.png')
    NEW_DOWNLOADS_FOLDER_HIGHLIGHTED = Pattern('new_downloads_folder_highlighted.png')
示例#10
0
class MainWindow(object):
    if OSHelper.is_mac():
        MAIN_WINDOW_CONTROLS = Pattern('main_window_controls.png')
        UNHOVERED_MAIN_RED_CONTROL = Pattern('unhovered_main_red_control.png')
        HOVERED_MAIN_RED_CONTROL = Pattern('hovered_red_main_control.png')
    else:
        CLOSE_BUTTON = Pattern('main_close_control.png')
        MINIMIZE_BUTTON = Pattern('main_minimize_control.png')
        MAXIMIZE_BUTTON = Pattern('main_maximize_control.png')
        RESIZE_BUTTON = Pattern('main_resize_control.png')
示例#11
0
def confirm_firefox_launch(image=None):
    """Waits for firefox to exist by waiting for the iris logo to be present.
    :param image: Pattern to confirm Firefox launch
    :return: None.
    """
    if image is None:
        image = Pattern('iris_logo.png')

    try:
        wait(image, 60)
    except Exception:
        raise APIHelperError('Can\'t launch Firefox - aborting test run.')
示例#12
0
 class DownloadsPanel(object):
     DOWNLOADS_BUTTON = Pattern('downloads_button_open.png')
     DOWNLOAD_RETRY = Pattern('downloadRetry.png')
     DOWNLOAD_RETRY_HIGHLIGHTED = Pattern('downloadRetry_highlighted.png')
     DOWNLOAD_CANCEL = Pattern('downloadCancel.png')
     DOWNLOAD_CANCEL_HIGHLIGHTED = Pattern('downloadCancel_highlighted.png')
     NO_DOWNLOADS_FOR_THIS_SESSION = Pattern('emptyDownloads.png')
示例#13
0
def restore_window_from_taskbar(option=None):
    """Restore firefox from task bar."""
    if OSHelper.is_mac():
        try:
            click(Pattern('main_menu_window.png'))
            if option == "browser_console":
                click(Pattern('window_browser_console.png'))
            else:
                click(Pattern('window_firefox.png'))
        except FindError:
            raise APIHelperError('Restore window from taskbar unsuccessful.')
    elif OSHelper.get_os_version() == 'win7':
        try:
            click(Pattern('firefox_start_bar.png'))
            if option == "library_menu":
                click(Pattern('firefox_start_bar_library.png'))
            if option == "browser_console":
                click(Pattern('firefox_start_bar_browser_console.png'))
        except FindError:
            raise APIHelperError('Restore window from taskbar unsuccessful.')

    else:
        type(text=Key.TAB, modifier=KeyModifier.ALT)
        if OSHelper.is_linux():
            Mouse().move(Location(0, 50))
    time.sleep(Settings.DEFAULT_UI_DELAY)
示例#14
0
def get_telemetry_info():
    """Returns telemetry information as a JSON object from 'about:telemetry'
    page.
    """

    copy_raw_data_to_clipboard_pattern = Pattern(
        'copy_raw_data_to_clipboard.png')
    raw_json_pattern = Pattern('raw_json.png')
    raw_data_pattern = Pattern('raw_data.png')

    new_tab()

    paste('about:telemetry')
    type(Key.ENTER)

    try:
        wait(raw_json_pattern, 10)
        logger.debug('\'RAW JSON\' button is present on the page.')
        click(raw_json_pattern)
    except (FindError, ValueError):
        raise APIHelperError('\'RAW JSON\' button not present in the page.')

    try:
        wait(raw_data_pattern, 10)
        logger.debug('\'Raw Data\' button is present on the page.')
        click(raw_data_pattern)
    except (FindError, ValueError):
        close_tab()
        raise APIHelperError('\'Raw Data\' button not present in the page.')

    try:
        click(copy_raw_data_to_clipboard_pattern)
        time.sleep(Settings.DEFAULT_UI_DELAY)
        json_text = get_clipboard()
        return json.loads(json_text)
    except Exception:
        raise APIHelperError(
            'Failed to retrieve raw message information value.')
    finally:
        close_tab()
示例#15
0
class AuxiliaryWindow(object):
    if OSHelper.is_mac():
        AUXILIARY_WINDOW_CONTROLS = Pattern(
            'auxiliary_window_controls.png')
        RED_BUTTON_PATTERN = Pattern('unhovered_red_control.png').similar(0.9)
        HOVERED_RED_BUTTON = Pattern('hovered_red_button.png')
    else:
        CLOSE_BUTTON = Pattern('auxiliary_window_close_button.png')
        MAXIMIZE_BUTTON = Pattern('auxiliary_window_maximize.png')
        ZOOM_RESTORE_BUTTON = Pattern('minimize_full_screen_auxiliary_window.png')
        MINIMIZE_BUTTON = Pattern('auxiliary_window_minimize.png')
示例#16
0
def confirm_close_multiple_tabs():
    """Click confirm 'Close all tabs' for warning popup when multiple tabs are
    opened.
    """
    close_all_tabs_button_pattern = Pattern('close_all_tabs_button.png')

    try:
        wait(close_all_tabs_button_pattern, 5)
        logger.debug('"Close all tabs" warning popup found.')
        type(Key.ENTER)
    except FindError:
        logger.debug('Couldn\'t find the "Close all tabs" warning popup.')
        pass
示例#17
0
def open_zoom_menu():
    """Open the 'Zoom' menu from the 'View' menu."""

    if OSHelper.is_mac():
        view_menu_pattern = Pattern('view_menu.png')

        click(view_menu_pattern)

        repeat_key_down(3)
        type(text=Key.ENTER)
    else:
        type(text='v', modifier=KeyModifier.ALT)

        repeat_key_down(2)
        type(text=Key.ENTER)
示例#18
0
def match_template(pattern: Pattern,
                   region: Rectangle = None,
                   match_type: MatchTemplateType = MatchTemplateType.SINGLE):
    """Find a pattern in a Region or full screen

    :param Pattern pattern: Image details
    :param Region region: Region object.
    :param MatchTemplateType match_type: Type of match_template (single or multiple)
    :return: Location.
    """
    if region is None:
        region = DisplayCollection[0].bounds

    locations_list = []
    save_img_location_list = []
    if not isinstance(match_type, MatchTemplateType):
        logger.warning('%s should be an instance of `%s`' %
                       (match_type, MatchTemplateType))
        return []
    try:
        stack_image = ScreenshotImage(
            region=region, screen_id=_region_in_display_list(region))
        precision = pattern.similarity

        res = cv2.matchTemplate(stack_image.get_gray_array(),
                                pattern.get_gray_array(), FIND_METHOD)
        if match_type is MatchTemplateType.SINGLE:
            min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
            if max_val >= precision:
                locations_list.append(
                    Location(max_loc[0] + region.x, max_loc[1] + region.y))
                save_img_location_list.append(Location(max_loc[0], max_loc[1]))
        elif match_type is MatchTemplateType.MULTIPLE:
            loc = np.where(res >= precision)
            for pt in zip(*loc[::-1]):
                save_img_location = Location(pt[0], pt[1])
                location = Location(pt[0] + region.x, pt[1] + region.y)
                save_img_location_list.append(save_img_location)
                locations_list.append(location)

        save_debug_image(pattern, stack_image, save_img_location_list)

    except ScreenshotError:
        logger.warning('Screenshot failed.')
        return []

    return locations_list
示例#19
0
def change_preference(pref_name, value):
    """Change the value for a specific preference.

    :param pref_name: Preference to be changed.
    :param value: Preference's value after the change.
    :return: None.
    """
    try:
        new_tab()
        navigate('about:config')
        time.sleep(Settings.DEFAULT_UI_DELAY)

        type(Key.SPACE)
        time.sleep(Settings.DEFAULT_UI_DELAY)

        type(Key.ENTER)
        time.sleep(Settings.DEFAULT_UI_DELAY)

        paste(pref_name)
        time.sleep(Settings.DEFAULT_UI_DELAY)
        type(Key.TAB)
        time.sleep(Settings.DEFAULT_UI_DELAY)
        type(Key.TAB)
        time.sleep(Settings.DEFAULT_UI_DELAY)

        try:
            retrieved_value = copy_to_clipboard()
        except Exception:
            raise APIHelperError('Failed to retrieve preference value.')

        if retrieved_value == value:
            logger.debug('Flag is already set to value:' + value)
            return None
        else:
            type(Key.ENTER)
            dialog_box_pattern = Pattern('preference_dialog_icon.png')
            try:
                wait(dialog_box_pattern, 3)
                paste(value)
                type(Key.ENTER)
            except FindError:
                pass

        close_tab()
    except Exception:
        raise APIHelperError('Could not set value: %s to preference: %s' %
                             (value, pref_name))
示例#20
0
class LibraryMenu(object):
    BOOKMARKS_OPTION = Pattern('library_menu_bookmarks_option.png')

    class BookmarksOption(object):
        BOOKMARKING_TOOLS = Pattern('bookmarking_tools.png')
        SEARCH_BOOKMARKS = Pattern('search_bookmarks.png')

        class BookmarkingTools(object):
            VIEW_BOOKMARKS_TOOLBAR = Pattern('view_bookmarks_toolbar.png')
            VIEW_BOOKMARKS_SIDEBAR = Pattern('view_bookmarks_sidebar.png')

    class HistoryOption(object):
        VIEW_HISTORY_SIDEBAR = Pattern('view_history_sidebar.png')
        CLEAR_RECENT_HISTORY = Pattern('clear_recent_history.png')
        RECENTLY_CLOSED_TABS = Pattern('recently_closed_tabs.png')
        RECENTLY_CLOSED_WINDOWS = Pattern('recently_closed_windows.png')
        SHOW_ALL_HISTORY = Pattern('show_all_history.png')
示例#21
0
class DownloadManager(object):
    SHOW_ALL_DOWNLOADS = Pattern('downloadsHistory_show_all_Downloads.png')

    class DownloadsPanel(object):
        DOWNLOADS_BUTTON = Pattern('downloads_button_open.png')
        DOWNLOAD_RETRY = Pattern('downloadRetry.png')
        DOWNLOAD_RETRY_HIGHLIGHTED = Pattern('downloadRetry_highlighted.png')
        DOWNLOAD_CANCEL = Pattern('downloadCancel.png')
        DOWNLOAD_CANCEL_HIGHLIGHTED = Pattern('downloadCancel_highlighted.png')
        NO_DOWNLOADS_FOR_THIS_SESSION = Pattern('emptyDownloads.png')

    class Downloads(object):
        SHOW_DOWNLOADS_FOLDER = Pattern(
            'appMenu-library-downloads-show-button_show_downloads_folder.png')
        PANEL_HEADER_DOWNLOADS = Pattern('panel_header_downloads.png')

    class PrivateDownloadManager(object):
        NO_DOWNLOADS = Pattern('there_are_no_downloads.png')
示例#22
0
文件: finder.py 项目: leshibily/iris2
def wait_vanish(pattern: Pattern,
                timeout: float = None,
                region: Rectangle = None) -> bool or FindError:
    """Wait until a Pattern disappears.

    :param pattern: Pattern.
    :param timeout:  Number as maximum waiting time in seconds.
    :param region: Rectangle object in order to minimize the area.
    :return: True if vanished.
    """

    if timeout is None:
        timeout = Settings.auto_wait_timeout

    image_found = image_vanish(pattern, timeout, region)

    if image_found is not None:
        return True
    else:
        raise FindError('%s did not vanish' % pattern.get_filename())
示例#23
0
def get_support_info():
    """Returns support information as a JSON object from 'about:support' page."""
    copy_raw_data_to_clipboard = Pattern(
        'about_support_copy_raw_data_button.png')

    new_tab()
    select_location_bar()
    paste('about:support')
    type(Key.ENTER)
    time.sleep(Settings.DEFAULT_UI_DELAY)

    try:
        click(copy_raw_data_to_clipboard)
        time.sleep(Settings.DEFAULT_UI_DELAY_LONG)
        json_text = get_clipboard()
        return json.loads(json_text)
    except Exception as e:
        raise APIHelperError(
            'Failed to retrieve support information value.\n{}'.format(e))
    finally:
        close_tab()
示例#24
0
    class Privacy:
        CONTENT_TRACKING_TRACKERS_CHECKBOX_SELECTED = \
            Pattern('content_blocking_tracking_protection_checkbox_selected.png')
        CONTENT_TRACKING_TRACKERS_CHECKBOX_NOT_SELECTED = \
            Pattern('content_blocking_tracking_protection_checkbox_not_selected.png')
        CONTENT_TRACKING_TRACKERS_ALWAYS_RADIO_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_always_radio_selected.png')
        CONTENT_TRACKING_TRACKERS_ALWAYS_RADIO_NOT_SELECTED \
            = Pattern('content_blocking_tracking_protection_option_always_radio_not_selected.png')
        CONTENT_TRACKING_TRACKERS_ONLY_PRIVATE_WINDOWS_RADIO_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_private_radio_selected.png')
        CONTENT_TRACKING_TRACKERS_ONLY_PRIVATE_WINDOWS_RADIO_NOT_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_private_radio_not_selected.png')

        TRACKING_PROTECTION_EXCEPTIONS_BUTTON = Pattern(
            'tracking_protection_exceptions_button.png')

        class Exceptions:
            EXCEPTIONS_CONTENT_BLOCKING_LABEL = Pattern(
                'exceptions_content_blocking_label.png')
            REMOVE_WEBSITE_BUTTON = Pattern(
                'remove_website_permission_button.png')
            SAVE_CHANGES_BUTTON = Pattern(
                'save_changes_btn_apply_changes_button.png')
示例#25
0
    class HistorySidebar(object):
        SIDEBAR_HISTORY_TITLE = Pattern('sidebar_history_title.png')
        SIDEBAR_HISTORY_ICON = Pattern('sidebar_history_icon.png')
        EXPLORED_HISTORY_ICON = Pattern('explored_history_icon.png')
        VIEW_BUTTON = Pattern('view_button.png')
        SEARCH_BOX = Pattern('history_search_box.png')
        SEARCH_BOX_FOCUSED = Pattern('history_search_box_focused.png')

        class ViewBy(object):
            VIEW_BY_SITE = Pattern('by_site.png')
            VIEW_BY_LAST_VISITED = Pattern('by_last_visited.png')
            VIEW_BY_DATE_AND_SITE = Pattern('by_date_and_site.png')
            VIEW_BY_DATE = Pattern('by_date.png')
            VIEW_BY_MOST_VISITED = Pattern('by_most_visited.png')

            # Checked view menu items
            VIEW_BY_SITE_CHECKED = Pattern('by_site_checked.png')
            VIEW_BY_LAST_VISITED_CHECKED = Pattern(
                'by_last_visited_checked.png')
            VIEW_BY_DATE_AND_SITE_CHECKED = Pattern(
                'by_date_and_site_checked.png')
            VIEW_BY_DATE_CHECKED = Pattern('by_date_checked.png')
            VIEW_BY_MOST_VISITED_CHECKED = Pattern(
                'by_most_visited_checked.png')

        class Timeline(object):
            TODAY = Pattern('history_today.png')
            YESTERDAY = Pattern('history_yesterday.png')
            LAST_7_DAYS = Pattern('history_last_7_days.png')
            JANUARY = Pattern('history_january.png')
            FEBRUARY = Pattern('history_february.png')
            MARCH = Pattern('history_march.png')
            APRIL = Pattern('history_april.png')
            MAY = Pattern('history_may.png')
            JUNE = Pattern('history_june.png')
            JULY = Pattern('history_july.png')
            AUGUST = Pattern('history_august.png')
            SEPTEMBER = Pattern('history_september.png')
            OCTOBER = Pattern('history_october.png')
            NOVEMBER = Pattern('history_november.png')
            DECEMBER = Pattern('history_december.png')
示例#26
0
class AboutPreferences:
    PRIVACY_AND_SECURITY_BUTTON_SELECTED = Pattern(
        'category_privacy_button_selected.png')
    PRIVACY_AND_SECURITY_BUTTON_NOT_SELECTED = Pattern(
        'category_privacy_button_not_selected.png')
    BROWSE = Pattern('browse_option.png')
    ABOUT_PREFERENCE_SEARCH_PAGE_PATTERN = Pattern(
        'about_preferences_search_page.png')
    DOWNLOADS = Pattern('downloads_about_preference.png')
    FIND_IN_OPTIONS = Pattern('find_in_options.png')
    DECEPTIVE_CONTENT_AND_DANGEROUS_SOFTWARE = Pattern(
        'deceptive_content_and_dangerous_software.png')
    BLOCK_DANGEROUS_AND_DECEPTIVE_CONTENT = Pattern(
        'block_dangerous_and_deceptive_content.png')
    BLOCK_DANGEROUS_DOWNLOADS = Pattern('block_dangerous_downloads.png')
    BLOCK_DANGEROUS_DOWNLOADS_GRAYED_OUT = Pattern(
        'block_dangerous_downloads_grayed_out.png')
    WARN_UNWANTED_UNCOMMON_SOFTWARE = Pattern(
        'warn_you_about_unwanted_and_uncommon_software.png')
    WARN_UNWANTED_UNCOMMON_SOFTWARE_GRAYED_OUT = Pattern(
        'warn_you_about_unwanted_and_uncommon_software_grayed_out.png')
    CHECKED_BOX = Pattern('about_preference_checked_box.png')
    UNCHECKED_BOX = Pattern('about_preference_unchecked_box.png')

    class Privacy:
        CONTENT_TRACKING_TRACKERS_CHECKBOX_SELECTED = \
            Pattern('content_blocking_tracking_protection_checkbox_selected.png')
        CONTENT_TRACKING_TRACKERS_CHECKBOX_NOT_SELECTED = \
            Pattern('content_blocking_tracking_protection_checkbox_not_selected.png')
        CONTENT_TRACKING_TRACKERS_ALWAYS_RADIO_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_always_radio_selected.png')
        CONTENT_TRACKING_TRACKERS_ALWAYS_RADIO_NOT_SELECTED \
            = Pattern('content_blocking_tracking_protection_option_always_radio_not_selected.png')
        CONTENT_TRACKING_TRACKERS_ONLY_PRIVATE_WINDOWS_RADIO_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_private_radio_selected.png')
        CONTENT_TRACKING_TRACKERS_ONLY_PRIVATE_WINDOWS_RADIO_NOT_SELECTED = \
            Pattern('content_blocking_tracking_protection_option_private_radio_not_selected.png')

        TRACKING_PROTECTION_EXCEPTIONS_BUTTON = Pattern(
            'tracking_protection_exceptions_button.png')

        class Exceptions:
            EXCEPTIONS_CONTENT_BLOCKING_LABEL = Pattern(
                'exceptions_content_blocking_label.png')
            REMOVE_WEBSITE_BUTTON = Pattern(
                'remove_website_permission_button.png')
            SAVE_CHANGES_BUTTON = Pattern(
                'save_changes_btn_apply_changes_button.png')
示例#27
0
 class PreferenceName(object):
     INTL_UIDIRECTION = Pattern('intl_uidirection.png')
class DownloadFiles(object):
    EXTRA_SMALL_FILE_5MB = Pattern('5MB.png')
    SMALL_FILE_10MB = Pattern('10MB.png').similar(0.85)
    SMALL_FILE_20MB = Pattern('20MB.png').similar(0.9)
    MEDIUM_FILE_50MB = Pattern('50MB.png')
    MEDIUM_FILE_100MB = Pattern('100MB.png')
    LARGE_FILE_200MB = Pattern('200MB.png')
    EXTRA_LARGE_FILE_512MB = Pattern('512MB.png')
    VERY_LARGE_FILE_1GB = Pattern('1GB.png')
    DOWNLOAD_TYPE_ICON = Pattern('download_Type_Icon.png').similar(0.7)
    DOWNLOAD_TYPE_ICON_ZIP = Pattern('download_type_zip_icon.png')
    DOWNLOAD_FILE_NAME_1GB = Pattern('download_name_1GB.png')
    DOWNLOAD_FILE_NAME_512MB = Pattern('download_name_512MB.png')
    DOWNLOAD_FILE_NAME_20MB = Pattern('download_name_20MB.png')
    DOWNLOAD_FILE_NAME_10MB = Pattern('download_name_10MB.png')
    DOWNLOAD_FILE_NAME_5MB = Pattern('download_name_5MB.png')
    LIBRARY_DOWNLOADS_5MB = Pattern('5MB_library_downloads.png')
    LIBRARY_DOWNLOADS_5MB_HIGHLIGHTED = Pattern('5MB_library_downloads_highlighted.png')
    LIBRARY_DOWNLOADS_10MB = Pattern('10MB_library_downloads.png')
    LIBRARY_DOWNLOADS_20MB = Pattern('20MB_library_downloads.png')
    LIBRARY_DOWNLOADS_50MB = Pattern('50MB_library_downloads.png')
    LIBRARY_DOWNLOADS_100MB = Pattern('100MB_library_downloads.png')
    LIBRARY_DOWNLOADS_200MB = Pattern('200MB_library_downloads.png')
    LIBRARY_DOWNLOADS_512MB = Pattern('512MB_library_downloads.png')
    TOTAL_DOWNLOAD_SIZE_1GB = Pattern('download_size_of_1GB.png')
    TOTAL_DOWNLOAD_SIZE_512MB = Pattern('download_size_of_512MB.png')
    TOTAL_DOWNLOAD_SIZE_200MB = Pattern('download_size_of_200MB.png')
    TOTAL_DOWNLOAD_SIZE_100MB = Pattern('download_size_of_100MB.png')
    TOTAL_DOWNLOAD_SIZE_50MB = Pattern('download_size_of_50MB.png')
    TOTAL_DOWNLOAD_SIZE_20MB = Pattern('download_size_of_20MB.png')
    DOWNLOADS_PANEL_5MB_COMPLETED = Pattern('completed_5mb_file.png')
    DOWNLOADS_PANEL_5MB_MISSING = Pattern('moved_missing_5mb_file.png')
    DOWNLOADS_PANEL_10MB_COMPLETED = Pattern('completed_10mb_file.png')
    DOWNLOADS_PANEL_10MB_MISSING = Pattern('moved_missing_10mb_file.png')
    DOWNLOADS_PANEL_20MB_MISSING = Pattern('moved_missing_20mb_file.png')
    DOWNLOADS_PANEL_FREETDS_PATCHED = Pattern('completed_freetds_patched.png')
    DOWNLOADS_PANEL_5MB_COMPLETED_RTL = Pattern('completed_5mb_file_rtl.png')
    DOWNLOADS_PANEL_10MB_COMPLETED_RTL = Pattern('completed_10mb_file_rtl.png')
    DOWNLOADS_PANEL_20MB_COMPLETED_RTL = Pattern('completed_20mb_file_rtl.png')
    FOLDER_VIEW_5MB_HIGHLIGHTED = Pattern('5MB_folder_view_highlighted.png').similar(0.79)
    FOLDER_VIEW_10MB_HIGHLIGHTED = Pattern('10MB_folder_view_highlighted.png').similar(0.79)
    FIREFOX_INSTALLER = Pattern('firefox_installer.png')
    FIREFOX_INSTALLER_HIGHLIGHTED = Pattern('firefox_installer_highlighted.png')
    STATUS_200 = Pattern('status_200.png')

    ABOUT = Pattern('about.png')
    SAVE_FILE = Pattern('save_file.png')
    DOWNLOAD_CANCELED = Pattern('download_canceled.png')
    OK = Pattern('ok.png')
    CANCEL_ALL_DOWNLOADS_POP_UP = Pattern('cancel_all_downloads.png')

    # Safe Browsing Testing patterns.
    MALICIOUS = Pattern('malicious.png')
    MALICIOUS_HTTPS = Pattern('malicious_https.png')
    DANGEROUS_HOST_WARNING = Pattern('dangerous_host_warning.png')
    UNCOMMON = Pattern('uncommon.png')
    UNCOMMON_HTTPS = Pattern('uncommon_https.png')
    POTENTIALLY_UNWANTED = Pattern('potentially_unwanted.png')
    DOWNLOADS_PANEL_CONTENT_COMPLETED = Pattern('completed_content.png')
    DOWNLOADS_PANEL_CONTENT1_COMPLETED = Pattern('completed_content1.png')
    DOWNLOADS_PANEL_BADREP_COMPLETED = Pattern('completed_badrep.png')
    DOWNLOADS_PANEL_PUA_COMPLETED = Pattern('completed_pua.png')
    DOWNLOADS_PANEL_UNKNOWN_COMPLETED = Pattern('completed_unknown.png')
    DOWNLOADS_PANEL_UNKNOWN1_COMPLETED = Pattern('completed_unknown1.png')
    LIBRARY_DOWNLOADS_CONTENT = Pattern('content_library_downloads.png')
    LIBRARY_DOWNLOADS_CONTENT_RED = Pattern('content_library_downloads_red.png')
    LIBRARY_DOWNLOADS_CONTENT1 = Pattern('content1_library_downloads.png')
    LIBRARY_DOWNLOADS_CONTENT1_RED = Pattern('content1_library_downloads_red.png')
    LIBRARY_DOWNLOADS_BADREP = Pattern('badrep_library_downloads.png')
    LIBRARY_DOWNLOADS_BADREP_RED = Pattern('badrep_library_downloads_red.png')
示例#29
0
class Docker:
    FIREFOX_DOCKER_ICON = Pattern('firefox_logo_dock.png')
    NEW_PRIVATE_WINDOW_MENU_ITEM = Pattern('new_private_window_menu_item.png')
    NEW_WINDOW_MENU_ITEM = Pattern('new_window_menu_item.png')
class DownloadDialog:
    SAVE_FILE_RADIOBUTTON = Pattern('save_file_radiobutton.png')
    OK_BUTTON = Pattern('ok_save_file_button.png')