Note

By contributing to this Open Source project, you provide Appian Corporation a non-exclusive, perpetual, royalty-free license to use your contribution for any purpose.

Contributing

  1. Fork the appian-locust repository

  2. Make any desired changes

  3. Commit changes and push to your fork

  4. Make a merge request to the upstream fork and project maintainers will review it

New Development

As new development is done to Appian Locust, the core principle of user navigation and resulting interaction should be kept in mind. Is your feature adding interaction capabilities to an existing type of page? If so, you likely want to add a new method to an existing SailUiForm type. Otherwise, you might need to create a new extention of SailUiForm and ensure that the Visitor class has the capabilities to visit the new page type. Lastly, functionality that doesn’t involve user interaction should be included in the SiteHelper class.

If you think that your development falls outside of the above criteria, you should submit an issue for the maintainers of this project to discuss your use case.

To Test Your Changes

In any test-implementation repo where you use appian-locust, change the following (assuming you’re using a Pipfile)

appian-locust = {path="../appian-locust", editable=true}

NOTE The path above assumes appian-locust is checked out locally, hence we can use a relative directory path.

And run pipenv install --skip-lock to allow you to use a local version of appian-locust without recreating the lock file. However, remember to use a lock file in your test-implementation repo.

Now you can test your changes as you normally would.

Internal Classes

Apart from our exposed API, we provide internal classes for more granular control when developing or testing.

class appian_locust._actions._Actions(interactor: _Interactor)

Bases: _Base

clear_actions_cache() None
fetch_action_json(action_name: str, exact_match: bool = False, label: str = '') Dict[str, Any]

This function calls the API for the specific action to get its “form” data

Parameters:
  • action_name (str) – Name of the action to be called. Name of the action will be in the below pattern. “displayLabel::opaquqId”

  • exact_match (bool, optional) – Should action name match exactly or to be partial match. Default : False

Returns (dict): Response of actions’s Get UI call in dictionary

Examples

If the full name of the action is known, with the opaque ID,

>>> self.appian.action.fetch_action_json("action_name:igB0K7YxC0UQ2Fhx4hicRw...", exact_match=True)

If only the display name is known, or part of the display name

>>> self.appian.action.fetch_action_json("action_name")
>>> self.appian.action.fetch_action_json("actio")
get_action(action_name: str, exact_match: bool = False) Dict[str, Any]

Get the information about specific action by name.

Parameters:
  • action_name (str) – Name of the action

  • exact_match (bool) – Should action name match exactly or to be partial match. Default : False

Returns (dict): Specific Action’s info

Raises: In case of action is not found in the system, it throws an “Exception”

Example

If full name of action is known, with the opaque ID,

>>> self.appian.action.get_action("action_name:igB0K7YxC0UQ2Fhx4hicRw...", exact_match=True)

If only the display name is known, or part of the display name

>>> self.appian.action.get_action("action_name")
>>> self.appian.action.get_action("actio")
get_actions_feed(locust_request_label: str = 'Actions') Dict[str, Any]
get_actions_interface(locust_request_label: str = 'Actions') Dict[str, Any]
get_actions_nav(locust_request_label: str = 'Actions') Dict[str, Any]
get_all(search_string: str | None = None, locust_request_label: str = 'Actions.MainMenu.AvailableActions') Dict[str, Any]

Retrieves all the available “actions” and associated metadata from “Appian-Tempo-Actions”

Note: All the retrieved data about actions is stored in the private variable self._actions

Returns (dict): List of actions and associated metadata

Examples

>>> self.appian.action.get_all()
get_errors_count() int
start_action(action_name: str, skip_design_call: bool = False, exact_match: bool = False) Response

Perform the post operation on action’s API to start specific action. Actions that do not have a UI can be called directly without using “GET” to retrieve the UI. this is controlled by the optional skip_design_call parameter

Parameters:
  • action_name (str) – Name of the action

  • skip_design_call (bool, optional) – to skip the “GET” call for the action’s UI. Default : False

  • exact_match (bool, optional) – Should action name match exactly or to be partial match. Default : False

Returns: NONE

Example

>>> self.appian.action.start_action("action_name")
class appian_locust._admin._Admin(interactor: _Interactor)

Bases: object

fetch_admin_json(locust_request_label: str | None = None) Dict[str, Any]

Navigates to /admin

Returns: The response of /admin

class appian_locust._base._Base

Bases: object

Base class for classes _Actions, _News, _Records, _Reports, _Tasks, Sites

get(items_in_dict: dict, item_name: str, exact_match: bool = True, ignore_retry: bool = False, search_string: str | None = None) tuple

Common Get function to get the specific component from dictionary of items. If item is not found, it calls get_all function to update itself and retry.

Warning: Internal function, should never be called directly.

Parameters:
  • items_in_dict (dict) – Dictionary of component (for ex, dictionary of actions if called from actions class)

  • item_name (str) – Component name (for ex, action name if called from actions class)

  • exact_match (bool, optional) – Should item name match exactly or to be partial match. Default : True

  • ignore_retry (bool, optional) – Whether to retry or not if item is not found in first try.

  • search_string (str, optional) – String to filter the results of get_all function. Currently supported only for News

Returns: Tuple of item name and full properties of item If item found, otherwise tuple of Nones

get_all(search_string: str | None = None, locust_request_label: str = '') Any

Common Get All function prototype that is overwritten by subclasses. Created only to conform to Mypy validation.

class appian_locust._data_fabric._DataFabric(interactor: _Interactor)

Bases: object

fetch_data_fabric_dashboard_json(encoded_uri_stub: str = 'new', locust_request_label: str | None = None) Dict[str, Any]
fetch_data_fabric_json(locust_request_label: str | None = None) Dict[str, Any]
class appian_locust._design._Design(interactor: _Interactor)

Bases: object

click_expression_editor_toolbar_button(button_action: str, post_url: str, state: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]
create_ai_skill_object(ui_form: SailUiForm, ai_skill_name: str, ai_skill_type: AISkillObjectType) SailUiForm
create_object(ui_form: SailUiForm, link_name: str, object_name: str) SailUiForm
extract_ai_skill_info(object_json: Dict[str, Any]) AiSkill
fetch_application_json(app_id: str, locust_request_label: str | None = None) Dict[str, Any]

Fetches the JSON of the UI for a specific application within the /design environment

Returns: JSON Dictionary

Example

