Mozilla Iris  1.0
A visual test suite for Firefox
iris.api.helpers.general Namespace Reference

Classes

class  Option
 
class  RightClickLocationBar
 
class  ZoomType
 

Functions

def access_bookmarking_tools (option)
 
def bookmark_options (option)
 
def change_preference (pref_name, value)
 
def click_cancel_button ()
 
def click_hamburger_menu_option (option)
 
def click_window_control (button, window_type='auxiliary')
 
def close_customize_page ()
 
def close_firefox (test)
 
def close_window_control (window_type)
 
def close_content_blocking_pop_up ()
 
def confirm_close_multiple_tabs ()
 
def confirm_firefox_launch (image=None)
 
def copy_to_clipboard ()
 
def create_firefox_args (test_case)
 
def create_region_for_hamburger_menu ()
 
def create_region_for_url_bar ()
 
def create_region_from_image (image)
 
def dont_save_password ()
 
def find_window_controls (window_type)
 
def full_screen_control (window_type)
 
def get_firefox_build_id (build_path)
 
def get_firefox_build_id_from_about_config ()
 
def get_firefox_channel (build_path)
 
def get_firefox_channel_from_about_config ()
 
def get_firefox_info (build_path)
 
def get_firefox_locale_from_about_config ()
 
def get_firefox_region ()
 
def get_firefox_version (build_path)
 
def get_firefox_version_from_about_config ()
 
def get_main_modifier ()
 
def get_menu_modifier ()
 
def get_pref_value (pref_name)
 
def get_support_info ()
 
def get_telemetry_info ()
 
def key_to_one_off_search (highlighted_pattern, direction='left')
 
def launch_firefox (path, profile=None, url=None, args=None, show_crash_reporter=False)
 
def login_site (site_name)
 
def maximize_window_control (window_type)
 
def minimize_window_control (window_type)
 
def navigate (url)
 
def navigate_slow (url)
 
def open_about_firefox ()
 
def open_library_menu (option)
 
def open_zoom_menu ()
 
def restore_window_control (window_type)
 
def remove_zoom_indicator_from_toolbar ()
 
def repeat_key_down (num)
 
def repeat_key_down_until_image_found (image_pattern, num_of_key_down_presses=10, delay_between_presses=3)
 
def repeat_key_up (num)
 
def repeat_key_up_until_image_found (image_pattern, num_of_key_up_presses=10, delay_between_presses=3)
 
def reset_mouse ()
 
def restart_firefox (test, path, profile, url, args=None, image=None, show_crash_reporter=False)
 
def restore_firefox_focus ()
 
def restore_window_from_taskbar (option=None)
 
def scroll_until_pattern_found (image_pattern, scroll_function, scroll_params, num_of_scroll_iterations=10, timeout=3)
 
def select_location_bar_option (option_number)
 
def select_zoom_menu_option (option_number)
 
def wait_for_firefox_restart ()
 
def write_profile_prefs (test_case)
 
def zoom_with_mouse_wheel (nr_of_times=1, zoom_type=None)
 
def open_directory (directory)
 

Function Documentation

◆ access_bookmarking_tools()

def iris.api.helpers.general.access_bookmarking_tools (   option)
Access option from 'Bookmarking Tools'.

:param option: Option from 'Bookmarking Tools'.
:return: None.

◆ bookmark_options()

def iris.api.helpers.general.bookmark_options (   option)
Click a bookmark option after right clicking on a bookmark from the
library menu.

:param option: Bookmark option to be clicked.
:return: None.

◆ change_preference()

def iris.api.helpers.general.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.

◆ click_cancel_button()

def iris.api.helpers.general.click_cancel_button ( )
Click cancel button.

◆ click_hamburger_menu_option()

def iris.api.helpers.general.click_hamburger_menu_option (   option)
Click on a specific option from the hamburger menu.

:param option: Hamburger menu option to be clicked.
:return: The region created starting from the hamburger menu pattern.

◆ click_window_control()

