univention.testing.selenium package

class univention.testing.selenium.UMCSeleniumTest(language='en', host='', suppress_notifications=True)[source]

Bases: univention.testing.selenium.checks_and_waits.ChecksAndWaits, univention.testing.selenium.interactions.Interactions

This class provides selenium test for web UI tests. Default browser is Firefox. Set local variable UCSTEST_SELENIUM_BROWSER to ‘chrome’ or ‘ie’ to switch browser. Tests run on selenium grid server. To run tests locally use local variable UCSTEST_SELENIUM=local. Root privileges are required, also root needs the privilege to display the browser.

BROWSERS = {'chrome': 'chrome', 'chromium': 'chrome', 'ff': 'firefox', 'firefox': 'firefox', 'ie': 'internet explorer'}
restart_umc()[source]
set_viewport_size(width, height)[source]
save_screenshot(name='error', hide_notifications=True, xpath='/html/body', append_timestamp=False)[source]
open_traceback()[source]
crop_screenshot_to_element(image_filename, xpath)[source]
save_browser_log(name='error', append_timestamp=True)[source]
show_notifications(show_notifications=True)[source]
notifications_visible()[source]
press_notifications_button()[source]
do_login(username=None, password=None, without_navigation=False, language=None, check_successful_login=True)[source]
end_umc_session()[source]

Log out the logged in user.

open_module(name, wait_for_standby=True, do_reload=True)[source]
search_module(name, do_reload=True)[source]

Submodules

univention.testing.selenium.appcenter module

class univention.testing.selenium.appcenter.AppCenter(selenium)[source]

Bases: object

install_app(app_name)[source]
uninstall_app(app_name)[source]
upgrade_app(app)[source]
search_for_apps(text, category='')[source]
select_search_category(category)[source]
click_app_tile(app_name)[source]
open(do_reload=True)[source]
open_app(app_name)[source]
close_info_dialog_if_visisble()[source]

univention.testing.selenium.base module

class univention.testing.selenium.base.UMCSeleniumTest(language='en', host='', suppress_notifications=True)[source]

Bases: univention.testing.selenium.checks_and_waits.ChecksAndWaits, univention.testing.selenium.interactions.Interactions

This class provides selenium test for web UI tests. Default browser is Firefox. Set local variable UCSTEST_SELENIUM_BROWSER to ‘chrome’ or ‘ie’ to switch browser. Tests run on selenium grid server. To run tests locally use local variable UCSTEST_SELENIUM=local. Root privileges are required, also root needs the privilege to display the browser.

BROWSERS = {'chrome': 'chrome', 'chromium': 'chrome', 'ff': 'firefox', 'firefox': 'firefox', 'ie': 'internet explorer'}
restart_umc()[source]
set_viewport_size(width, height)[source]
save_screenshot(name='error', hide_notifications=True, xpath='/html/body', append_timestamp=False)[source]
open_traceback()[source]
crop_screenshot_to_element(image_filename, xpath)[source]
save_browser_log(name='error', append_timestamp=True)[source]
show_notifications(show_notifications=True)[source]
notifications_visible()[source]
press_notifications_button()[source]
do_login(username=None, password=None, without_navigation=False, language=None, check_successful_login=True)[source]
end_umc_session()[source]

Log out the logged in user.

open_module(name, wait_for_standby=True, do_reload=True)[source]
search_module(name, do_reload=True)[source]

univention.testing.selenium.checks_and_waits module

class univention.testing.selenium.checks_and_waits.ChecksAndWaits[source]

Bases: object

wait_for_text(text, timeout=60)[source]
wait_for_any_text_in_list(texts, timeout=60)[source]
wait_for_text_to_disappear(text, timeout=60)[source]
wait_for_button(button_text, **kwargs)[source]
wait_until_all_dialogues_closed()[source]
wait_until_all_standby_animations_disappeared(timeout=60)[source]
wait_until_standby_animation_appears(timeout=5)[source]
wait_until_standby_animation_appears_and_disappears(appear_timeout=5, disappear_timeout=60)[source]
wait_until_progress_bar_finishes(timeout=300)[source]
wait_until_element_visible(xpath, timeout=60)[source]
wait_until(check_function, timeout=60)[source]
get_all_visible_elements(xpaths)[source]
elements_invisible(xpath)[source]
elements_visible(xpath)[source]
wait_for_element_by_css_selector(css_selector, message='', timeout=60)[source]

