camayoc.tests.qpc.ui.utils module

Utility class for UI tests.

camayoc.tests.qpc.ui.utils.check_auth_type(credential_name, auth_type)[source]

Verify the authentication type of a credential.

Example types include ‘SSH Key’ and ‘Username and Password’. If the Locator cannot find a match, an exception is raised.

camayoc.tests.qpc.ui.utils.checkbox_xpath(row_name)[source]

Build an xpath for selecting a checkbox in a row.

Works for credentials or sources.

camayoc.tests.qpc.ui.utils.clear_toasts(view, count=20)[source]

Attempt to flush any confirmation dialogs that may have appeared.

Use this function to clear out dialogs (toasts) that may be preventing buttons from being clicked properly. Sometimes it might need to be used in succession. By default, this tries to flush a maximum of 20 toasts, but will quit early if it cannot find more.

camayoc.tests.qpc.ui.utils.create_credential(view, options)[source]

Create a credential through the UI.

camayoc.tests.qpc.ui.utils.create_source(view, credential_name, source_type, source_name, addresses)[source]

Create a source through the UI.

camayoc.tests.qpc.ui.utils.delete_credential(view, names)[source]

Delete a credential through the UI.

camayoc.tests.qpc.ui.utils.delete_source(view, source_name)[source]

Delete a source through the UI.

camayoc.tests.qpc.ui.utils.delete_xpath(row_name)[source]

Return an xpath for selecting the delete button in a row.

Works for credentials or sources.

camayoc.tests.qpc.ui.utils.edit_credential(view, original_name, options)[source]

Edit a credential through the UI and verify it was edited.

Parameters:
  • view – The view context (should be the browser view)
  • original_name – The original name of the credential.
  • options – The options to be edited within the credential.
camayoc.tests.qpc.ui.utils.edit_xpath(row_name)[source]

Return an xpath for selecting the edit button in a row.

Works for credentials or sources.

camayoc.tests.qpc.ui.utils.field_xpath(label, textarea=False)[source]

Build an xpath for selecting a form field based on its label.

camayoc.tests.qpc.ui.utils.fill(view, xpath_locator, text)[source]

Fill in a textbox using a xpath locator.

camayoc.tests.qpc.ui.utils.fill_credential_info(view, options)[source]

Fill out the credential modal based on available options.

camayoc.tests.qpc.ui.utils.get_field_value(view, label, textarea=False)[source]

Get the current value of a form field.

camayoc.tests.qpc.ui.utils.radio_xpath(label)[source]

Build an xpath for selecting a radio button based on its label.

camayoc.tests.qpc.ui.utils.row_xpath(row_name)[source]

Build an xpath for selecting a certain row.

Works for credentials or sources.

camayoc.tests.qpc.ui.utils.set_checkbox(view, name, fill)[source]

Fill or clear a checkbox next to a credential.

camayoc.tests.qpc.ui.utils.wait_for_animation(wait_time=0.5)[source]

Wait for animations to complete.