univention.testing.browser package#
Submodules#
univention.testing.browser.appcenter module#
- univention.testing.browser.appcenter.wait_for_final_query(response: playwright.sync_api.Response)[source]#
univention.testing.browser.generic_udm_module module#
- class univention.testing.browser.generic_udm_module.CreatedItem(identifying_name: str)[source]#
Bases:
object
- class univention.testing.browser.generic_udm_module.AddObjectDialog(tester: UMCBrowserTest, locator: playwright.sync_api.Locator)[source]#
Bases:
objectUse this class when pressing the “Add” button opens a dialog
- Parameters:
tester – The UMCBrowserTest instance to use
locator – The locator of the dialog
- class univention.testing.browser.generic_udm_module.DetailsView(tester: UMCBrowserTest)[source]#
Bases:
object
- class univention.testing.browser.generic_udm_module.GenericUDMModule(tester: UMCBrowserTest, module_name: str)[source]#
Bases:
objectThe GenericUmcModule is the base class for a bunch of UMC Modules which are all structured similarly This class provides a bunch of methods for functionality that is similar/common in the modules.
- Parameters:
tester – The base tester
module_name – The module name to be opened by navigate
- add_object_dialog() AddObjectDialog[source]#
Will add an object by clicking the Add button which is visible for all modules inheriting from this class The way how objects are added is however different between the classes. Some open a dialog to fill in information, others open a full page view and others do both. This function should be used when a dialog is opened by clicking the add button. If there is a full page view being opened add_object_detail_view should be used
- add_object_detail_view() DetailsView[source]#
See add_object_dialog for details
- open_details(name: str) DetailsView[source]#
Click on the name of a <tr> entry to open it’s DetailsView
- delete(name: str | CreatedItem) None[source]#
Checks the checkbox of the row containing name and then press the delete button
- modify_text_field(name: str | CreatedItem, label: str = 'Description', value: str = 'description') None[source]#
Shortcut method to open the details of an object, fill a field with a value and save
- Parameters:
name – the name of the object to modify
label – the label of the textbox to fill the text into
value – the value to fill into the textbox
- class univention.testing.browser.generic_udm_module.PortalModule(tester: UMCBrowserTest)[source]#
Bases:
GenericUDMModule
- class univention.testing.browser.generic_udm_module.UserModule(tester: UMCBrowserTest)[source]#
Bases:
GenericUDMModule- create_object(name: str = 'user_name', first_name: str = 'first_name', last_name: str = 'last_name', password: str = 'univention', template: str | None = None) CreatedItem[source]#
Add a new user with the given information
- Returns:
CreatedItem which can be passed to subsequent methods of this class to modify the added user
- class univention.testing.browser.generic_udm_module.GroupModule(tester: UMCBrowserTest)[source]#
Bases:
GenericUDMModule- create_object(group_name: str = 'group_name') CreatedItem[source]#
Add a new group with the given information
- Returns:
CreatedItem which can be passed to subsequent methods of this class to modify the added group
- class univention.testing.browser.generic_udm_module.PoliciesModule(tester: UMCBrowserTest)[source]#
Bases:
GenericUDMModule- create_object(policy_name: str = 'policy_name') CreatedItem[source]#
Add a new policy with the given information
- Returns:
CreatedItem which can be passed to subsequent methods of this class to modify the added policy
- modify_text_field(created_item: str | CreatedItem, label: str = 'Update to this UCS version', value: str = '4.0') None[source]#
Shortcut method to open the details of an object, fill a field with a value and save
- Parameters:
name – the name of the object to modify
label – the label of the textbox to fill the text into
value – the value to fill into the textbox
- class univention.testing.browser.generic_udm_module.ComputerModule(tester: UMCBrowserTest)[source]#
Bases:
GenericUDMModule- create_object(computer_name: str = 'computer_name_8') CreatedItem[source]#
Add a new computer with the given information
- Returns:
CreatedItem which can be passed to subsequent methods of this class to modify the added computer
univention.testing.browser.ldap_directory module#
- class univention.testing.browser.ldap_directory.LDAPDirectory(tester: UMCBrowserTest)[source]#
Bases:
objectClass for the UMC LDAP Directory module
univention.testing.browser.lib module#
- class univention.testing.browser.lib.Interactions(tester: UMCBrowserTest)[source]#
Bases:
object- check_second_checkbox_in_grid()[source]#
This function checks the second checkbox in a grid
- Note:
Prefer to use check_checkbox_in_grid_by_name when possible
- check_checkbox_in_grid_by_name(name: str, nth: int | None = None)[source]#
This function checks a checkbox in a <tr> where the given name appears
- Parameters:
name – the name to search for
nth – controls what to do when there are multiple entries with name found. If none the function will throw an exception if int the function will act on the nth occurrence of the text
- open_modules(modules: list[str], limit: int | None = None, start_at: int | None = None)[source]#
This method will open all modules given by modules. It does this by searching for the module in the UMC, clicking on it and then clicking the close button
- Parameters:
limit – optionally only open the first limit modules
start_at – starts opening
- open_all_modules(limit: int | None = None, start_at: int | None = None)[source]#
This method opens all modules that can be found in the UMC when searching for ‘*’
- Parameters:
limit – optionally only open the first limit modules
start_at – starts opening
- open_module(module_name: str, expect_response: Pattern[str] | str | None = None, wait_for_network_idle: bool = False)[source]#
This method opens a module from anywhere where the module search bar in the UCM is visible
- Parameters:
module_name – the name of the module to be opened
expect_response – wait for a specific response to be completed before returning
wait_for_network_idle – wait for no network connections for at least 500ms. Mututally exclusive with expect_response.
- class univention.testing.browser.lib.UMCBrowserTest(page: playwright.sync_api.Page, lang: UCSLanguage = UCSLanguage.EN_US)[source]#
Bases:
InteractionsThis is the base class for all Playwright browser tests. It defines common operations and methods that are useful to all other library modules.
- Note:
As a general rule of this library, unless otherwise noted, the caller is responsible for the translation of a string
- Parameters:
page – The Playwright Page object
lang – The language to use for UCS
- lang: UCSLanguage#
- set_language(lang: UCSLanguage)[source]#
- login(username: str = 'Administrator', password: str = 'univention', location: str = '/univention/management', check_for_no_module_available_popup: bool = False, login_should_fail: bool = False, do_navigation: bool = True, expect_password_change_prompt: bool = False, wait_until: str = 'networkidle')[source]#
Navigates to {base_url}/univention/login?location={location} and logs in with the given credentials
- Parameters:
username – The username of the user to be logged in
password – The password of the user to be logged in
location – the location to navigate to after a successful login. This value is being URL encoded
check_for_no_module_available_popup – If set to true check for a “There is no module available for the…” popup after login
login_should_fail – Returns after failure to log in with wrong credentials
do_navigation – Wether to navigate to the login page
expect_password_change_prompt – Expect a password change prompt to be visible after clicking the Login button
univention.testing.browser.packagemanagement module#
- class univention.testing.browser.packagemanagement.PackageAction(value)[source]#
Bases:
Enum- Install = 1#
- Uninstall = 2#
- class univention.testing.browser.packagemanagement.PackageManagement(tester: UMCBrowserTest)[source]#
Bases:
objectClass for the Package Management UCS Module
- find_small_package() str[source]#
Finds a small package that is less than 0.5 MB, has no dependencies and recommended packages
- Returns:
the package name
- do_package_action(name: str, action: PackageAction)[source]#
- install_package(name: str)[source]#
Installs a package that is automatically chosen to be both small in size and has no dependencies and verifies that it is installed
- verify_package_status(expected: PackageAction)[source]#
Verify that the package actually got (un)installed
- Parameters:
expected – If expected is PackageAction.Install this function will make sure that the package has been _installed_ and vice versa.
univention.testing.browser.policies module#
univention.testing.browser.portal module#
- class univention.testing.browser.portal.UCSPortalEditMode(tester: UMCBrowserTest)[source]#
Bases:
objectThis Class is used to interact with the edit mode of the UCS Portal.
- upload_background_picture(path='')[source]#
Takes a screenshot of the current page and sets it as the background image. The side bar needs to be opened with open_edit_side_bar before calling this function
- remove_background_picture()[source]#
Remove the background picture. A background picture needs to have been set. The side bar needs to be opened with open_edit_side_bar before calling this function
- add_entry(internal_name: str, name: str, description: str, keyword: str, link: str, category: str)[source]#
Add a entry to the UCS Portal. The entry will be created in the last category
- add_folder(internal_name: str, name: str, category: str)[source]#
Add a folder to the UCS Portal. The folder will be created in the last category
- fill_localization_dialog(text: str, data_test_suffix: str = '', locator: Locator | None = None)[source]#
Fill a localization dialog The dialog MUST NOT be open when this method is called When this method returns the dialog will be closed
- Parameters:
text – the text to fill the boxes with. Suffixed with “ US” for en_US and “ DE” for de_DE
data_test_suffix – this can be used if the button to open to box has an id of the form “[data-test=”iconButton–{data_test_suffix}]”
locator – if the data-test attribute does not exist on the button the locator can be passed here
- class univention.testing.browser.portal.UCSSideMenu(tester: UMCBrowserTest)[source]#
Bases:
object- open_edit_mode() UCSPortalEditMode[source]#
- class univention.testing.browser.portal.UCSPortal(tester: UMCBrowserTest)[source]#
Bases:
object
univention.testing.browser.process_overview module#
- class univention.testing.browser.process_overview.ProcessOverview(tester: UMCBrowserTest)[source]#
Bases:
object- search(category: Literal['All', 'User', 'PID', 'Command'], text: str)[source]#
Run a search
- Parameters:
category – the category to search for. NOTICE: this argument gets translated in the function
text – the text to search for
- ensure_process(process: Popen, category: Literal['All', 'User', 'PID', 'Command'])[source]#
Ensures that a process is running, either by PID or Command
- Parameters:
process – the process to search for. If searching by name the process args are joined together if searching by pid, process.pid is used
category – the category to search for the process by. Currently only PID and Command are supported
- kill_process(process: Popen, force: bool)[source]#
Kills the process given by process and ensures that is was actually killed
- Parameters:
process – the process to kill
force – if false sends SIGTERM to the process by pressing the Terminate button if true sends SIGKILL to the process by pressing the ‘Force termination’ button
univention.testing.browser.selfservice module#
univention.testing.browser.suggestion module#
univention.testing.browser.systemdiagnostics module#
univention.testing.browser.udm_users module#
- class univention.testing.browser.udm_users.User(username: str, lastname: str, password: str = 'univention', has_popup_after_login: bool = False)[source]#
Bases:
object
- class univention.testing.browser.udm_users.Users(regular_user: univention.testing.browser.udm_users.User, admin_user: univention.testing.browser.udm_users.User)[source]#
Bases:
object
univention.testing.browser.univentionconfigurationregistry module#
- class univention.testing.browser.univentionconfigurationregistry.UniventionConfigurationRegistry(tester: UMCBrowserTest)[source]#
Bases:
object