>>> design.fetch_application_json("AADZeglVgAAgfpsAAJsAAAAAAdA")
fetch_design_json(locust_request_label: str | None = None) Dict[str, Any]

Fetches the JSON of /design UI

Returns: JSON Dictionary

Example

>>> design.fetch_design_json()
fetch_design_object_json(opaque_id: str, locust_request_label: str | None = None) Dict[str, Any]

Fetches the JSON of the UI for a specific object within the /design environment

Returns: JSON Dictionary

Example

>>> design.fetch_design_object_json("lABD1iTIu_lxy_3T_90Is2fs63uh52xESYi6-fun7FBWshlrBQ0EptlFUdGyIRzSSluPyVdvOhvGgL6aBlnjlkWfQlALYR2aRZ_AIliJ4lc3g")
find_design_grid(state: Dict[str, Any]) Dict[str, Any]
find_design_object_opaque_id_in_grid(design_object_name: str, current_state: Dict[str, Any]) str
find_design_object_type_indices(current_state: Dict[str, Any], design_object_types: list[str]) list[int]
search_design_grid(search_str: str, reeval_url: str, state: Dict[str, Any], context: Dict[str, Any], uuid: str, locust_label: str = 'Design.Search') Dict[str, Any]

Search a grid in /design :param search_str: string to search :type search_str: str :param reeval_url: url to send request to :type reeval_url: str :param state: current state of UI, which contains the search bar :type state: str :param context: current context :type context: str :param uuid: UUID of search component :type uuid: str :param locust_label: label to associate request with :type locust_label: str

Returns:

appian_locust._design.get_available_design_objects(state: Dict[str, Any]) Dict[str, DesignObject]
appian_locust._design.validate_design_object_access_method(design_object_json: Dict[str, Any], object_type_to_method_dict: Dict[str, Any]) None
appian_locust._feature_toggle_helper.__get_javascript_feature_flag_regex() Generator[str, None, None]
appian_locust._feature_toggle_helper.__get_javascript_uri_regex() Generator[str, None, None]
appian_locust._feature_toggle_helper.__get_mobile_feature_flag_overrides() Generator[FeatureFlag, None, None]
appian_locust._feature_toggle_helper._create_override_flag_mask(flags_to_override: Callable[[], Generator[FeatureFlag, None, None]]) int

Given a list of flag enums from FeatureFlag, this will set that flag to 1 to override the default feature set. returns flag mask reflecting all the flags combined.

appian_locust._feature_toggle_helper._get_feature_flags_from_regex_match(flag_str: str) Tuple[str, str]

Coerce flags into proper format for sending as headers

appian_locust._feature_toggle_helper._get_javascript_and_find_feature_flag(client: HttpSession, script_uri: str, headers: Dict[str, Any] | None = None) Any

Read through minified javascript for feature flags

appian_locust._feature_toggle_helper._get_javascript_uri(interactor: _Interactor, headers: Dict[str, Any] | None = None) Any

Gets the URI for the javascript file that contains the Feature Toggles

appian_locust._feature_toggle_helper._to_hex_str(flagVal: int) str
appian_locust._feature_toggle_helper._truncate_flag_extended(flag_extended: int) int
appian_locust._feature_toggle_helper.get_client_feature_toggles(interactor: _Interactor, session: HttpSession) Tuple[str, str]

Given an authenticated user, recover the feature toggles from the minified javascript

Returns: Returns feature flag if found, otherwise empty string

appian_locust._feature_toggle_helper.override_default_feature_flags(interactor: _Interactor, flags_to_override: Callable[[], Generator[FeatureFlag, None, None]]) None

Given a list of flag enums from FeatureFlag, override_default_flags gets the flag mask to set all of the flags to true, and it overrides the current feature flag extended value to set these flags to true.

appian_locust._feature_toggle_helper.set_mobile_feature_flags(interactor: _Interactor) None

This overrides the feature flags to tell the service that the request is coming from a mobile device.

class appian_locust._grid_interactor.GridInteractor

Bases: object

Set of utility methods for interacting with grids, i.e. finding them, and manipulating them

_get_grid_data(paging_grid: Dict[str, Any]) Dict[str, Any]
_get_sort_info(field_name: str, ascending: bool) List[Dict[str, Any]]
_to_save_data(grid_data: Dict[str, Any], paging_grid: Dict[str, Any]) Dict[str, Any]
_validate_grid_field_or_label(field_name: str, paging_grid: Dict[str, Any]) str
find_grid_by_index(index: int, form: Dict[str, Any]) Dict[str, Any]
find_grid_by_label(label: str, form: Dict[str, Any]) Dict[str, Any]
find_grid_by_label_or_index(form: Dict[str, Any], label: str | None = None, index: int | None = None) Dict[str, Any]
format_grid_display_label(grid: Dict[str, Any]) str
move_to_first_page(paging_grid: Dict[str, Any]) Dict[str, Any]
move_to_last_page(paging_grid: Dict[str, Any]) Dict[str, Any]
move_to_the_left(paging_grid: Dict[str, Any]) Dict[str, Any]
move_to_the_right(paging_grid: Dict[str, Any]) Dict[str, Any]
select_rows(paging_grid: Dict[str, Any], rows: List[int], append_to_existing_selected: bool = False) Dict[str, Any]
sort_grid(field_name: str, paging_grid: Dict[str, Any], ascending: bool = False) Dict[str, Any]
validate_sort(field_name: str, paging_grid: Dict[str, Any]) None
class appian_locust._interactor.DataTypeCache

Bases: object

cache(response_in_json: Dict[str, Any]) None

From the given json response, finds and caches the data type :param response_in_json: response of the API request

clear() None

Clears the data type cache

get() str

Concatenates all cached data types and returns a string

Returns: concatenated cached data type string

class appian_locust._interactor._Interactor(session: HttpSession, host: str, portals_mode: bool = False, request_timeout: int = 300)

Bases: object

static _clean_filename(label: str) str
_make_file_metadata(doc_info: Dict[str, Any]) dict

Produces a file metadata object to use for multifile upload fields

Parameters:

id (int) – Document id of the object

Returns:

Dictionary of the multifile upload data

Return type:

dict

check_login(resp: ResponseContextManager) None

Given a response, checks to see if it’s possible that we are not logged in and then performs a login if we are not

Parameters:

resp – Response to check

Returns: None