def iris.api.helpers.general.click_window_control (   button,
  window_type = 'auxiliary' 
)
Click window with options: close, minimize, maximize, restore, full_screen.

:param button: Auxiliary or main window options.
:param window_type: Type of window that need to be controlled.
:return: None.

◆ close_content_blocking_pop_up()

def iris.api.helpers.general.close_content_blocking_pop_up ( )
Closes the content blocking pop up

◆ close_customize_page()

def iris.api.helpers.general.close_customize_page ( )
Close the 'Customize...' page by pressing the 'Done' button.

◆ close_firefox()

def iris.api.helpers.general.close_firefox (   test)

◆ close_window_control()

def iris.api.helpers.general.close_window_control (   window_type)
Click on close window control.

:param window_type: Type of window that need to be closed.
:return: None.

◆ confirm_close_multiple_tabs()

def iris.api.helpers.general.confirm_close_multiple_tabs ( )
Click confirm 'Close all tabs' for warning popup when multiple tabs are
opened.

◆ confirm_firefox_launch()

def iris.api.helpers.general.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.

◆ copy_to_clipboard()

def iris.api.helpers.general.copy_to_clipboard ( )
Return the value copied to clipboard.

◆ create_firefox_args()

def iris.api.helpers.general.create_firefox_args (   test_case)
Create a list with firefox arguments.

:param test_case: Instance of BaseTest class.
:return: list of firefox arguments.

◆ create_region_for_hamburger_menu()

def iris.api.helpers.general.create_region_for_hamburger_menu ( )
Create region for hamburger menu pop up.

◆ create_region_for_url_bar()

def iris.api.helpers.general.create_region_for_url_bar ( )
Create region for the right side of the url bar.

◆ create_region_from_image()

def iris.api.helpers.general.create_region_from_image (   image)
Create region starting from a pattern.

:param image: Pattern used to create a region.
:return: None.

◆ dont_save_password()

def iris.api.helpers.general.dont_save_password ( )
Do not save the password for a login.

◆ find_window_controls()

def iris.api.helpers.general.find_window_controls (   window_type)
Find window controls for main and auxiliary windows.

:param window_type: Controls for a specific window type.
:return: None.

◆ full_screen_control()

def iris.api.helpers.general.full_screen_control (   window_type)
Click on full screen window mode (Applicable only for MAC system).

:param window_type: Type of window that need to be maximized in full screen mode.
:reurn: None.

◆ get_firefox_build_id()

def iris.api.helpers.general.get_firefox_build_id (   build_path)
Returns build id string from the dictionary generated by mozversion
library.

:param build_path: Path to the binary for the application or Android APK
file.

◆ get_firefox_build_id_from_about_config()

def iris.api.helpers.general.get_firefox_build_id_from_about_config ( )
Returns the Firefox build id from 'about:config' page.

◆ get_firefox_channel()

def iris.api.helpers.general.get_firefox_channel (   build_path)
Returns Firefox channel from application repository.

:param build_path: Path to the binary for the application or Android APK
file.

◆ get_firefox_channel_from_about_config()

def iris.api.helpers.general.get_firefox_channel_from_about_config ( )
Returns the Firefox channel from 'about:config' page.

◆ get_firefox_info()

def iris.api.helpers.general.get_firefox_info (   build_path)
Returns the application version information as a dict with the help of
mozversion library.

:param build_path: Path to the binary for the application or Android APK
file.

◆ get_firefox_locale_from_about_config()

def iris.api.helpers.general.get_firefox_locale_from_about_config ( )
Returns the Firefox locale from 'about:config' page.

◆ get_firefox_region()

def iris.api.helpers.general.get_firefox_region ( )
For now, just return the Primary Monitor.

◆ get_firefox_version()

def iris.api.helpers.general.get_firefox_version (   build_path)
Returns application version string from the dictionary generated by
mozversion library.

:param build_path: Path to the binary for the application or Android APK
file.

◆ get_firefox_version_from_about_config()

