ocs_ci.ocs.ui.page_objects package

Submodules

ocs_ci.ocs.ui.page_objects.alerting module

class ocs_ci.ocs.ui.page_objects.alerting.AlertDetails

Bases: PageNavigator

Alert Details page object

get_raw_runbook()

Get Runbook

Returns:

Runbook page

Return type:

Runbook

Get Runbook Link

Returns:

Runbook link

Return type:

str

class ocs_ci.ocs.ui.page_objects.alerting.Alerting

Bases: PageNavigator

Alerting page that contains 3 tabs - Alerts, Silences and Alerting Rules The default tab is Alerts

nav_alerting_rules()

Navigate to Alerting Rules tab

Returns:

Alerting Rules page

Return type:

AlertingRules

nav_alerts()

Navigate to Alerts tab. Default tab when opening the Alerting page

Returns:

Alerts page

Return type:

Alerts

nav_silences()

Navigate to Silences tab

Returns:

Silences page

Return type:

Silences

class ocs_ci.ocs.ui.page_objects.alerting.AlertingRules

Bases: Alerting, SearchBar

Alerting Rules page object. Contains all the alerts existing in the cluster that are being monitored. Use ‘oc get prometheusrules -n openshift-storage ocs-prometheus-rules -o yaml’ to get the list of alerts

navigate_alerting_rule_details(alert_name)

Navigate to Alerting Rule Details

Parameters:

alert_name (str) – Alert name

Returns:

Alert Rule Details page

Return type:

AlertDetails

class ocs_ci.ocs.ui.page_objects.alerting.Alerts

Bases: Alerting, SearchBar

Alerts page object

search_alert(search_text)

Search for Alerts

Parameters:

search_text (str) – Text to search

class ocs_ci.ocs.ui.page_objects.alerting.Runbook(text=None, runbook_hash=None)

Bases: object

Runbook object used for checking the runbook content. May be instantiated with the runbook hash value as expected result for the test; If the runbook hash value is not provided, text should be provided and the hash value will be calculated

check_text_content(headers, *args)

Check if the text is valid

Returns:

True if the text is valid, False otherwise

Return type:

bool

class ocs_ci.ocs.ui.page_objects.alerting.Silences

Bases: Alerting

Silences page object where all the silences are listed and new silences may be created.

Convert GitHub link to raw link

Parameters:

link (str) – GitHub link

Returns:

Raw GitHub link or None if the link is not valid

ocs_ci.ocs.ui.page_objects.backing_store_tab module

class ocs_ci.ocs.ui.page_objects.backing_store_tab.BackingStoreTab

Bases: ObjectStorage, CreateResourceForm

nav_backing_store_list_breadcrumb()

Navigate to backing store breadcrumbs

nav_to_backing_store(backing_store_name: str)

Navigate to backing store page

Parameters:

backing_store_name (str) – backing store name

validate_backing_store_ready() bool

Validate backing store is Ready :returns: True if backing store is Ready, False otherwise :rtype: bool

ocs_ci.ocs.ui.page_objects.block_and_file module

class ocs_ci.ocs.ui.page_objects.block_and_file.BlockAndFile

Bases: StorageSystemDetails

check_pvc_to_namespace_ui_card(namespace, check_name: str)

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / ocs-storagecluster-cephblockpool

Method to check that the pvc’s from the UI are the same as the expected pvc’s. For each pvc, initially added, filled and saved in PvcCapacityDeploymentList the method checks that the pvc is displayed in the UI, and the value under each PVC name matches to expected.

Important that the method is called after the pvc’s are created and filled in PvcCapacityDeploymentList.

Parameters:
  • namespace (str) – Namespace name to select

  • check_name (str) – Name of the check to be displayed in the report

Returns:

Dictionary of the check results or None if all checks passed

Return type:

dict

read_capacity_breakdown()

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / ocs-storagecluster-cephblockpool Read the capacity breakdown from the table

Returns:

Dictionary of capacity breakdown

Return type:

dict

select_capacity_resource(resource_name: str, namespace_name: str | None = None)

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / Block and File Select the capacity resource from the dropdown

Parameters:
  • resource_name (str) – resource name to select

  • namespace_name (str) – namespace name to select

select_namespace_for_pvcs(namespace_name: str)

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / Block and File Select the namespace for PVs from the dropdown

Parameters:
  • namespace_name (str) – Namespace name to select. Namespace should be unique,

  • selected (otherwise the first one will be) –

select_requested_capacity_dropdown(dropdown_val: str)

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / Block and File Select the requested capacity from the dropdown

Parameters:

dropdown_val (str) – Dropdown value to select

ocs_ci.ocs.ui.page_objects.block_pools module

class ocs_ci.ocs.ui.page_objects.block_pools.BlockPools(block_pool_existed: list | None = None)

Bases: StorageSystemDetails, CreateResourceForm, EditLabelForm, SearchBar

delete_block_pool(block_pool_name: str, cannot_be_deleted: bool = False)

Deletes the block pool, does not verify the deletion, but verifies the alert if the block pool cannot be deleted

Parameters:
  • block_pool_name (str) – Name of the block pool to be deleted

  • cannot_be_deleted (bool) – Whether the block pool cannot be deleted

Returns:

True if the block pool delete via UI performed, False otherwise

Return type:

bool

is_block_pool_exist(block_pool_name: str)

Checks if the block pool exists in the list

Parameters:

block_pool_name (str) – Name of the block pool

verify_cephblockpool_status(status_exp: str = 'Ready')

ocs_ci.ocs.ui.page_objects.bucket_class_tab module

class ocs_ci.ocs.ui.page_objects.bucket_class_tab.BucketClassTab

Bases: ObjectStorage, CreateResourceForm

nav_bucket_class_breadcrumb()

Navigate to bucket class breadcrumb

nav_to_bucket_class(bucket_class_name: str)

Navigate to bucket class with the given name.

Parameters:

bucket_class_name (str) – bucket class name

validate_bucket_class_ready() bool

Validate the status of default bucket class is ‘Ready’

Returns:

True if the status of default bucket class is ‘Ready’, False otherwise.

Return type:

bool

ocs_ci.ocs.ui.page_objects.data_foundation_tabs_common module

class ocs_ci.ocs.ui.page_objects.data_foundation_tabs_common.CreateResourceForm

Bases: PageNavigator

check_error_messages()

Performs a series of checks to verify if the error messages for the input fields meet the expected requirements. It clicks on the “create resource” button and verifies the existence of all expected rules in the input field. It then checks the error messages for each input field based on the expected rules and raises a failure if the actual error message does not match the expected message. Finally, it navigates back to the previous page.

create_store(store_name: str, provider: str, region: str, secret: str, uls_name: str)

Create backing store via UI.

! Backing Store with PVC option is not supported yet ! ! Namespace Store with FS option is supported with NamespaceStoreUI().create_namespace_store() !

Parameters:
  • store_name (str) – backing store name

  • provider (str) – backing store provider

  • region (str) – backing store region

  • secret (str) – backing store secret

  • uls_name (str) – uls name

Returns:

The page object of the newly created Store (Namespace store or Backing Store)

Return type:

ResourcePage

proceed_resource_creation()

Method to proceed to resource creation form, when Create button is visible

class ocs_ci.ocs.ui.page_objects.data_foundation_tabs_common.DataFoundationDefaultTab

Bases: DataFoundationTabBar

Default Foundation default Tab: TopologyTab | OverviewTab

is_overview_tab()

Check if the current tab is Overview tab

Returns:

True if the current tab is Overview tab, False otherwise

Return type:

bool

class ocs_ci.ocs.ui.page_objects.data_foundation_tabs_common.DataFoundationTabBar

Bases: PageNavigator

nav_overview_tab()

Navigate to Overview tab. Accessible from any Data Foundation tabs

nav_storage_systems_tab()

Navigate to Storage Systems tab. Accessible from any Data Foundation tabs

nav_topology_tab()

Navigate to ODF Topology tab. Accessible from any Data Foundation tabs

ocs_ci.ocs.ui.page_objects.edit_label_form module

class ocs_ci.ocs.ui.page_objects.edit_label_form.EditLabelForm

Bases: BaseUI

cancel_edit_label()

Cancel the edit label operation.

check_edit_labels(block_pool_name: str | None = None)
Method to validate that warning message appears when input rule is violated
Rule (visible on warning):

Labels must start and end with an alphanumeric character, can consist of lower-case letters, numbers and non-consecutive dots (.), and hyphens (-), forward slash (/), underscore(_) and equal to (=)

Error (visible on metadata.label rule violated):