check_post_response_for_valid_auth(resp: ResponseContextManager) None

Given a POST response, checks to see if we are correctly authenticated :param resp: POST request response to examine

Returns: None

click_button(post_url: str, component: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None, headers: Dict[str, Any] | None = None, client_mode: str | None = None) Dict[str, Any]

Calls the post operation to click certain SAIL components such as Buttons and Dynamic Links

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • component – the JSON code for the desired component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • label – the label to be displayed by locust for this action

  • headers – header for the REST API call

Returns: the response of post operation as json

click_component(post_url: str, component: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None, headers: Dict[str, Any] | None = None, client_mode: str | None = None) Dict[str, Any]

Calls the post operation to click certain SAIL components such as Buttons and Dynamic Links

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • component – the JSON code for the desired component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • label – the label to be displayed by locust for this action

  • headers – header for the REST API call

Returns: the response of post operation as json

click_generic_element(post_url: str, component: Dict[str, Any], context: Dict[str, Any], uuid: str, new_value: Dict[str, Any], label: str | None = None) Dict[str, Any]

Calls the post operation to click on a generic element

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • component – the JSON code for the component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • new_value – value for the payload

  • label – the label to be displayed by locust for this action

Returns: the response of post operation as json

Calls the post operation to click certain SAIL components such as Buttons and Dynamic Links

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • component – the JSON code for the desired component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • label – the label to be displayed by locust for this action

  • headers – header for the REST API call

Returns: the response of post operation as json

Use this function to interact specifically with record links, which represent links to new sail forms. :param get_url: the url (not including the host and domain) to navigate to :param component: the JSON code for the RecordLink :param context: the Sail context parsed from the json response :param label: the label to be displayed by locust for this action :param headers: header for the REST API call

Returns: the response of get RecordLink operation as json

click_record_list_action(component: Dict[str, Any], process_model_uuid: str, cache_key: str, locust_request_label: str | None = None) Dict[str, Any]
click_record_search_button(post_url: str, component: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]

Calls the post operation to click a record search button

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • component – the JSON code for the desired SearchBoxWidget component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • label – the label to be displayed by locust for this action

Returns: the response of post operation as json

Use this function to interact with related action links, which start a process and return the start form. This can handle both relation actions and related action links that open in a dialog.

Parameters:
  • component – the JSON representing the Related Action Link

  • record_type_stub – record type stub for the record

  • opaque_record_id – opaque id for the record

  • opaque_related_action_id – opaque id for the related action

  • locust_request_label – label to be used within locust

  • open_in_a_dialog – Does this link open in a dialog

Returns: the start form for the related action

click_selected_tab(post_url: str, tab_group_component: Dict[str, Any], tab_label: str, context: Dict[str, Any], uuid: str) Dict[str, Any]

Calls the post operation to send an update to a tabgroup to select a tab

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • tab_group_component – the JSON representing the desired TabButtonGroup SAIL component

  • tab_label – Label of the tab to select

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • label – the label of the tab to select. It is one of the tabs inside TabButtonGroup

Returns: the response of post operation as json

Use this function to interact with start process links, which start a process and return the start form. :param component: the JSON representing the Start Process Link :param process_model_opaque_id: opaque id for the process model of the Start Process Link :param cache_key: cachekey for the start process link :param site_name: name of site for link in starting process model. :param page_name: name of page for link in starting process model. :param group_name: name of group for link in starting process model, if there is one. :param is_mobile: indicates if it should hit the mobile endpoint. :param locust_request_label: label to be used within locust

Returns: the response of get Start Process Link operation as json

construct_and_send_dropdown_update(component: Any, choice_label: str, context: Dict[str, Any], state: Dict[str, Any], uuid: str, context_label: str, exception_label: str, reeval_url: str, identifier: Dict[str, Any] | None = None) Dict[str, Any]

Calls the post operation to send an update to a dropdown

Parameters:
  • component – the dropdown component to update

  • choice_label – Label of the dropdown

  • context – the Sail context parsed from the json response

  • state – the Sail state parsed from the json response

  • uuid – the uuid parsed from the json response

  • context_label – the label to be displayed by locust for this action

  • exception_label – information about the dropdown component to be displayed if there is an exception

  • reeval_url – URL for “rel”=”update”, which is used to do other interactions on the form

  • identifier – the Record List Identifier, if made on a Record List

Returns: the response of post operation as json

construct_and_send_multiple_dropdown_update(component: Any, choice_label: List[str], context: Dict[str, Any], state: Dict[str, Any], uuid: str, context_label: str, exception_label: str, reeval_url: str, identifier: Dict[str, Any] | None = None) Dict[str, Any]

Calls the post operation to send an update to a multiple dropdown

Parameters:
  • component – the multiple dropdown component to update

  • choice_label – Label(s) of the multiple dropdown item to select

  • context – the Sail context parsed from the json response

  • state – the Sail state parsed from the json response

  • uuid – the uuid parsed from the json response

  • context_label – the label to be displayed by locust for this action

  • exception_label – information about the multiple dropdown component to be displayed if there is an exception

  • reeval_url – URL for “rel”=”update”, which is used to do other interactions on the form

  • identifier – the Record List Identifier, if made on a Record List

Returns: the response of post operation as json

fetch_new_cascading_pickerfield_selection(pickfield_payload: List, locust_request_label: str = 'SelectCascadingPickerField') Dict[str, Any]
fill_cascading_pickerfield_request(request_payload: List, choice: Dict[str, Any]) List
fill_pickerfield_text(post_url: str, picker_field: Dict[str, Any], text: str, context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]

Fill a Picker field with the given text and randomly select one of the suggested item :param post_url: the url (not including the host and domain) to post to :param picker_field: the picker field component returned from find_component_by_attribute_in_dict :param text: the text to fill into the picker field :param context: the SAIL context parsed from the json response :param uuid: the uuid parsed from the json response :param label: the label to be displayed by locust for this action

Returns: the response of post operation as json

fill_textfield(post_url: str, text_field: Dict[str, Any], text: str, context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]

Fill a TextField with the given text :param post_url: the url (not including the host and domain) to post to :param text_field: the text field component returned from find_component_by_attribute_in_dict :param text: the text to fill into the text field :param context: the Sail context parsed from the json response :param uuid: the uuid parsed from the json response :param label: the label to be displayed by locust for this action

Returns: the response of post operation as json