univention.testing.selenium.interactions module

class univention.testing.selenium.interactions.Interactions[source]

Bases: object

click_text(text, **kwargs)[source]
click_checkbox_of_grid_entry(name, **kwargs)[source]
click_checkbox_of_dojox_grid_entry(name, **kwargs)[source]
click_grid_entry(name, **kwargs)[source]
click_tree_entry(name, **kwargs)[source]
click_button(button_text, xpath_prefix='', **kwargs)[source]
click_buttons(button_name_list, xpath_prefix='', **kwargs)[source]
click_search_button()[source]
click_tile(tilename, **kwargs)[source]
click_tile_menu_icon(tilename, **kwargs)[source]
click_tab(tabname, **kwargs)[source]
open_side_menu()[source]
close_side_menu()[source]
click_side_menu_entry(text)[source]
click_side_menu_back()[source]
click_element(xpath, scroll_into_view=False, timeout=60, right_click=False)[source]

Click on the element which is found by the given xpath.

Only use with caution when there are multiple elements with that xpath. Waits for the element to be clickable before attempting to click.

enter_input(inputname, inputvalue)[source]

Enter inputvalue into an input-element with the tag inputname.

enter_input_combobox(inputname, inputvalue, with_click=True)[source]
enter_input_date(inputname, inputvalue)[source]
submit_input(inputname)[source]

Submit the input in an input-element with the tag inputname.

get_input(inputname)[source]

Get an input-element with the tag inputname.

get_all_enabled_elements(xpath)[source]
upload_image(img_path, button_label='Upload', timeout=60, xpath_prefix='')[source]

Get an ImageUploader widget on screen and upload the given img_path. Which ImageUploader widget is found can be isolated by specifying ‘xpath_prefix’ which would be an xpath pointing to a specific container/section etc.

drag_and_drop(source, target, find_by='xpath')[source]

Wrapper for selenium.webdriver.common.action_chains.drag_and_drop

drag_and_drop_by_offset(source, xoffset, yoffset, find_by='xpath')[source]

Wrapper for selenium.webdriver.common.action_chains.drag_and_drop_by_offset

univention.testing.selenium.udm module

class univention.testing.selenium.udm.UDMBase(selenium)[source]

Bases: object

name = None
exists(objectname)[source]
open_module()[source]
open_details(objectname)[source]
close_details()[source]
save_details()[source]
delete(objectname)[source]
search(objectname)[source]
wait_for_main_grid_load(timeout=60)[source]
open_add_dialog(container=None, template=None)[source]
open_advanced_add_dialog(**kwargs)[source]
class univention.testing.selenium.udm.Portals(selenium)[source]

Bases: univention.testing.selenium.udm.UDMBase

name = 'Portal settings'
add(portalname=None, hostname=None)[source]
class univention.testing.selenium.udm.Computers(selenium)[source]

Bases: univention.testing.selenium.udm.UDMBase

name = 'Computers'
add(computername=None)[source]
class univention.testing.selenium.udm.Groups(selenium)[source]

Bases: univention.testing.selenium.udm.UDMBase

name = 'Groups'
add(groupname=None)[source]
class univention.testing.selenium.udm.Policies(selenium)[source]

Bases: univention.testing.selenium.udm.UDMBase

name = 'Policies'
add(policyname=None)[source]
class univention.testing.selenium.udm.Users(selenium)[source]

Bases: univention.testing.selenium.udm.UDMBase

name = 'Users'
get_description()[source]
get_primary_mail()[source]
add(template=None, firstname='', lastname=None, username=None, password='univention')[source]
copy(user, username='', lastname='', password='univention', **kwargs)[source]

univention.testing.selenium.utils module

univention.testing.selenium.utils.expand_path(xpath)[source]