def iris.api.helpers.general.get_firefox_version_from_about_config ( )
Returns the Firefox version from 'about:config' page.

◆ get_main_modifier()

def iris.api.helpers.general.get_main_modifier ( )
Return the main modifier.

◆ get_menu_modifier()

def iris.api.helpers.general.get_menu_modifier ( )
Return the menu modifier.

◆ get_pref_value()

def iris.api.helpers.general.get_pref_value (   pref_name)
Returns the value of a provided preference from 'about:config' page.

:param pref_name: Preference's name.
:return: Preference's value.

◆ get_support_info()

def iris.api.helpers.general.get_support_info ( )
Returns support information as a JSON object from 'about:support' page.

◆ get_telemetry_info()

def iris.api.helpers.general.get_telemetry_info ( )
Returns telemetry information as a JSON object from 'about:telemetry'
page.

◆ key_to_one_off_search()

def iris.api.helpers.general.key_to_one_off_search (   highlighted_pattern,
  direction = 'left' 
)
Iterate through the one of search engines list until the given one is
highlighted.

param: highlighted_pattern: The pattern image to search for.
param: direction: direction to key to: right or left (default)
return: None.

◆ launch_firefox()

def iris.api.helpers.general.launch_firefox (   path,
  profile = None,
  url = None,
  args = None,
  show_crash_reporter = False 
)
Launch the app with optional args for profile, windows, URI, etc.

:param path: Firefox path.
:param profile: Firefox profile.
:param url: URL to be loaded.
:param args: Optional list of arguments.
:param show_crash_reporter: Enable or disable Firefox Crash Reporting tool.
:return: List of Firefox flags.

◆ login_site()

def iris.api.helpers.general.login_site (   site_name)
Login into a specific site.

:param site_name: Name of the site.
:return: None.

◆ maximize_window_control()

def iris.api.helpers.general.maximize_window_control (   window_type)
Click on maximize window control.

:param window_type: Type of window that need to be maximized.
:return: None.

◆ minimize_window_control()

def iris.api.helpers.general.minimize_window_control (   window_type)
Click on minimize window control.

:param window_type: Type of window that need to be minimized.
:return: None.

◆ navigate()

def iris.api.helpers.general.navigate (   url)
Navigates, via the location bar, to a given URL.

:param url: The string to type into the location bar.
:return: None.

◆ navigate_slow()

def iris.api.helpers.general.navigate_slow (   url)
Navigates slow, via the location bar, to a given URL.

:param url: The string to type into the location bar.
:return: None.

The function handles typing 'Enter' to complete the action.

◆ open_about_firefox()

def iris.api.helpers.general.open_about_firefox ( )
Open the 'About Firefox' window.

◆ open_directory()

def iris.api.helpers.general.open_directory (   directory)

◆ open_library_menu()

def iris.api.helpers.general.open_library_menu (   option)
Open the Library menu with an option as argument.

:param option: Library menu option.
:return: Custom region created for a more efficient and accurate image
pattern search.

◆ open_zoom_menu()

def iris.api.helpers.general.open_zoom_menu ( )
Open the 'Zoom' menu from the 'View' menu.

◆ remove_zoom_indicator_from_toolbar()

def iris.api.helpers.general.remove_zoom_indicator_from_toolbar ( )
Remove the zoom indicator from toolbar by clicking on the 'Remove from
Toolbar' button.

◆ repeat_key_down()

def iris.api.helpers.general.repeat_key_down (   num)
Repeat DOWN keystroke a given number of times.

:param num: Number of times to repeat DOWN key stroke.
:return: None.

◆ repeat_key_down_until_image_found()

def iris.api.helpers.general.repeat_key_down_until_image_found (   image_pattern,
  num_of_key_down_presses = 10,
  delay_between_presses = 3 
)
Press the Key Down button until specified image pattern is found.

:param image_pattern: Image Pattern to search.
:param num_of_key_down_presses: Number of presses of the Key Down button.
:param delay_between_presses: Number of seconds to wait between the Key Down presses
:return: Boolean. True if image pattern found during Key Down button pressing, False otherwise