find_selection_from_choices(selection: str, choices: List) Dict[str, Any] | None
get_interaction_host() str
get_page(uri: str, headers: Dict[str, Any] | None = None, label: str | None = None, check_login: bool = True) Response

Given a uri, executes GET request and returns response

Parameters:
  • uri – API URI to be called

  • headers – header for the REST API Call

  • label – the label to be displayed by locust

  • check_login – optional boolean to bypass checking if we are logged in

Returns: Json response of GET operation

get_primary_button_payload(page_content_in_json: Dict[str, Any]) Dict[str, Any]

Finds the primary button from the page content response and creates the payload which can be used to simulate a click

Parameters:

page_content_in_json – full page content that has a primary button

Returns: payload of the primary button

initialize_cascading_pickerfield_request(pickerfield_component: Dict[str, Any]) List
interact_with_record_grid(post_url: str, grid_component: Dict[str, Any], context: Dict[str, Any], uuid: str, identifier: Dict[str, Any] | None = None, context_label: str | None = None) Dict[str, Any]

Calls the post operation to send a record grid update

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • grid_component – the JSON dict representing the grid to update

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • identifier – the Record List Identifier, if made on a Record List

  • context_label – the label to be displayed by locust for this action

Returns: the response of post operation as json

login(auth: list | None = None, retry: bool = True, check_login: bool = True) Tuple[HttpSession, Response]
post_page(uri: str, payload: Any = {}, headers: Dict[str, Any] | None = None, label: str | None = None, files: dict | None = None, raise_error: bool = True, check_login: bool = True) Response

Given a uri, executes POST request and returns response

Parameters:
  • uri – API URI to be called

  • payload – Body of the API request. Can be either JSON or text input to allow for different payload types.

  • headers – header for the REST API Call

  • label – the label to be displayed by locust

Returns: Json response of post operation

refresh_after_record_action(post_url: str, record_action_component: Dict[str, Any], record_action_trigger_component: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]

Calls the post operation to refresh a form after completion of a record action

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • record_action_component – the JSON representing the relevant record action component

  • record_action_trigger_component – the JSON representing the form’s record action trigger component

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

Returns: the response of post operation as json

replace_base_path_if_appropriate(uri: str) str
select_checkbox_item(post_url: str, checkbox: Dict[str, Any], context: Dict[str, Any], uuid: str, indices: list, context_label: str | None = None) Dict[str, Any]

Calls the post operation to send an update to a checkbox to check all appropriate boxes

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • checkbox – the JSON representing the desired checkbox

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • indices – indices of the checkbox

  • label – the label to be displayed by locust for this action

  • headers – header for the REST API call

Returns: the response of post operation as json

select_pickerfield_suggestion(post_url: str, picker_field: Dict[str, Any], selection: Dict[str, Any], context: Dict[str, Any], uuid: str, label: str | None = None) Dict[str, Any]

Select a Picker field from available selections :param post_url: the url (not including the host and domain) to post to :param picker_field: the text field component returned from find_component_by_attribute_in_dict :param selection: the suggested item to select for the picker field :param context: the SAIL context parsed from the json response :param uuid: the uuid parsed from the json response :param label: the label to be displayed by locust for this action

Returns: the response of post operation as json

select_radio_button(post_url: str, buttons: Dict[str, Any], context: Dict[str, Any], uuid: str, index: int, context_label: str | None = None) Dict[str, Any]

Calls the post operation to send an update to a radio button to select the appropriate button

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • buttons – the JSON representing the desired radio button field

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • index – index of the button to be selected

  • label – the label to be displayed by locust for this action

  • headers – header for the REST API call

Returns: the response of post operation as json

send_dropdown_update(post_url: str, dropdown: Dict[str, Any], context: Dict[str, Any], uuid: str, index: int, identifier: Dict[str, Any] | None = None, label: str | None = None) Dict[str, Any]

Calls the post operation to send an update to a dropdown

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • dropdown – the JSON code for the desired dropdown

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • index – location of the dropdown value

  • identifier – the Record List Identifier, if made on a Record List

  • label – the label to be displayed by locust for this action

Returns: the response of post operation as json

send_multiple_dropdown_update(post_url: str, multi_dropdown: Dict[str, Any], context: Dict[str, Any], uuid: str, index: List[int], identifier: Dict[str, Any] | None = None, label: str | None = None) Dict[str, Any]

Calls the post operation to send an update to a multiple dropdown

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • dropdown – the JSON code for the desired dropdown

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • index – locations of the multiple dropdown value identifier: the Record List Identifier, if made on a Record List

  • label – the label to be displayed by locust for this action

Returns: the response of post operation as json

set_user_agent_to_desktop() None
set_user_agent_to_mobile() None
setup_content_headers() dict
setup_feed_headers() dict
setup_request_headers(uri: str | None = None) dict

Generates standard headers for session

Parameters:

uri (str) – URI to be assigned as the Referer

Returns (dict): headers

Examples

>>> self.appian._interactor.setup_request_headers()
setup_sail_headers() dict
update_date_field(post_url: str, date_field_component: Dict[str, Any], date_input: date, context: Dict[str, Any], uuid: str, locust_label: str | None = None) Dict[str, Any]

Calls the post operation to update a date field

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • date_field_component – the JSON representing the date field component

  • date_input – date field to convert to proper text format

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

Returns: the response of post operation as json

update_datetime_field(post_url: str, datetime_field: Dict[str, Any], datetime_input: datetime, context: Dict[str, Any], uuid: str, locust_label: str | None = None) Dict[str, Any]

Calls the post operation to update a date field

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • datetime_field – the JSON representing the datetime field to edit

  • datetime_input – datetime field to convert to the proper text format

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

Returns: the response of post operation as json

update_grid_from_sail_form(post_url: str, grid_component: Dict[str, Any], new_grid_save_value: Dict[str, Any], context: Dict[str, Any], uuid: str, context_label: str | None = None) Dict[str, Any]

Calls the post operation to send a grid update

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • grid_component – the JSON dict representing the grid to update

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • uuid – indices of the checkbox

  • context_label – the label to be displayed by locust for this action

Returns: the response of post operation as jso

upload_document_to_field(post_url: str, upload_field: Dict[str, Any], context: Dict[str, Any], uuid: str, doc_info: Dict[str, Any] | List[Dict[str, Any]], locust_label: str | None = None, client_mode: str = 'DESIGN') Dict[str, Any]

