ocs_ci.ocs.ui package
Subpackages
Submodules
ocs_ci.ocs.ui.acm_ui module
- class ocs_ci.ocs.ui.acm_ui.ACMOCPClusterDeployment(platform, cluster_conf)
Bases:
AcmPageNavigator
Everything related to cluster creation through ACM goes here
- acm_bailout_if_failed()
- acm_cluster_status_creating(timeout=120)
- acm_cluster_status_failed(timeout=5)
- acm_cluster_status_ready(timeout=120)
- click_next_button()
- click_platform_and_credentials()
- create_cluster(cluster_config=None)
Create cluster using ACM UI
- Parameters:
cluster_config (Config) – framework.Config object of complete configuration required for deployment
- create_cluster_prereq()
- destroy_cluster()
ACM UI based destroy cluster, select the cluster from UI, click on destroy
- download_cluster_conf_files()
Download install-config and kubeconfig to cluster dir
- download_kubeconfig(authdir)
- fill_multiple_textbox(key_val)
In a page if we want to fill multiple text boxes we can use this function which iteratively fills in values from the dictionary parameter
- key_val (dict): keys corresponds to the xpath of text box, value corresponds
to the value to be filled in
- get_deployment_status()
- get_destroy_status()
Return the current status of destroy operation
- goto_cluster_details_page()
- post_destroy_ops()
Post destroy ops should be implemented by child classes because post destroy ops are mostly specific to the platform
- wait_for_cluster_create()
- class ocs_ci.ocs.ui.acm_ui.ACMOCPDeploymentFactory
Bases:
object
- get_platform_instance(cluster_config)
- Parameters:
cluster_config (dict) – Cluster Config object
- class ocs_ci.ocs.ui.acm_ui.ACMOCPPlatformVsphereIPI(cluster_conf=None)
Bases:
ACMOCPClusterDeployment
This class handles all behind the scene activities for cluster creation through ACM for vsphere platform
- add_different_pod_network()
Edit online cluster yaml to add network info
- create_cluster()
This function navigates through following pages in the UI 1. Cluster details 2. Node poools 3. Networks 4. Proxy 5. Automation 6. Review
- Raises:
ACMClusterDeployException – If deployment failed for the cluster
- create_cluster_prereq(timeout=600)
Perform all prereqs before vsphere cluster creation from ACM
- Parameters:
timeout (int) – Timeout for any UI operations
- fill_cluster_details_page()
Fill in following details in “Cluster details” page 1. Cluster name 2. Base DNS domain 3. Release image
- fill_network_info()
We need to fill following network info 1. vSphere network name 2. API VIP 3. Ingress VIP
- get_ocp_release_img()
- post_destroy_ops()
Post destroy ops includes 1. Deleting DNS entries 2. Freeing the ips assigned
Bases:
BaseUI
ACM Page Navigator Class
Navigate to ACM Applications Page
Navigate to ACM Automation Page
Navigate to ACM Bare Metal Assets Page
Navigate to ACM Clusters Page
Navigate to ACM Credentials Page
Navigate to Data Services page on ACM UI, supported for ACM version 2.7 and above
For ACM version 2.7 and above we need to navigate from OCP console to ACM multicluster page
Navigate to ACM Governance Page
Navigate to ACM Infrastructure Environments Page
Navigate to ACM Overview Page
Navigate to ACM Welcome Page
ocs_ci.ocs.ui.add_replace_device_ui module
- class ocs_ci.ocs.ui.add_replace_device_ui.AddReplaceDeviceUI
Bases:
PageNavigator
InfraUI class for add capacity, device replacement, node replacement
- add_capacity_ui()
Add Capacity via UI
- verify_pod_status(pod_names, pod_state='Running')
Verify pod status
- Parameters:
pod_names (list) – list of pod names
pod_state (string) – the desired pod state
ocs_ci.ocs.ui.base_ui module
- class ocs_ci.ocs.ui.base_ui.BackingStoreTab
- class ocs_ci.ocs.ui.base_ui.BaseUI
Bases:
object
Base Class for UI Tests
- check_element_presence(locator, timeout=5)
Check if an web element is present on the web console or not.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) occurs
- Returns:
True if the element is found, returns False otherwise and raises NoSuchElementException
- Return type:
bool
- check_element_text(expected_text, element='*')
Check if the text matches the expected text.
- Parameters:
expected_text (string) – The expected text.
- Returns:
True if the text matches the expected text, False otherwise
- Return type:
bool
- choose_expanded_mode(mode, locator)
Select the element mode (expanded or collapsed)
mode (bool): True if element expended, False otherwise locator (tuple): (GUI element needs to operate on (str), type (By))
- copy_dom()
Get page source of the webpage
- classmethod deep_get(dictionary, *keys)
- do_clear(locator, timeout=30)
Clear the existing text from UI
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element until timeout (sec) occurs
- do_click(locator, timeout=30, enable_screenshot=False, copy_dom=False, avoid_stale=False)
Click on Button/link on OpenShift Console
locator (tuple): (GUI element needs to operate on (str), type (By)) timeout (int): Looks for a web element repeatedly until timeout (sec) happens. enable_screenshot (bool): take screenshot copy_dom (bool): copy page source of the webpage avoid_stale (bool): if got StaleElementReferenceException, caused by reference to stale, cached element, refresh the page once and try click again * don’t use when refreshed page expected to be different from initial page, or loose input values
- do_click_by_id(id, timeout=30)
- do_click_by_xpath(xpath, timeout=30)
Function to click on a web element using XPATH :param xpath: xpath to interact with web element :type xpath: str :param timeout: timeout until which an exception won’t be raised :type timeout: int
- Returns:
Clicks on the web element found
- do_send_keys(locator, text, timeout=30)
Send text to element on OpenShift Console
locator (tuple): (GUI element needs to operate on (str), type (By)) text (str): Send text to element timeout (int): Looks for a web element repeatedly until timeout (sec) happens.
- find_an_element_by_xpath(locator)
Function to find an element using xpath
- Parameters:
locator (str) – locator of the element to be found
- Returns:
an object of the type WebElement
- get_checkbox_status(locator, timeout=30)
Checkbox Status
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) happens.
- Returns:
True if element is Enabled, False otherwise
- Return type:
bool
- get_element_attribute(locator, attribute, safe: bool = False)
Get attribute from WebElement
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
attribute (str) – the value of this attribute will be extracted from WebElement
safe (bool) – if True exception will not raise when element not found. Default option - not safe
- Returns:
value of the attribute of requested and found WebElement
- Return type:
str
- get_element_text(locator)
Get the inner text of an element in locator.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
- Returns:
The text captured.
- Return type:
str
- get_elements(locator)
Get an elements list. Useful to count number of elements presented on page, etc.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
- Returns:
The list of WebElements
- Return type:
list
- is_expanded(locator, timeout=30)
Check whether an element is in an expanded or collapsed state
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
timeout (int) – Looks for a web element repeatedly until timeout (sec) happens.
- Returns:
True if element expended, False otherwise
- Return type:
bool
Navigate to a previous Web Page
- page_has_loaded(retries=5, sleep_time=2, module_loc=('html', 'tag name'))
Waits for page to completely load by comparing current page hash values. Not suitable for pages that use frequent dynamically content (less than sleep_time)
- Parameters:
retries (int) – How much time in sleep_time to wait for page to load
sleep_time (int) – Time to wait between every pool of dom hash
module_loc (tuple) – locator of the module of the page awaited to be loaded
- refresh_page()
Refresh Web Page
- scroll_into_view(locator)
Scroll element into view
- select_checkbox_status(status, locator)
Select checkbox status (enable or disable)
status (bool): True if checkbox enable, False otherwise locator (tuple): (GUI element needs to operate on (str), type (By))
- take_screenshot()
Take screenshot using python code
- wait_for_element_attribute(locator, attribute, attribute_value, timeout, sleep)
Method to wait attribute have specific value. Fails the test if attribure value not equal to expected :param locator: (GUI element needs to operate on (str), type (By)). :type locator: tuple :param attribute: the value of this attribute will be extracted from WebElement :type attribute: str :param attribute_value: the value attribute (can be None as well) :type attribute_value: str :param timeout: timeout in seconds :type timeout: int :param sleep: sleep interval in seconds :type sleep: int
- wait_for_element_to_be_visible(locator, timeout=30)
Wait for element to be visible. Use when Web element is not have to be clickable (icons, disabled btns, etc.) Method does not fail when Web element not found
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By)).
timeout (int) – Looks for a web element until timeout (sec) occurs
- wait_for_endswith_url(endswith, timeout=60)
Wait for endswith url to load
- Parameters:
endswith (string) – url endswith string for which we need to wait
timeout (int) – Timeout in seconds
- wait_until_expected_text_is_found(locator, expected_text, timeout=60)
Method to wait for a expected text to appear on the UI (use of explicit wait type), this method is helpful in working with elements which appear on completion of certain action and ignores all the listed exceptions for the given timeout.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
expected_text (str) – Text which needs to be searched on UI
timeout (int) – Looks for a web element repeatedly until timeout (sec) occurs
- Returns:
Returns True if the expected element text is found, False otherwise
- Return type:
bool
- class ocs_ci.ocs.ui.base_ui.BlockPools
Bases:
StorageSystemDetails
,CreateResourceForm
- verify_cephblockpool_status(status_exp: str = 'Ready')
- class ocs_ci.ocs.ui.base_ui.BucketClassTab
- class ocs_ci.ocs.ui.base_ui.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.
- proceed_resource_creation()
Method to proceed to resource creation form, when Create button is visible
- class ocs_ci.ocs.ui.base_ui.DataFoundationDefaultTab
Bases:
DataFoundationTabBar
Default Foundation default Tab: TopologyTab | OverviewTab
- class ocs_ci.ocs.ui.base_ui.DataFoundationTabBar
Bases:
PageNavigator
Navigate to Backing Store tab. Accessible from any Data Foundation tabs
Navigate to Bucket class tab. Accessible from any Data Foundation tabs
Navigate to Namespace Store tab. Accessible from any Data Foundation tabs
Navigate to Overview tab. Accessible from any Data Foundation tabs
Navigate to Storage Systems tab. Accessible from any Data Foundation tabs
Navigate to ODF Topology tab. Accessible from any Data Foundation tabs
- class ocs_ci.ocs.ui.base_ui.NameSpaceStoreTab
- class ocs_ci.ocs.ui.base_ui.OverviewTab
Bases:
DataFoundationDefaultTab
Overview tab Class Content of Data Foundation/Overview tab (default for ODF bellow 4.12)
- open_quickstarts_page()
- wait_storagesystem_popup() bool
Bases:
BaseUI
Page Navigator Class
Navigate to OpenShift Data Foundation default page Default Data foundation page is Overview at ODF 4.13
Navigate to Home Page
Navigate to Alerting Page
Navigate to block pools page
Navigate to Cluster Overview Page
Navigate to Dashboards Page
Navigate to Events Page
Navigate to Explore Page
Navigate to Installed Operators Page
Navigate to Metrics Page
Navigate to Object Bucket Claims Page
Navigate to Object Buckets Page
Navigate to OperatorHub Page
Navigate to Persistent Volume Claims Page
Navigate to Persistent Volumes Page
Navigate to Pods Page
Navigate to Projects Page
Navigate to Quickstarts Page
Navigate to Search Page
Navigate to Storage Classes Page
Navigate to the OCS Operator management page
Navigate to Volume Snapshot Classes Page
Navigate to Volume Snapshot Contents Page
Navigate to Storage Volume Snapshots Page
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
If you have already navigated to namespace drop-down, this function waits for namespace selection on UI. It would be useful to avoid test failures in case of delays/latency in populating the list of projects under the namespace drop-down. 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
- class ocs_ci.ocs.ui.base_ui.StorageSystemDetails
Bases:
StorageSystemTab
- 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
Accessible only at StorageSystems / StorageSystem details / Overview ! At ‘StorageSystems / StorageSystem details / BlockPools’ Block and file page is not accessible
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' –
Accessible only at StorageSystems / StorageSystem details / Overview ! At ‘StorageSystems / StorageSystem details / BlockPools’ Object page is not accessible
Navigate to a previous Web Page
- class ocs_ci.ocs.ui.base_ui.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’)
Initial page - Data Foundation / Storage Systems tab Navigate to StorageSystem details
- class ocs_ci.ocs.ui.base_ui.TopologyTab
Bases:
DataFoundationDefaultTab
Topology tab Class Content of Data Foundation/Topology tab (default for ODF 4.13 and above)
- ocs_ci.ocs.ui.base_ui.close_browser()
Close Selenium WebDriver
- ocs_ci.ocs.ui.base_ui.copy_dom()
Copy DOM using python code
- ocs_ci.ocs.ui.base_ui.garbage_collector_webdriver()
Garbage Collector for webdriver objs
- ocs_ci.ocs.ui.base_ui.login_ui(console_url=None, username=None, password=None)
Login to OpenShift Console
- Parameters:
console_url (str) – ocp console url
username (str) – User which is other than admin user,
password (str) – Password of user other than admin user
- Returns:
driver (Selenium WebDriver)
- ocs_ci.ocs.ui.base_ui.proceed_to_login_console()
Proceed to the login console, if needed to confirm this action in a page that appears before. This is required to be as a solo function, because the driver initializes in the login_ui function. Function needs to be called just before login
- Returns:
None
- ocs_ci.ocs.ui.base_ui.screenshot_dom_location(type_loc='screenshot')
Get the location for copy DOM/screenshot
- Parameters:
type_loc (str) – if type_loc is “screenshot” the location for copy screeenshot else DOM
- ocs_ci.ocs.ui.base_ui.take_screenshot()
Take screenshot using python code
ocs_ci.ocs.ui.block_pool module
- class ocs_ci.ocs.ui.block_pool.BlockPoolUI
Bases:
PageNavigator
User Interface Selenium for Block Pools page
- check_pool_existence(pool_name)
Check if pool appears in the block pool list
- Parameters:
pool_name (str) – Name of the pool to check
- Returns:
True if pool is in the list of pools page, otherwise False
- Return type:
bool
- create_pool(replica, compression)
Create block pool via UI
- Parameters:
replica (int) – replica size usually 2,3
compression (bool) – True to enable compression otherwise False
- Returns:
pool name (str) pool status (bool) #pool can be created with failure status
- Return type:
array
- delete_pool(pool_name)
Delete pool from pool page
- Parameters:
pool_name (str) – The name of the pool to be deleted
- Returns:
True if pool is not found in pool list, otherwise false
- Return type:
bool
- edit_pool_parameters(pool_name, replica=3, compression=True)
Edit an already existing pool
- Parameters:
pool_name (str) – The name of the pool to change.
replica (int) – size of replica. Available in OCS now 2,3.
compression (bool) – True if enable compression. False otherwise.
- reach_pool_limit(replica, compression)
Add pools till pool fails because of pg limit.
- Parameters:
replica (int) – size of pool.
compression (bool) – True for enabling compression. Otherwise False.
ocs_ci.ocs.ui.deployment_ui module
- class ocs_ci.ocs.ui.deployment_ui.DeploymentUI
Bases:
PageNavigator
Deployment OCS/ODF Operator via User Interface
- configure_encryption()
Configure Encryption
- configure_in_transit_encryption()
Configure in_transit_encryption
- configure_osd_size()
Configure OSD Size
- create_storage_cluster()
Review and Create StorageCluster/StorageSystem
- enable_taint_nodes()
Enable taint Nodes
- install_internal_cluster()
Install Internal Cluster
- install_local_storage_operator()
Install local storage operator
- install_lso_cluster()
Install LSO cluster via UI
- install_mcg_only_cluster()
Install MCG ONLY cluster via UI
- install_ocs_operator()
Install OCS/ODF Opeartor
- install_ocs_ui()
Install OCS/ODF via UI.
- install_storage_cluster()
Install StorageCluster/StorageSystem
- refresh_popup(timeout=30)
Refresh PopUp
- search_operator_installed_operators_page(operator='OpenShift Container Storage')
Search Operator on Installed Operators Page
- Parameters:
operator (str) – type of operator
- verify_disks_lso_attached(timeout=600, sleep=20)
Verify Disks Attached
- Parameters:
timeout (int) – Time in seconds to wait
sleep (int) – Sampling time in seconds
- verify_operator_succeeded(operator='OpenShift Container Storage', timeout_install=300, sleep=20)
Verify Operator Installation
- Parameters:
operator (str) – type of operator
timeout_install (int) – Time in seconds to wait
sleep (int) – Sampling time in seconds
ocs_ci.ocs.ui.helpers_ui module
- ocs_ci.ocs.ui.helpers_ui.format_locator(locator, string_to_insert)
Use this function format_locator when working with dynamic locators.
- Parameters:
locator (tuple) – (GUI element needs to operate on (str), type (By))
string_to_insert (str) – Name of the variable (string) which contains the dynamic web element when generated on certain action
- Returns:
formats the locator using .format() function which takes string to be inserted as an argument
- ocs_ci.ocs.ui.helpers_ui.get_element_type(element_name)
This function accepts an element name as a argument and returns the element type by creating XPATH for it. This is helpful when we are creating dynamic names for PVC’s, Pod’s, Namespaces’s etc. and want to interact with the same on UI.
- ocs_ci.ocs.ui.helpers_ui.ui_add_capacity(osd_size_capacity_requested)
Add Capacity via UI
- Parameters:
osd_size_capacity_requested (int) – Requested osd size capacity
- Returns:
Returns True if all OSDs are in Running state
- Return type:
new_storage_devices_sets_count (int)
- ocs_ci.ocs.ui.helpers_ui.ui_add_capacity_conditions()
Conditions for add capacity via UI
- Returns:
True if support UI add capacity, False otherwise
- Return type:
bool
- ocs_ci.ocs.ui.helpers_ui.ui_deployment_conditions()
Conditions for installing the OCS operator via UI
- Returns:
True if support UI deployment, False otherwise
- Return type:
bool
ocs_ci.ocs.ui.mcg_ui module
- class ocs_ci.ocs.ui.mcg_ui.BucketClassUI
Bases:
PageNavigator
A class representation for abstraction of BC-related OpenShift UI actions
- create_namespace_bucketclass_ui(bc_name, policy, nss_name_lst, bs_name_lst)
Create a namespace BC via the UI
- Parameters:
bc_name (str) – The name to grant the BC
policy (str) – The policy type to use. Single/Multi/Cache
nss_name_lst (list[str]) – A list of namespacestore names to be used by the bucketclass
bs_name_lst (list[str]) – A list of backingstore names to be used by the bucketclass
- create_standard_bucketclass_ui(bc_name, policy, store_list)
Create a standard BC via the UI
- Parameters:
bc_name (str) – The name to grant the BC
policy (str) – The policy type to use. Spread/Mirror
store_list (list[str]) – A list of backingstore names to be used by the bucketclass
- delete_bucketclass_ui(bc_name)
Delete a BC via the UI
bc_name (str): Name of the BC to be deleted
- set_cache_namespacestore_policy(nss_name_lst, bs_name_lst)
- set_multi_namespacestore_policy(nss_name_lst)
- set_namespacestore_policy = {'cache': <function BucketClassUI.set_cache_namespacestore_policy>, 'multi': <function BucketClassUI.set_multi_namespacestore_policy>, 'single': <function BucketClassUI.set_single_namespacestore_policy>}
- set_single_namespacestore_policy(nss_name_lst)
- class ocs_ci.ocs.ui.mcg_ui.BucketsUI
Bases:
PageNavigator
A class representation for abstraction of OBC or OB-related OpenShift UI actions
- delete_resource(delete_via, resource)
Delete Object Bucket or Object bucket claim
- Parameters:
delete_via (str) – delete using ‘three dots’ icon, from the Object Bucket page/Object Bucket Claims page or click on specific Object Bucket/Object Bucket Claim and delete it using ‘Actions’ dropdown list
resource (str) – resource name to delete. It may be Object Bucket Claim name both for OBC or OB, and it may be Object Bucket Name. Object Bucket name consists from Object Bucket Claim and prefix
- select_openshift_storage_project(cluster_namespace)
Helper function to select openshift-storage project
- Parameters:
cluster_namespace (str) – project name will be selected from the list
Notice: the func works from PersistantVolumeClaims, VolumeSnapshots and OBC pages
- class ocs_ci.ocs.ui.mcg_ui.MCGStoreUI
Bases:
PageNavigator
A class representation for abstraction of MCG store related OpenShift UI actions
- create_store_ui(kind, store_name, secret_name, target_bucket)
Create an MCG store via the UI
- Parameters:
kind (str) – The store kind - backingstore | namespacestore
store_name (str) – The name to grant to the store
secret_name (str) – The name of the secret to used to connect the store to AWS
target_bucket (str) – The AWS S3 bucket to use as a host for the store
- delete_store_ui(kind, store_name)
Delete an MCG store via the UI
store_name (str): Name of the store to be deleted
- class ocs_ci.ocs.ui.mcg_ui.ObUI
Bases:
BucketsUI
- 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
- class ocs_ci.ocs.ui.mcg_ui.ObcUI
Bases:
BucketsUI
,CreateResourceForm
A class representation for abstraction of OBC-related OpenShift UI actions
- 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
- 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.pvc_ui module
- class ocs_ci.ocs.ui.pvc_ui.PvcUI
Bases:
PageNavigator
User Interface Selenium
- create_pvc_ui(project_name, sc_name, pvc_name, access_mode, pvc_size, vol_mode)
Create PVC via UI. :param project_name: name of test project :type project_name: str :param sc_name: storage class name :type sc_name: str :param pvc_name: the name of pvc :type pvc_name: str :param access_mode: access mode :type access_mode: str :param pvc_size: the size of pvc (GB) :type pvc_size: str :param vol_mode: volume mode type :type vol_mode: str
- delete_pvc_ui(pvc_name, project_name)
Delete pvc via UI :param pvc_name: Name of the pvc :type pvc_name: str :param project_name: name of test project :type project_name: str
- pvc_clone_ui(project_name, pvc_name, cloned_pvc_access_mode='ReadWriteOnce', cloned_pvc_name=None)
Clone PVC via UI
- Parameters:
project_name (str) – The name of project
pvc_name (str) – The name of PVC
cloned_pvc_access_mode (str) – Access mode for cloned PVC
cloned_pvc_name (str) – The name for cloned PVC
- pvc_resize_ui(project_name, pvc_name, new_size)
Resizing pvc via UI :param project_name: name of test project :type project_name: str :param pvc_name: the name of pvc :type pvc_name: str :param new_size: the new size of pvc (GB) :type new_size: int
- verify_pvc_resize_ui(project_name, pvc_name, expected_capacity)
Verifying PVC resize via UI :param project_name: name of test project :type project_name: str :param pvc_name: the name of pvc :type pvc_name: str :param expected_capacity: the new size of pvc (GiB) :type expected_capacity: str
- verify_pvc_ui(pvc_size, access_mode, vol_mode, sc_name, pvc_name, project_name)
Verifying PVC details via UI
- Parameters:
pvc_size (str) – the size of pvc (GB)
access_mode (str) – access mode
vol_mode (str) – volume mode type
sc_name (str) – storage class name
pvc_name (str) – the name of pvc
project_name (str) – name of test project
ocs_ci.ocs.ui.storageclass module
- class ocs_ci.ocs.ui.storageclass.StorageClassUI
Bases:
PageNavigator
User Interface Selenium
- create_encrypted_storage_class_ui(backend_path=None, reclaim_policy='Delete', provisioner='openshift-storage.rbd.csi.ceph.com', vol_binding_mode='Immediate', service_name=None, kms_address=None, tls_server_name=None)
Test for creation of storage class with encryption via UI :param backend_path: name of the vault backend path :type backend_path: str :param reclaim_policy: value of the reclaim policy, it could be ‘Delete’ or ‘Retain’ :type reclaim_policy: str :param provisioner: type of provisioner used, it could be ‘rbd’ or ‘cephfs’ :type provisioner: str :param vol_binding_mode: value of the volume binding mode, it could be ‘WaitForFirstConsumer’ or ‘Immediate’ :type vol_binding_mode: str :param service_name: the default value is None which can be changed in the function call :type service_name: str :param kms_address: the default value is None which can be changed in the function call :type kms_address: str :param tls_server_name: the default value is None which can be changed in the function call :type tls_server_name: str
- Returns:
sc_name (str) if the storage class creation is successful, returns False otherwise
- create_storageclass(pool_name)
Basic function to create RBD based storageclass
- Parameters:
pool_name (str) – The pool to choose in the storageclass.
- Returns:
the name of the storageclass created, otherwise return None.
- Return type:
sc_name (str)
- delete_rbd_storage_class(sc_name)
Delete RBD storageclass
- Parameters:
sc_name (str) – Name of the storageclass to delete.
- Returns:
True if deletion succeeded otherwise False.
- Return type:
(bool)
- verify_storageclass_existence(sc_name)
Check if storageclass is existing in the storageclass list page
- Parameters:
sc_name (str) – The name of storageclass to verify.
- Returns:
True is it exist otherwise False.
ocs_ci.ocs.ui.validation_ui module
- class ocs_ci.ocs.ui.validation_ui.ValidationUI
Bases:
PageNavigator
User Interface Validation Selenium
- check_capacity_breakdown(project_name, pod_name)
Check Capacity Breakdown
- Parameters:
project_name (str) – The name of the project
pod_name (str) – The name of pod
- Returns:
True if project_name and pod_name exist on capacity_breakdown, False otherwise
- Return type:
bool
- odf_console_plugin_check()
Function to verify if console plugin is enabled on UI or not, if not, this function will enable it so as to see ODF tab under Storage section
- odf_overview_ui()
Function to verify changes and validate elements on ODF Overview tab for ODF 4.9
- odf_storagesystems_ui()
Function to verify changes and validate elements on ODF Storage Systems tab for ODF 4.9
- validate_unprivileged_access()
Function to verify the unprivileged users can’t access ODF dashbaord
- verification_ui()
Verification UI
- verify_object_service_page()
Verify Object Service Page UI
- verify_ocs_operator_tabs()
Verify OCS Operator Tabs
- verify_odf_without_ocs_in_installed_operator() bool
Function to validate ODF operator is present post ODF installation, expectation is only ODF operator should be present in Installed operators tab and OCS operator shouldn’t be present. This function is only written for 4.9+ versions
Returns: True: If only odf operator is present in the UI False: If ocs operator is also present in the UI
- verify_page_contain_strings(strings_on_page, page_name)
Verify Page Contain Strings
- Parameters:
strings_on_page (list) – list of strings on page
page_name (str) – the name of the page
- verify_persistent_storage_page()
Verify Persistent Storage Page