Error “Invalid value: <value>: name part must consist of alphanumeric characters, ‘-’, ‘_’ or ‘.’, and must start and end with an alphanumeric character (e.g. ‘MyName’, or ‘my.name’, or ‘123-abc’, regex used for validation is <regex> for field “metadata.labels”.

Args:
block_pool_name (str): Name of the block pool. If not provided, the value will be retrieved from the

instance attribute block_pool_name if available. If neither block_pool_name argument nor the instance attribute is provided, an IncorrectUIOptionRequested exception will be raised.

Returns:

bool: The result of the validation.

Raises:
IncorrectUIOptionRequested: If block_pool_name argument is not provided and the instance attribute

block_pool_name is not available.

enter_label_and_save(label)

Enter the specified label in the edit label input field and save it.

Parameters:

label (str) – The label to enter.

open_edit_label_of_block_pool(block_pool_name)

Opens the edit label popup of a Block Pool specified by the given block_pool_name.

Parameters:

block_pool_name (str) – The name of the block pool to open the edit label page for.

save_edit_label()

Save the changes made in the edit label operation.

ocs_ci.ocs.ui.page_objects.namespace_store_tab module

class ocs_ci.ocs.ui.page_objects.namespace_store_tab.NameSpaceStoreTab

Bases: ObjectStorage, CreateResourceForm

is_namespace_store_tab_active()

Check if namespace store tab is selected

Returns:

True if namespace store tab is selected, False otherwise

Return type:

bool

ocs_ci.ocs.ui.page_objects.object_bucket_claims_tab module

class ocs_ci.ocs.ui.page_objects.object_bucket_claims_tab.ObjectBucketClaimsTab

Bases: ObjectStorage, CreateResourceForm

A class representation for abstraction of OBC-related OpenShift UI actions

check_obc_option(username, text='Object Bucket Claims')

Check OBC is visible to user after giving admin access

Parameters:
  • username (str) – user’s username

  • text (str) – text to be found on OBC page

create_obc_ui(obc_name, storageclass, bucketclass=None)

Create an OBC via the UI

Parameters:
  • obc_name (str) – The name to grant the OBC

  • storageclass (str) – The storageclass to be used by the OBC

  • bucketclass (str) – The bucketclass to be used by the OBC

Returns:

The page object of the newly created OBC

Return type:

ResourcePage

delete_obc_ui(obc_name, delete_via)

Delete an OBC via the UI

obc_name (str): Name of the OBC to be deleted delete_via (str): delete via ‘OBC/Actions’ or via ‘three dots’

select_openshift_storage_default_project()

Helper function to select openshift-storage project

Notice: the func works from PersistantVolumeClaims, VolumeSnapshots and OBC pages

ocs_ci.ocs.ui.page_objects.object_buckets_tab module

class ocs_ci.ocs.ui.page_objects.object_buckets_tab.ObjectBucketsTab

Bases: ObjectStorage

delete_object_bucket_ui(delete_via, expect_fail, resource_name)

Delete an Object Bucket via the UI

delete_via (str): delete via ‘OB/Actions’ or via ‘three dots’ expect_fail (str): verify if OB removal fails with proper PopUp message resource_name (str): Object Bucket Claim’s name. The resource with its suffix will be deleted

ocs_ci.ocs.ui.page_objects.object_storage module

class ocs_ci.ocs.ui.page_objects.object_storage.ObjectStorage

Bases: PageNavigator, ResourceList

Object Service page object under PageNavigator / Storage (version 4.14 and above)

nav_backing_store_tab()

Navigate to Backing Store tab. Accessible from Object Storage page

Returns:

BackingStoreTab page object

Return type:

BackingStoreTab

nav_bucket_class_tab()

Navigate to Bucket class tab. Accessible from Object Storage page

Returns:

BucketClassTab page object

Return type:

BucketClassTab

nav_namespace_store_tab()

Navigate to Namespace Store tab. Accessible from Object Storage page

Returns:

NameSpaceStoreTab page object

Return type:

NameSpaceStoreTab

nav_object_buckets_claims_tab()

Navigate to Object Buckets Claims tab. Accessible from Object Storage page

Returns:

ObjectBucketClaimTab page object

Return type:

ObjectBucketClaimTab

nav_object_buckets_tab()

Navigate to Object Buckets tab. Accessible from Object Storage page

Returns:

ObjectBucketTab page object

Return type:

ObjectBucketTab

select_project(cluster_namespace)

Helper function to select a project via UI. e.g. ‘openshift-storage’

Parameters:

cluster_namespace (str) – project name will be selected from the list

ocs_ci.ocs.ui.page_objects.odf_topology_tab module

class ocs_ci.ocs.ui.page_objects.odf_topology_tab.AbstractTopologyView

Bases: ABC, TopologySidebar

Abstract class for ODF Topology layers operated by Selenium webdriver

Note

This class should not be instantiated directly. Instead, it serves as a base class for concrete implementation classes.

check_entity_selected(entity_name)

Checks if the specified entity is selected.

Parameters:

entity_name (str) – Name of the entity.

Returns:

True if the entity is selected, False otherwise.

Return type:

bool

expand_to_full_screen()

Expands the topology view to full screen.

get_entity_name_from_df(index: int)

Returns the name of an entity at the specified index in the dataframe, if the dataframe is filled.

Parameters:

index (int) – The index of the entity in the dataframe.

Returns:

The name of the entity at the given index, or None if the index is not found.

Return type:

str

get_nested_deployment_names_of_node_from_df_ui(node_name)

Retrieves the names of nested deployments associated with a node from the UI dataframe.

Parameters:

node_name (str) – Name of the node.

Returns:

List of deployment names associated with the specified node.

Return type:

list

Example

get_nested_deployment_names_of_node_from_df_ui(“my-node”) # Returns [‘deployment-1’, ‘deployment-2’, ‘deployment-3’]

get_nested_deployments_of_node_from_df_ui(node_name)

Retrieves the nested deployments of a node from the UI dataframe.

Parameters:

node_name (str) – Name of the node.

Returns:

Dictionary representing the nested deployments of the node.

Return type:

dict

Example

get_nested_deployments_of_node_from_df_ui(“node-1”) # Returns {‘entity_name’: ‘nested-deployment-1’, ‘entity_status’: ‘Running’, …}

initiate_topology_df(reinit: bool = True)

Initializes the topology DataFrame if not already set or if explicitly requested.

Parameters:

reinit (bool, optional) – Whether to reinitialize the topology DataFrame. Defaults to True.

Raises:

NoSuchElementException – If the element text cannot be read.

Note

The method assumes the availability of the self.topology_df DataFrame and certain constants.

is_cluster_in_danger() bool

Method checks whether the cluster is red-labeled on ODF Topology canvas or not

is_entity_present(entity_name) bool

Checks if the specified entity is present.

Parameters:

entity_name (str) – The name of the entity to search for.

Returns:

True if the entity is present, False otherwise.

Return type:

bool

nav_back_main_topology_view(soft: bool = False)

Navigate back to the higher hierarchy level in the topology view. Can be used in any level of topology, but will be performed only if button back exists when param soft is True

Parameters:

soft (bool, optional) – If True, performs a navigation back if the “back” button is present. If False, performs a navigation back by clicking the “back” button. Defaults to False.

Note

The “back” button exists only on the deployment level.

property nodes_view

Property to create OdfTopologyNodesView only once per cluster.

This property ensures that an instance of OdfTopologyNodesView is created only once per cluster. It checks if the instance already exists as the ‘cluster_topology’ attribute, and if not, creates a new instance. The property then returns the instance.

Returns:

The instance of OdfTopologyNodesView.

Return type:

OdfTopologyNodesView

Note

The property assumes the availability of the OdfTopologyNodesView class.

read_presented_topology()

Reads and retrieves the presented topology from the current view.

The method attempts to read the presented topology by zooming out up to three times if the topology is larger than the browser window can fit. After successfully reading the topology, it updates the status and logs the entity names and their corresponding statuses. Finally, it returns the topology DataFrame.

Returns:

DataFrame containing the presented topology with entity names and statuses.

Return type:

pd.DataFrame

Example

topology = read_presented_topology() # Returns a DataFrame with entity names and statuses: # entity_name | entity_status # —————-+—————– # Node 1 | Ready # Node 2 | Not Ready # Node 3 | Ready # …

Resets the search bar.

reset_view()

Resets the topology view.

Selects the specified entity using the search bar.

Parameters:

entity_name (str) – Name of the entity to select.

update_topology_status()

Updates the status of entities in the topology.

This method iterates over the rows of the topology dataframe and updates the entity status, status XPath, select node XPath, and navigate into XPath (if applicable) for each entity.

Note

The method assumes the availability of the topology dataframe, certain locators, and a brief pause of 0.1 seconds between iterations.

zoom_in_view()

Zooms in the topology view.

zoom_out_view()

Zooms out the topology view.

This method performs a zoom-out action on the topology view, effectively reducing the level of zoom.

class ocs_ci.ocs.ui.page_objects.odf_topology_tab.OdfTopologyDeploymentsView

Bases: TopologyTab

Represents the view of deployments in the ODF topology.

This class extends the TopologyTab class and provides functionality specific to deployments. The class is accessible mainly via OdfTopologyNodesView.nav_into_node(args)

filter_node_by_toggle_from_deployments_level(node_name)

Filters the node by toggle from the deployments level in the topology view.

Parameters:

node_name (str) – Name of the node to filter.

Raises:

IncorrectUiOptionRequested – If topology node filtering exists only on the Deployment Topology level.

get_current_selected_node_from_deployments_level() str

Retrieves the name of the currently selected node from the deployments level in the topology view.

Returns:

Name of the currently selected node.

Return type:

str

Raises:

IncorrectUiOptionRequested – If the topology node filtering is not available on the deployments level.

Example

get_current_selected_node_from_deployments_level() # Returns ‘my-node-1’ if the node is currently selected.

read_details() dict

Reads and retrieves details of a deploymen from the UI. Side-bar of deployment should be open.

Returns:

Dictionary containing the node details.

Return type:

dict

Raises:

IncorrectUiOptionRequested – If the wrong level of topology is opened instead of the Node level.

class ocs_ci.ocs.ui.page_objects.odf_topology_tab.OdfTopologyNodesView

Bases: TopologyTab

The OdfTopologyNodesView class represents a view of the ODF topology at the nodes level. The class initializes the topology_df DataFrame with specific column names and data types to store information about entity names, entity status, XPath expressions for status, navigation, and node selection, as well as nested deployments. The DataFrame is initially empty but can be populated with data iteratively.

get_cluster_name() str

Get cluster name from Topology canvas. Sidebar is not used

Returns:

name of the cluster such as ‘ocs-storagecluster’

get_group_names() list

Get racks/zones names from Topology canvas. Sidebar is not used

Returns:

names of the groups

nav_into_node(node_index_option: int = None, node_name_option: str = None)

Navigates into a specific node in the Topology UI.

Parameters:
  • node_index_option (int) – Index of the node by order.

  • node_name_option (str) – Name of the node.

Returns:

Instance of the class representing the UI Topology.

Return type:

OdfTopologyDeploymentsView

Raises:

IncorrectUiOptionRequested – If incorrect arguments are provided.

Note

This method should be used only after reading the presented topology with read_presented_topology().

Example

nav_into_node(node_index_option=0) # Returns an instance of OdfTopologyDeploymentsView representing the UI Topology.

read_details() dict

Reads and retrieves details of a node from the UI.

Returns:

Dictionary containing the node details.

Return type:

dict

Raises:

IncorrectUiOptionRequested – If the wrong level of topology is opened instead of the Node level.

Example

read_details() # Returns {‘name’: ‘node-1’, ‘status’: ‘Ready’, ‘role’: ‘worker’, ‘operating_system’: ‘linux’, # ‘kernel_version’: ‘4.18.0-305.12.1.el8_4.x86_64’, ‘instance_type’: ‘m5.large’, # ‘OS_image’: ‘CentOS Linux 8 (Core)’, ‘architecture’: ‘amd64’, # ‘addresses’: ‘External IP: 203.0.113.10; Hostname: node-1; Internal IP: 192.168.0.1’, # ‘kubelet_version’: ‘v1.21.2’, ‘provider_ID’: ‘aws’, ‘annotations_number’: ‘5 annotations’, # ‘external_id’: ‘-’, ‘created’: ‘Jun 1, 2023, 10:00 AM’}

record_nested_deployments(node_index: int, df: DataFrame) DataFrame

Records nested deployments for a specific node in the Topology.

Parameters:
  • node_index (int) – Index of the node in the Topology.

  • df (pd.DataFrame) – DataFrame representing the nested deployments.

Returns:

Updated Topology DataFrame.

Return type:

pd.DataFrame

Example

record_nested_deployments(0, nested_deployments_df) # Returns the updated Topology DataFrame with nested deployments recorded.

class ocs_ci.ocs.ui.page_objects.odf_topology_tab.TopologySidebar

Bases: BaseUI

Class a child to AbstractTopologyView (it has base_ui methods) and may be used only if Topology view is opened

close_sidebar(soft=False)

Closes the sidebar in the topology view.

Parameters:

soft (bool, optional) – If True and the sidebar is visible, closes the sidebar with a transition. If False (default) or the sidebar is not visible, closes the sidebar immediately and may get exception if sidebar is not open.

get_number_of_alerts()

Retrieves the number of alerts categorized by severity level.

Returns:

Dictionary containing the number of alerts for each severity level:

{‘Critical’: <critical_alerts>, ‘Warning’: <warning_alerts>, ‘Info’: <info_alerts>}

Return type:

dict

is_alert_tab_present() bool

Useful to check condition: Alert tab should not be present in External mode

is_node_down_alert_in_alerts_ui(entity=None, read_canvas_alerts=False)

Checks if a NodeDown alert is present in the UI alerts.

Parameters:
  • entity (str, optional) – Entity name to filter alerts (default: None).

  • read_canvas_alerts (bool, optional) – Whether to read alerts from the canvas (default: False).

Returns:

if the node down alert visible in Alerts tab of the Topology

Return type:

bool

open_alerts_tab()

Method opens the alerts tab in the user interface.

open_details_tab()

Opens the details tab in the UI.

open_observe_tab()

Opens the observe tab in the UI.

open_resources_tab()

Opens the resources tab in the UI.

open_side_bar_of_entity(entity_name: str | None = None, canvas: bool = False)

Opens the sidebar of an entity in the topology view.

Parameters:
  • entity_name (str, optional) – Name of the entity to open the side bar for.

  • canvas (bool, optional) – Flag indicating whether to click on the topology graph canvas.

Note

If canvas is True, the method clicks on the topology graph canvas to open the side bar. Otherwise, it searches for the entity and clicks on it. The method attempts to open the sidebar up to three times, zooming out the topology view if necessary.

read_alerts() dict

Reads alerts from the alert tab and retrieves their details.

Returns:

Dictionary containing the alerts and their corresponding levels. Each alert level is associated with a list of alert titles.

Return type:

dict

Note

Alerts tab should be opened. The alert levels are expanded to read the titles and then shrunk back.

read_alerts_procedure(entity=None, read_canvas_alerts=False)

Reads alerts for a specific entity using the procedure.

This method follows a procedure to read alerts for the specified entity. It closes the sidebar, opens the sidebar of the entity (optionally reading alerts in the canvas), opens the alerts tab, reads the alerts, and finally closes the sidebar.

Parameters:
  • entity (str) – Optional. The entity for which alerts need to be read.

  • read_canvas_alerts (bool) – Optional. Indicates whether to read alerts in the canvas or not.

Returns:

A list of alerts detected in side-bar

Return type:

list

class ocs_ci.ocs.ui.page_objects.odf_topology_tab.TopologyTab

Bases: DataFoundationDefaultTab, AbstractTopologyView

Topology tab Class Content of Data Foundation/Topology tab (default for ODF 4.13 and above)

get_topology_df()

Retrieves the recorded topology DataFrame.

Returns:

DataFrame containing the recorded topology information.

Return type:

pd.DataFrame

get_topology_str()
Method to get a dataframe with Topology as a str to print in console

# +—-+————–+—————+—————————————————————-+ # | | entity_name | entity_status | nested_deployments | # +====+==============+===============+================================================================+ # | 0 | compute-0 | success | entity_name entity_status | # | | | | 0 rook-ceph-osd-1 success | # | | | | 1 csi-cephfsplugin-provisioner success | # | | | | … | # +—-+————–+—————+—————————————————————-+ # | 1 | compute-1 | success | entity_name entity_status | # | | | | 0 rook-ceph-osd-1 success | # | | | | 1 csi-cephfsplugin-provisioner success | # +—-+————–+—————+—————————————————————-+

Returns:

text representation of pandas Dataframe of ODF Topology view, where cluster with node names, node statuses and their deployment names and statuses may be found

Return type:

str

read_all_topology()

Reads and records the topology of the cluster at the nodes level.

Returns:

DataFrame containing the recorded topology information.

Return type:

pd.DataFrame

Note

The recorded topology information is stored in the ‘__topology_df’ attribute and accessible via get_topology_df()

validate_node_group_names(cluster_app_name_cli, topology_deviation, zoom_out_times)

Validates the node group names (such as rack or zone) from the ODF Topology UI against names taken from CLI. :param cluster_app_name_cli: cluster name visible in Topology UI :param topology_deviation: dictionary to store deviations if found :param zoom_out_times: number of times to zoom out the Topology view to see whole cluster representation

validate_topology_configuration()

Validates the configuration of the topology.

Returns:

A dictionary indicating the deviations found during validation. The keys represent specific deviations

and the values are booleans indicating whether the deviation was detected or not.

Return type:

dict

validate_topology_navigation_bar(entity_name)

Validates the navigation bar functionality in the topology view.

This method verifies that the provided entity name can be selected using the search bar in the topology view. It ensures that the entity is correctly selected and then resets the search bar.

Parameters:

entity_name (str) – The name of the entity to be selected in the topology view.

Returns:

True if the entity is successfully selected, False otherwise.

Return type:

bool

ocs_ci.ocs.ui.page_objects.overview_tab module

class ocs_ci.ocs.ui.page_objects.overview_tab.OverviewTab

Bases: DataFoundationDefaultTab

Overview tab Class Content of Data Foundation/Overview tab (default for ODF bellow 4.13)

nav_storage_system_details_from_storage_status_popup()

Navigate to Storage System Details from Storage Status popup

Returns:

Storage System Details page

Return type:

StorageSystemDetails

nav_storage_system_details_via_system_capacity_card()

Navigate to Storage System Details via System Capacity Card

Returns:

Storage System Details page

Return type:

StorageSystemDetails

nav_storage_systems_details_via_performance_card()

Navigate to Storage System Details via Performance Card

Returns:

Storage System Details page

Return type:

StorageSystemDetails

open_quickstarts_page()
open_storage_popup_from_status_card()

Open Storage System popup from Status card

validate_block_and_file_ready()

Validate Block and File Storage are Ready

Returns:

True if Block and File Storage are Ready, False otherwise

Return type:

bool

validate_overview_tab_active() bool

Validate Overview tab is active

Returns:

True if active, False otherwise

Return type:

bool

validate_performance_card_header_present() bool

Validate Performance Card is present on Overview page

Returns:

True if present, False otherwise

Return type:

bool

validate_system_capacity_card_present() bool

Validate System Capacity Card is present on Overview page

Returns:

True if present, False otherwise

Return type:

bool

wait_storagesystem_popup() bool

ocs_ci.ocs.ui.page_objects.page_navigator module

class ocs_ci.ocs.ui.page_objects.page_navigator.PageNavigator

Bases: BaseUI

Page Navigator Class

nav_object_storage()

Navigate to Object Storage Page

Returns:

ObjectService page object

Return type:

ObjectService

nav_object_storage_page()

Navigate to Object Storage page

nav_odf_default_page()

Navigate to OpenShift Data Foundation default page Default Data foundation page is Overview at ODF 4.13

navigate_OCP_home_page()

Navigate to Home Page

navigate_alerting_page()

Navigate to Alerting Page

navigate_block_pool_page()

Navigate to block pools page

navigate_cluster_overview_page()

Navigate to Cluster Overview Page

navigate_dashboards_page()

Navigate to Dashboards Page

navigate_events_page()

Navigate to Events Page

navigate_explore_page()

Navigate to Explore Page

navigate_installed_operators_page()

Navigate to Installed Operators Page

navigate_metrics_page()

Navigate to Metrics Page

navigate_object_bucket_claims_page()

Navigate to Object Bucket Claims Page

navigate_object_buckets_page()

Navigate to Object Buckets Page

navigate_operatorhub_page()

Navigate to OperatorHub Page

navigate_persistentvolumeclaims_page()

Navigate to Persistent Volume Claims Page

navigate_persistentvolumes_page()

Navigate to Persistent Volumes Page

navigate_pods_page()

Navigate to Pods Page

navigate_projects_page()

Navigate to Projects Page

navigate_quickstarts_page()

Navigate to Quickstarts Page

navigate_search_page()

Navigate to Search Page

navigate_storage()
navigate_storageclasses_page()

Navigate to Storage Classes Page

navigate_to_ocs_operator_page()

Navigate to the OCS Operator management page

navigate_volumesnapshotclasses_page()

Navigate to Volume Snapshot Classes Page

navigate_volumesnapshotcontents_page()

Navigate to Volume Snapshot Contents Page

navigate_volumesnapshots_page()

Navigate to Storage Volume Snapshots Page

select_administrator_user()

Select the administrator user role from the dropdown

select_namespace(project_name)

This function selects the namespace on UI. The timeout is hard-coded to 10 seconds in the below function call which is more than sufficient.

Parameters:

project_name (str) – Name of the project to be selected

Returns:

True if the project is found, raises NoSuchElementException otherwise with a log message

Return type:

bool

verify_current_page_resource_status(status_to_check, timeout=30)

Compares a given status string to the one shown in the resource’s UI page

Parameters:
  • status_to_check (str) – The status that will be compared with the one in the UI

  • timeout (int) – How long should the check run before moving on

Returns:

True if the resource was found, False otherwise

Return type:

bool

ocs_ci.ocs.ui.page_objects.resource_list module

class ocs_ci.ocs.ui.page_objects.resource_list.ResourceList

Bases: SearchBar

Resource List module presented in OBC, OB, PVC, PV, BucketClass, BackingStore, StorageClass, VolumeSnapshotClasses, BlockPools, etc.

This module is for selecting resource, navigation into, filtering, deletion, edition, etc.

delete_resource(delete_via, resource)

Delete Object Bucket, Object Bucket Claim, PVC, PV, BucketClass, BackingStore, StorageClass, Namespace, etc.

Parameters:
  • delete_via (str) – supported values: ‘three_dots’ or ‘Actions’ delete using ‘three dots’ icon, from the Resource List page or click on specific resource and delete it using ‘Actions’ dropdown list

  • resource (str) – resource name to delete.

nav_to_resource_via_label(resource_label: str)

Navigate to resource searching it via label

Parameters:

resource_label (str) – Resource label

nav_to_resource_via_name(resource_name: str | None = None)

Navigate to resource searching it via name

Parameters:

resource_name (str) – Resource name

ocs_ci.ocs.ui.page_objects.resource_page module

class ocs_ci.ocs.ui.page_objects.resource_page.ResourcePage

Bases: BaseUI

Class represents Resource List UI module - the body of pages ObjectBucketClaim tab, Object Bucket tab, Namespace store tab, Persistent Volume Claim page, Volume Snapshots, etc.

is_backing_store_open()

Check if backing store is open

Returns:

True if backing store is open, False otherwise

Return type:

bool

is_namespace_store_open()

Check if namespace store is open

Returns:

True if namespace store is open, False otherwise

Return type:

bool

is_ob_open()

Check if namespace store is open

Returns:

True if namespace store is open, False otherwise

Return type:

bool

is_obc_open()

Check if namespace store is open

Returns:

True if namespace store is open, False otherwise

Return type:

bool

nav_resource_list_via_breadcrumbs()

Navigate to Resource List page via breadcrumbs

Returns:

ResourceList page object, depends on which page was open before

Return type:

object

verify_current_page_resource_status(status_to_check, timeout=30)

Compares a given status string to the one shown in the resource’s UI page

Parameters:
  • status_to_check (str) – The status that will be compared with the one in the UI

  • timeout (int) – How long should the check run before moving on

Returns:

True if the resource was found, False otherwise

Return type:

bool

ocs_ci.ocs.ui.page_objects.searchbar module

class ocs_ci.ocs.ui.page_objects.searchbar.SearchBar

Bases: BaseUI

Clear search input

search(search_text: str)

Search for text :param search_text: Text to search :type search_text: str

select_search_by(search_by: str)

Select search by option

Parameters:

search_by (str) – search by option Name | Label

ocs_ci.ocs.ui.page_objects.storage_system_details module

class ocs_ci.ocs.ui.page_objects.storage_system_details.StorageSystemDetails

Bases: StorageSystemTab

check_only_one_block_pools_tab()

Verify that only one BlockPools tab is present. BZ #2096513

get_blockpools_compression_status_from_storagesystem() tuple

Initial page - Data Foundation / Storage Systems tab / StorageSystem details / ocs-storagecluster-cephblockpool Get compression status from storagesystem details and ocs-storagecluster-cephblockpool

Returns:

String representation of ‘Compression status’ from StorageSystem details page and String representation of ‘Compression status’ from ocs-storagecluster-cephblockpool page

Return type:

tuple

is_storage_system_details_breadcrumb_present()

Verify that Storage System Details breadcrumb is present

nav_block_and_file()

Accessible only at StorageSystems / StorageSystem details / Overview ! At ‘StorageSystems / StorageSystem details / BlockPools’ Block and file page is not accessible

nav_ceph_blockpool()
nav_cephblockpool_verify_statusready()

Initial page - Data Foundation / Storage Systems tab / StorageSystem details Navigate to ocs-storagecluster-cephblockpool Verify cephblockpool status is ‘Ready’

Raises:

CephHealthException if cephblockpool_status != 'Ready'

nav_details_object()

Accessible only at StorageSystems / StorageSystem details / Overview ! At ‘StorageSystems / StorageSystem details / BlockPools’ Object page is not accessible

nav_details_overview()
nav_storage_systems_via_breadcrumb()

Navigate to StorageSystems via breadcrumb

Returns:

StorageSystemTab page object

Return type:

StorageSystemTab

navigate_backward()

Navigate to a previous Web Page

ocs_ci.ocs.ui.page_objects.storage_system_tab module

class ocs_ci.ocs.ui.page_objects.storage_system_tab.StorageSystemTab

Bases: DataFoundationTabBar, CreateResourceForm

Storage System tab Class Content of Data Foundation/Storage Systems tab

fill_backing_storage_form(backing_store_type: str, btn_text: str)

Storage system creation form consists from several forms, showed one after another when mandatory fields filled and Next btn clicked. Function to fill first form in order to create new Backing store.

Parameters:
  • backing_store_type (str) – options available when filling backing store form (1-st form)

  • btn_text (str) – text of the button to be clicked after the form been filled (‘Next’, ‘Back’, ‘Cancel’)

nav_storagecluster_storagesystem_details()

Initial page - Data Foundation / Storage Systems tab Navigate to StorageSystem details

Module contents