Calls the post operation to send an update to a upload_field to upload a document or list thereof. Requires a previously uploaded document id or ids

Parameters:
  • post_url – the url (not including the host and domain) to post to

  • upload_field – the JSON representing the desired checkbox

  • context – the Sail context parsed from the json response

  • uuid – the uuid parsed from the json response

  • doc_id – document id or list of document ids for the upload

  • context_label – the label to be displayed by locust for this action

  • client_mode – where this is being uploaded to, defaults to DESIGN

Returns: the response of post operation as json

upload_document_to_server(file_path: str, validate_extensions: bool = False, is_encrypted: bool = False) Dict[str, Any]

Uploads a document to the server, so that it can be used in upload fields :param uri: API URI to be called :param validate_extensions: if extensions should be validated :param file_path: Path to the file to be uploaded

Returns: Document Id that can be used for upload fields

write_response_to_lib_folder(label: str | None, response: Response) None

Used for internal testing, to grab the response and put it in a file of type JSON

Parameters:
  • label (Optional[str]) – Optional label, used to name the file

  • response (Response) – Response object to write to a file

Writes to a recorded_responses folder from wherever you run locust

appian_locust._locust_error_handler._format_http_error(resp: Response, uri: str, username: str) str
Taken from Response.raise_for_status. Formats the http error message,

additionally adding the username

Parameters:
  • resp (Response) – Response to generate an http error message from

  • uri (str) – URI accessed as part of the request

  • username (str) – Username of the calling user

Returns:

the http error message to use

Return type:

str

appian_locust._locust_error_handler.test_response_for_error(resp: ResponseContextManager, uri: str = 'No URI Specified', raise_error: bool = True, username: str = '', name: str = '') None

Locust relies on errors to be logged to the global_stats attribute for error handling. This function is used to notify Locust that its instances are failing and that it should fail too.

Parameters:
  • resp (Response) – a python response object from a client.get() or client.post() call in Locust tests.

  • uri (Str) – URI in the request that caused the above response.

  • username (Str) – identifies the current user when we use multiple different users for locust test)

Returns:

None

Example (Returns a HTTP 500 error):

username = 'admin'
uri = 'https://httpbin.org/status/500'
with self.client.get(uri) as resp:
  test_response_for_error(resp, uri, username)
class appian_locust._news._News(interactor: _Interactor)

Bases: _Base

_visit_internal(news_name: str, exact_match: bool = True, search_string: str | None = None) Tuple
fetch_news_entry_record_tags(news_entry_id: str, locust_request_label: str) Response
get_all(search_string: str | None = None, locust_request_label: str = '') Dict[str, Any]

Retrieves all the available “news” and associated metadata from “Appian-Tempo-News”

Note: All the retrieved data about news is stored in the private variable self._news

Parameters:

search_string (str, optional) – results will be filtered based on the search string.

Returns (dict): List of news and associated metadata

Examples

>>> self.appian.action.get_all()
get_news(news_name: str, exact_match: bool = True, search_string: str | None = None) Dict[str, Any]

Get the information about specific news by name.

Parameters:
  • news_name (str) – name of the news entry

  • exact_match (bool, optional) – Should news name match exactly or to be partial match. Default : True

  • search_string (str, optional) – results will be filtered based on the search string.

Returns: Specific News’s info

Raises: In case news is not found in the system, it throws an “Exception”

Example

If full name of action is known,

>>> self.appian.news.get("news_name")

If only partial name is known,

>>> self.appian.news.get("news_name", exact_match=False)
search(search_string: str = '*') Dict[str, Any]
visit(news_name: str, exact_match: bool = True, search_string: str | None = None) None

This function calls the nav API for the specific news item and its related records if any

Parameters:
  • news_name (str) – Name of the news entry to be called

  • exact_match (bool, optional) – Should news name match exactly or to be partial match. Default : True

  • search_string (str, optional) – results will be filtered based on the search string.

Returns: None

Examples

If full name of news is known,

>>> self.appian.news.visit("news_name")

If only partial name is known,

>>> self.appian.news.visit("news_name", exact_match=False)
visit_news_entry(news_name: str, exact_match: bool = True, search_string: str | None = None) Tuple

This function simulates navigating to a single entry in the ui. There are two parts to navigating to a news entry: navigating to the view and getting the news entry’s feed.

Parameters:
  • news_name (str) – Name of the news entry to be called

  • exact_match (bool, optional) – Should news name match exactly or to be partial match. Default : True

  • search_string (str, optional) – results will be filtered based on the search string.

Returns (Tuple): Response codes for the view navigation and getting the feed entry

Examples

If full name of news is known,

>>> self.appian.news.visit("news_name")

If only partial name is known,

>>> self.appian.news.visit("news_name", exact_match=False)
class appian_locust._portals._Portals(interactor: _Interactor)

Bases: object

fetch_page_json(portal_unique_identifier: str, portal_page__unique_identifier: str, locust_request_label: str | None = None) Dict[str, Any]

Navigates to specific portal’s page

Returns: The response of portal’s page

static get_full_url(portal_unique_identifier: str, portal_page__unique_identifier: str) str
class appian_locust._rdo_interactor._RDOInteractor(interactor: _Interactor, rdo_host: str)

Bases: _Interactor

_make_mlas_file_metadata(id: int, doc_size: int, position: int, file_name: str) dict

Produces a file metadata object to use for multifile upload fields

ai_skill_creation_payload(jwt_token: str, app_prefix: str) dict
ai_skill_creation_save_payload(state: Dict[str, Any], object_uuid: str) dict
fetch_ai_skill_creation_dialog_json(app_prefix: str, locust_request_label: str = 'AISkill.CreateDialog') Dict[str, Any]
fetch_ai_skill_creation_save_dialog_json(state: Dict[str, Any], rdo_state: Dict[str, Any], locust_request_label: str = 'AISkill.CreationSaveDialog') Dict[str, Any]
fetch_ai_skill_designer_json(ai_skill_id: str, locust_request_label: str | None = None) Dict[str, Any]
fetch_jwt_token() Tuple
get_interaction_host() str
get_presigned_url(ai_skill_id: str, model_id: str) dict
patch_page(uri: str, payload: Any = {}, headers: Dict[str, Any] | None = None, label: str | None = None, files: dict | None = None, raise_error: bool = True) Response
persist_ai_skill_changes_to_rdo(ai_skill_id: str, state: Dict[str, Any], locust_request_label: str | None = None) Dict[str, Any]
post_page(uri: str, payload: Any = {}, headers: Dict[str, Any] | None = None, label: str | None = None, files: dict | None = None, raise_error: bool = True, check_login: bool = True) Response