◆ repeat_key_up()

def iris.api.helpers.general.repeat_key_up (   num)
Repeat UP keystroke a given number of times.

:param num: Number of times to repeat UP key stroke.
:return: None.

◆ repeat_key_up_until_image_found()

def iris.api.helpers.general.repeat_key_up_until_image_found (   image_pattern,
  num_of_key_up_presses = 10,
  delay_between_presses = 3 
)
Press the Key Up button until specified image pattern is found.

:param image_pattern: Image Pattern to search.
:param num_of_key_up_presses: Number of presses of the Key Up button.
:param delay_between_presses: Number of seconds to wait between the Key Down presses
:return: Boolean. True if image pattern found during the Key Up button pressing, False otherwise

◆ reset_mouse()

def iris.api.helpers.general.reset_mouse ( )
Reset mouse position to location (0, 0).

◆ restart_firefox()

def iris.api.helpers.general.restart_firefox (   test,
  path,
  profile,
  url,
  args = None,
  image = None,
  show_crash_reporter = False 
)
Restart the app with optional args for profile.

:param test: current test
:param path: Firefox path.
:param profile: Firefox profile.
:param url: URL to be loaded.
:param args: Optional list of arguments.
:param image: Image checked to confirm that Firefox has successfully
:param show_crash_reporter: Enable or disable Firefox Crash Reporting tool.
restarted.
:return: None.

◆ restore_firefox_focus()

def iris.api.helpers.general.restore_firefox_focus ( )
Restore Firefox focus by clicking the panel near HOME or REFRESH button.

◆ restore_window_control()

def iris.api.helpers.general.restore_window_control (   window_type)
Click on restore window control.

:param window_type: Type of window that need to be restored.
:return: None.

◆ restore_window_from_taskbar()

def iris.api.helpers.general.restore_window_from_taskbar (   option = None)
Restore firefox from taskbar.

◆ scroll_until_pattern_found()

def iris.api.helpers.general.scroll_until_pattern_found (   image_pattern,
  scroll_function,
  scroll_params,
  num_of_scroll_iterations = 10,
  timeout = 3 
)
Scrolls until specified image pattern is found.

:param image_pattern: Image Pattern to search.
:param scroll_function: Scrolling function or any callable object (e.g. type, scroll, etc.)
:param scroll_params: Tuple of params to pass in the scroll_function
        (e.g. (Key.UP, ) or (Key.UP, KeyModifier.CTRL) for the type function).
        NOTE: Tuple should contains from 0 (empty tuple) to 2 items.
:param num_of_scroll_iterations: Number of scrolling iterations.
:param timeout: Number of seconds passed to the 'timeout' param of the 'exist' function.
:return: Boolean. True if image pattern found during scrolling, False otherwise

◆ select_location_bar_option()

def iris.api.helpers.general.select_location_bar_option (   option_number)
Select option from the location bar menu.

:param option_number: Option number.
:return: None.

◆ select_zoom_menu_option()

def iris.api.helpers.general.select_zoom_menu_option (   option_number)
Open the 'Zoom' menu from the 'View' menu and select option.

◆ wait_for_firefox_restart()

def iris.api.helpers.general.wait_for_firefox_restart ( )
Wait for Firefox to restart.

◆ write_profile_prefs()

def iris.api.helpers.general.write_profile_prefs (   test_case)
Add test case setup prefs.

:param test_case: Instance of BaseTest class.
:return: None.

◆ zoom_with_mouse_wheel()

def iris.api.helpers.general.zoom_with_mouse_wheel (   nr_of_times = 1,
  zoom_type = None 
)
Zoom in/Zoom out using the mouse wheel.

:param nr_of_times: Number of times the 'zoom in'/'zoom out' action should
take place.
:param zoom_type: Type of the zoom action('zoom in'/'zoom out') intended to
be performed.
:return: None.