Given a uri, executes POST request and returns response

Parameters:
  • uri – API URI to be called

  • payload – Body of the API request. Can be either JSON or text input to allow for different payload types.

  • headers – header for the REST API Call

  • label – the label to be displayed by locust

Returns: Json response of post operation

put_page(uri: str, payload: Any = {}, headers: Dict[str, Any] | None = None, label: str | None = None, files: dict | None = None, raise_error: bool = True) Response
save_ai_skill_ui_request(component: Dict[str, Any], context: Dict[str, Any], uuid: str, value: Dict[str, Any], locust_request_label: str | None = None) Dict[str, Any]
setup_mlas_file_upload_headers(kms_id: str) dict
setup_rdo_ui_request_headers() dict
upload_document_to_ai_skill_server(file_path: str, ai_skill_id: str, model_id: str, locust_request_label: str | None = None) Tuple[Any, int]
upload_document_to_mlas_field(upload_field: Dict[str, Any], context: Dict[str, Any], uuid: str, file_infos: List[Dict[str, Any]], locust_label: str | None = None) Dict[str, Any]
v1_post_request(jwt_token: str, rdo_csrf_token: str) Any
class appian_locust._records._Records(interactor: _Interactor, is_mobile_client: bool = False)

Bases: _Base

_get_mobile_records_uri(record_type_url_stub: str, search_string: str | None = None) str
_get_random_record_instance(record_type: str = '') Tuple[str, str]
_get_random_record_type() str
_is_response_good(response_text: str) bool
_record_type_list_request(record_type: str, is_mobile: bool = False, search_string: str | None = None, locust_request_label: str | None = None) Dict[str, Any]
fetch_all_records_json(locust_request_label: str = 'Records') Dict[str, Any]
fetch_record_instance(record_type: str, record_name: str, exact_match: bool = True) Dict[str, Any]

Get the information about a specific record by specifying its name and its record type.

Parameters:
  • record_type (str) – Name of the record type.

  • record_name (str) – Name of the record which should be available in the given record type

  • exact_match (bool) – Should record name match exactly or to be partial match. Default : True

Returns (dict): Specific record’s info

Raises: In case of record is not found in the system, it throws an “Exception”

Example

If full name of record type and record is known,

>>> self.appian.records.get("record_type_name", "record_name")

If only partial name is known,

>>> self.appian.records.get("record_type_name", "record_name", exact_match=False)
fetch_record_type(record_type: str, exact_match: bool = True) Dict[str, Any]

Fetch information about record type from the cache. Raises Exception if record type does not exist in cache.

Parameters:

record_type (str) – Name of the record type.

Returns (dict): Specific record type’s info

Raises: In case the record type is not found in the system, it throws an “Exception”

Example

>>> self.appian.records.get_record_type("record_type_name")
fetch_record_type_json(record_type_url_stub: str, is_mobile: bool = False, search_string: str | None = None, label: str | None = None) Dict[str, Any]
get_all(search_string: str | None = None, locust_request_label: str = 'Records') Dict[str, Any]

Retrieves all available “records types” and “records” and associated metadata from “Appian-Tempo-Records”

Note: All the retrieved data about record types and records is stored in the private variables self._record_types and self._records respectively

Returns (dict): List of records and associated metadata

get_all_record_types(locust_request_label: str = 'Records') Dict[str, Any]

Navigate to Tempo Records Tab and load all metadata for associated list of record types into cache.

Returns (dict): List of record types and associated metadata

get_all_records_of_record_type(record_type: str, column_index: int | None = None, search_string: str | None = None) Dict[str, Any]

Navigate to the desired record type and load all metadata for the associated list of record views into cache.

Parameters:
  • record_type (str) – Name of record type for which we want to enumerate the record instances.

  • column_index (int, optional) – Column index to only fetch record links from a specific column, starts at 0.

Returns (dict): List of records and associated metadata

Examples

>>> self.appian.records.get_all_records_of_record_type("record_type_name")
get_record(record_type: str, record_name: str, exact_match: bool = True) Dict[str, Any]

Get the information about a specific record by specifying its name and its record type.

Parameters:
  • record_type (str) – Name of the record type.

  • record_name (str) – Name of the record which should be available in the given record type

  • exact_match (bool) – Should record name match exactly or to be partial match. Default : True

Returns (dict): Specific record’s info

Raises: In case of record is not found in the system, it throws an “Exception”

Example

If full name of record type and record is known,

>>> self.appian.records.get("record_type_name", "record_name")

If only partial name is known,

>>> self.appian.records.get("record_type_name", "record_name", exact_match=False)
get_records_interface(locust_request_label: str | None = 'Records') Dict[str, Any]
get_records_nav(locust_request_label: str | None = 'Records') Dict[str, Any]
visit(record_type: str = '', record_name: str = '', view_url_stub: str = '', exact_match: bool = True, locust_request_label: str | None = None) Dict[str, Any]

This function calls the API for the specific record view/instance to get its response data.

Note: This function is meant to only traverse to Record forms, not to interact with them. For that, use visit_record_instance_and_get_form()

Parameters:
  • record_type (str) – Record Type Name. If not specified, a random record type will be selected.

  • record_name (str) – Name of the record to be called. If not specified, a random record will be selected.

  • view_url_stub (str, optional) – page/tab to be visited in the record. If not specified, “summary” dashboard will be selected.

  • exact_match (bool, optional) – Should record type and record name matched exactly as it is or partial match.

  • locust_request_label (str,optional) – Label used to identify the request for locust statistics

Returns (dict): Responses of Record’s Get UI call in a dictionary

Examples

If full name of record type and record is known,

>>> self.appian.records.visit_record_instance("record_type_name", "record_name", "summary")

If only partial name is known,

>>> self.appian.records.visit_record_instance("record_type_name", "record_name", "summary", exact_match=False)

If a random record is desired,

>>> self.appian.records.visit_record_instance()

If random record of a specific record type is desired,

>>> self.appian.records.visit_record_instance("record_type_name")
visit_record_instance(record_type: str = '', record_name: str = '', view_url_stub: str = '', exact_match: bool = True, locust_request_label: str | None = None) Dict[str, Any]

This function calls the API for the specific record view/instance to get its response data.

Note: This function is meant to only traverse to Record forms, not to interact with them. For that, use visit_record_instance_and_get_form()

Parameters:
  • record_type (str) – Record Type Name. If not specified, a random record type will be selected.

  • record_name (str) – Name of the record to be called. If not specified, a random record will be selected.

  • view_url_stub (str, optional) – page/tab to be visited in the record. If not specified, “summary” dashboard will be selected.

  • exact_match (bool, optional) – Should record type and record name matched exactly as it is or partial match.

  • locust_request_label (str,optional) – Label used to identify the request for locust statistics

Returns (dict): Responses of Record’s Get UI call in a dictionary

Examples

If full name of record type and record is known,

>>> self.appian.records.visit_record_instance("record_type_name", "record_name", "summary")

If only partial name is known,

>>> self.appian.records.visit_record_instance("record_type_name", "record_name", "summary", exact_match=False)

If a random record is desired,

>>> self.appian.records.visit_record_instance()

If random record of a specific record type is desired,

>>> self.appian.records.visit_record_instance("record_type_name")
visit_record_type(record_type: str = '', locust_request_label: str | None = None) Dict[str, Any]

Navigate into desired record type and retrieve all metadata for associated list of record views.

Returns (dict): List of records and associated metadata

Examples

>>> self.appian.records.visit_record_type("record_type_name")
appian_locust._records_helper._get_feedItemLayout_label(item: Dict[str, Any]) str
appian_locust._records_helper._get_linkedItem_label(item: Dict[str, Any]) str
appian_locust._records_helper._is_grid(res_dict_var: Dict[str, Any]) bool
appian_locust._records_helper.get_all_record_types_from_json(json_response: Dict[str, Any]) Dict[str, Any]
appian_locust._records_helper.get_all_records_from_json(json_response: Dict[str, Any]) Tuple[Dict[str, Any], int]
appian_locust._records_helper.get_record_header_response(form_json: Dict[str, Any]) Dict[str, Any]

This returns the contents of “x-embedded-header” from Record Instance’s Feed response. Header response is needed in cases like clicking on a related action.

appian_locust._records_helper.get_record_summary_view_response(form_json: Dict[str, Any]) Dict[str, Any]

This returns the contents of “x-embedded-summary” from Record Instance’s Feed response

appian_locust._records_helper.get_records_from_json_by_column(json_response: Dict[str, Any], column_index: int) Tuple[Dict[str, Any], int]
appian_locust._records_helper.get_url_stub_from_record_list_post_request_url(post_url: str | None) str | None

Given post_url, returns the URL stub IF the url matches the url for a record list. If not, returns None.

Parameters:

post_url – the post request url (not including the host and domain) to post to

Returns: The url stub if post_url matches a record instance list url, otherwise None

appian_locust._records_helper.get_url_stub_from_record_list_url_path(url: str | None) str | None

Attempts to parse the url stub the url of a record list. It should only be able to parse the url stub if the page is a record list. If the url stub cannot be parsed, returns None.

Parameters:

url – url path to attempt to parse the record list URL stub from

Returns: The url stub if post_url matches a record list url, otherwise None

class appian_locust._reports._Reports(interactor: _Interactor)

Bases: _Base

fetch_report_json(report_name: str, exact_match: bool = True, locust_request_label: str | None = None) Dict[str, Any]

This function calls the API for the specific report to get its “form” data

Parameters:
  • report_name (str) – Name of the report to be called.

  • exact_match (bool, optional) – Should report name match exactly or to be partial match. Default : True

  • locust_request_label (str, optional) – Label locust should associate this request with

Returns (dict): Response of report’s Get UI call in dictionary

Examples

If full name of report is known,

>>> self.appian.reports.fetch_report_json("report_name")

If only partial name is known,

>>> self.appian.reports.fetch_report_json("report_name", exact_match=False)
get_all(search_string: str | None = None, locust_request_label: str = 'Reports.Feed') Dict[str, Any]

Retrieves all the available “reports” and associated metadata from “Appian-Tempo-Reports”

Note: All the retrieved data about reports is stored in the private variable self._reports

Returns (dict): List of reports and associated metadata

Examples

>>> self.appian.reports.get_all()
get_report(report_name: str, exact_match: bool = True) Dict[str, Any]

Get the information about specific report by name.

Parameters:
  • report_name (str) – Name of the report

  • exact_match (bool) – Should report name match exactly or to be partial match. Default : True

Returns (dict): Specific Report’s info

Raises: In case of report is not found in the system, it throws an “Exception”

Example

If full name of report is known,

>>> self.appian.reports.get("report_name")

If only partial name is known,

>>> self.appian.reports.get("report_name", exact_match=False)
get_report_form_uri(report_name: str, exact_match: bool = True) str
get_reports_interface(locust_request_label: str = 'Reports') Dict[str, Any]
get_reports_nav(locust_request_label: str = 'Reports') Dict[str, Any]
class appian_locust._save_request_builder._SaveRequestBuilder

Bases: object

Builds a save request, that can be used to trigger saves on the UI

build() Dict[str, Any]
component(component: Dict[str, Any]) _SaveRequestBuilder
context(context: Dict[str, Any]) _SaveRequestBuilder
identifier(identifier: Dict[str, Any] | None) _SaveRequestBuilder
uuid(uuid: str) _SaveRequestBuilder
value(value: dict | list) _SaveRequestBuilder
appian_locust._save_request_builder.save_builder() _SaveRequestBuilder
class appian_locust._sites._Sites(interactor: _Interactor)

Bases: _Base

BROWSER_ACCEPT_HEADER = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'
_get_and_memoize_site_data_from_ui(initial_nav_json: Dict[str, Any], site_name: str, display_name: str) Site
_get_page_from_json(site_name: str, page_info_json: Dict[str, Any]) Page | None
_setup_headers_with_accept() dict
_setup_headers_with_sail_json() dict
fetch_site_page_metadata(site_name: str, page_name: str, group_name: str | None = None) Page | None

Gets site page from the site url stub and page url stub

Parameters:
  • site_name – Site url stub

  • page_name – Page url stub

  • group_name – Group url stub, if there is one

Returns: Page object, representing an individual page of a site

fetch_site_tab_json(site_name: str, page_name: str, locust_request_label: str | None = None) Dict[str, Any]

Navigates to a site page, either a record, action or report.

Parameters:
  • site_name – Site Url stub

  • page_name – Page Url stub

  • locust_request_label (str, optional) – Label locust should associate this request with

Returns: Response of report/action/record

fetch_site_tab_record_json(site_name: str, page_name: str, locust_request_label: str | None = None) Dict[str, Any]

Navigate to a recordList page on a site, then grab a random page from that site

Note: Any record available in the record list as a recordLink will be hit using this function. There is no guarantee that this record will be of any specific type and may not point to a record view.

Parameters:
  • site_name – Site Url stub

  • page_name – Page Url stub

  • locust_request_label (str, optional) – Label locust should associate this request with

Returns: Response of report/action, or in the case of a record, response of record object

get_all(search_string: str | None = None, locust_request_label: str | None = None) Dict[str, Any]

Gets and stores data for all sites, including all of their url stubs

get_site_data_by_site_name(site_name: str) Site

Gets site data from just the site url stub

Parameters:

site_name – Site url stub

Returns: Site object, containing the site name and pages

get_site_page(site_name: str, page_name: str) Page
get_site_page_type(site_name: str, page_name: str) PageType
class appian_locust._task_opener._TaskOpener(interactor: _Interactor)

Bases: object

accept_a_task(payload: str, task_id: str, headers: Dict[str, Any] | None = None, task_title: str = '', locust_request_label: str = '') Dict[str, Any]

Accept a task if necessary

Parameters:
  • payload (str) – string to send as part of accepting a task

  • task_id (str) – task identifier

  • headers (Dict[str, Any], optional) – Headers to send. Defaults to {}.

  • task_title (str, optional) – Task title used to describe the interaction. Defaults to “”.

  • locust_request_label (str, optional) – label to be used within locust

Returns:

Response from accepting

Return type:

Dict[str, Any]

visit_by_task_id(task_title: str, task_id: str, extra_headers: Dict[str, Any] | None = None, locust_request_label: str = '') Dict[str, Any]

Vist a task page and the corresponding json using the task_id

Parameters:
  • task_title (str) – Title to identify the task

  • task_id (str) – Id used to navigate to the task

  • extra_headers (Dict[str, Any], optional) – Extra headers, used for sites requests. Defaults to None.

  • locust_request_label (str, optional) – label to be used within locust

Returns:

State returned by visiting the task

Return type:

Dict[str, Any]

class appian_locust._tasks._Tasks(interactor: _Interactor)

Bases: _Base

INITIAL_FEED_URI = '/suite/api/feed/tempo?m=menu-tasks&t=t&s=pt&defaultFacets=%255Bstatus-open%255D'
get_all(search_string: str | None = None, locust_request_label: str = 'Tasks') Dict[str, Any]

Retrieves all the available “tasks” and associated metadata from “Appian-Tempo-Tasks”

Note: All the retrieved data about tasks is stored in the private variable self._tasks

Returns (dict): List of tasks and associated metadata

Examples

>>> self.appian.task.get_all()
get_next_task_page_uri(get_default: bool = True) str | None

Retrieves the next URI in the sequence of Task pages being fetched using self.get_task_pages().

If the previous call to self.get_task_pages() reached the end of the available pages then this method will return either a value of None or the default initial page URI depending on the get_default argument.

Returns (str): The URI for the next page of Tasks (or the first page if the previous page fetches

reached the end).

get_task(task_name: str, exact_match: bool = True) Dict[str, Any]

Get the information about specific task by name.

Parameters:
  • task_name (str) – Name of the task

  • exact_match (bool) – Should task name match exactly or to be partial match. Default : True

Returns (dict): Specific task’s info

Raises: In case of task is not found in the system, it throws an “Exception”

Example

If full name of task is known,

>>> self.appian.task.get("task_name")

If only partial name is known,

>>> self.appian.task.get("task_name", exact_match=False)
get_task_form_json(task_name: str, locust_request_label: str = '', exact_match: bool = True) Dict[str, Any]

This function calls the API for the specific task to get its “form” data

Parameters:
  • task_name (str) – Name of the task to be called.

  • exact_match (bool, optional) – Should task name match exactly or to be partial match. Default : True

Returns (dict): Response of task’s Get UI call in dictionary

Examples

If full name of task is known,

>>> self.appian.task.get_task_form_json("task_name")

If only partial name is known,

>>> self.appian.task.get_task_form_json("task_name", exact_match=False)
get_task_pages(locust_request_label: str = 'Tasks', next_uri: str | None = '/suite/api/feed/tempo?m=menu-tasks&t=t&s=pt&defaultFacets=%255Bstatus-open%255D', pages_requested: int = -1) Dict[str, Any]

Retrieves all the available “tasks” and associated metadata from “Appian-Tempo-Tasks”

If the next_uri argument is specified then the calls to fetch tasks will begin at that URI. If omitted the fetching starts at the first page of Tasks. This can be useful for fetching a subset of pages one call at a time. To control the number of pages fetched use the page_count argument. The default of -1 means fetch all pages (starting from the given URI.

Note: If the page_count is used and is less than the total number of pages available then the URI of the _next_ page in the sequence will be stored in self._next_uri and can be fetched with self.get_next_task_page_uri()

Note: All the retrieved data about tasks is stored in the private variable self._tasks

Returns (dict): List of tasks and associated metadata

Examples:

Start at the first page and get all content from that point forward:

>>> self.appian.task.get_task_pages()

Start at the next page (from the previous call to get_task_pages) and fetch the next three pages of Tasks:

>>> self.appian.task.get_task_pages(next_uri=self.get_next_task_page_uri(), pages_requested=3)
class appian_locust._ui_reconciler.UiReconciler

Bases: object

CID_KEY = '_cId'

Reconciles the SAIL UI, based on the different responses passed

COMPONENT_DELTA_TYPE = 'UiComponentsDelta'
MODIFIED_COMPONENTS_KEY = 'modifiedComponents'
_traverse_and_update_state(state: Any, cid_to_component: dict) None

Moves through a dict recursively, swapping out any components that have been modified with new ones

reconcile_ui(old_state: dict, new_state: dict) dict
In the case where components are simply modified:

Makes a copy of the old_state, and applies whichever changes are necessary from the new_state

In the case where a completely new UI is returned:

Replaces the old state with the new state