class Row: """Task List page row elements locators""" job_name = Locator(By.CSS_SELECTOR, "app-job-name a", "Job name") job_start_date = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Job start date") job_finish_date = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(3)", "Job finish date") job_status = Locator(By.CSS_SELECTOR, "app-job-status-column mat-icon", "Job status")
class HelpPopup: """ADCM header popup with help links""" ask_link = Locator(By.CSS_SELECTOR, "a[adcm_test='ask_for_help']", "Ask for help link") doc_link = Locator(By.CSS_SELECTOR, "a[adcm_test='dock']", "Documentation link")
class JobPageLocators(ObjectPageLocators): """Locators for detailed job page""" job_info = Locator(By.TAG_NAME, "app-job-info", "Job info section") job_log = Locator(By.CSS_SELECTOR, "app-log-text", "Job log") start_date = Locator(By.CSS_SELECTOR, ".time-info>div:first-child>span", "Start date") finish_date = Locator(By.CSS_SELECTOR, ".time-info>div:last-child>span", "Finish date") duration = Locator(By.CSS_SELECTOR, ".time-info>div:nth-child(2)>span", "Task duration") class Menu: """Locators for detailed job page menu""" # keep stdout(-err) prefix in naming stdout_tab = Locator(By.CSS_SELECTOR, "a[adcm_test='tab_1']", "Job stdout tab") stdout_download_btn = Locator( By.XPATH, "//a[.//span[text()='ansible [ stdout ]']]//button", "Download stdout button") stderr_tab = Locator(By.CSS_SELECTOR, "a[adcm_test='tab_2']", "Job stderr tab") stderr_download_btn = Locator( By.XPATH, "//a[.//span[text()='ansible [ stderr ]']]//button", "Download stdout button")
class JobRow: """ADCM header popup job row with jobs""" job_status = Locator(By.CSS_SELECTOR, "mat-icon", "Job status in job row") job_name = Locator(By.CSS_SELECTOR, "a", "Job row name in popup list")
class ActionDialog: """Action Dialog class""" body = Locator(By.CSS_SELECTOR, "mat-dialog-container", "Dialog with choices") run = Locator(By.CSS_SELECTOR, "app-dialog button[color='accent']", "Run button in action dialog")
class ClusterServicesLocators: """Cluster main page elements locators""" add_services_btn = Locator(By.CSS_SELECTOR, "button[adcm_test='create-btn']", "Add services button") service_row = Locator(By.CSS_SELECTOR, ".mat-row", "Service row") class AddServicePopup: """Popup for adding services""" block = Locator(By.CSS_SELECTOR, ".mat-dialog-container", "Popup block") service_row = Locator(By.CSS_SELECTOR, ".mat-list-option", "Service row") create_btn = Locator(By.CSS_SELECTOR, "app-add-service button:last-child", "Add button") cancel_btn = Locator(By.CSS_SELECTOR, "app-add-service button:first-child", "Cancel button") class ServiceRow: """Locators for services row""" text = Locator(By.CSS_SELECTOR, ".mat-list-text", "Service name") class ServiceTableRow: """Services table roe locators""" name = Locator(By.CSS_SELECTOR, "mat-cell:first-of-type", "Service name") version = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Service version") state = Locator(By.CSS_SELECTOR, "app-state-column", "Service state") status = Locator(By.CSS_SELECTOR, "app-status-column button", "Service status") actions = Locator(By.CSS_SELECTOR, "app-actions-button button", "Service actions") service_import = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(6) button", "Service import") config = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(7) button", "Service config")
class ProfileLocators: """Profile page elements locators""" username = Locator(By.XPATH, "//p[contains(text(), 'You are authorized as')]/b", "Authorized user name") password = Locator(By.CSS_SELECTOR, "input[formcontrolname='password']", "New password input field") confirm_password = Locator(By.CSS_SELECTOR, "input[formcontrolname='cpassword']", "New password confirmation field") save_password_btn = Locator(By.XPATH, "//button[./span[text()= 'Save']]", "Save password button")
class WarnPopup: """Warning Popup""" popup_block = Locator(By.CSS_SELECTOR, "app-popover", "Warning popup block") item = Locator(By.CSS_SELECTOR, "app-popover app-concern", "Item with warning")
class CommonTable: """Common table locators (eg, cluster list page table).""" visible_row = Locator(By.CSS_SELECTOR, "mat-row[adwphover]", "Visible table row") header = Locator(By.CSS_SELECTOR, "mat-header-cell>div", "Table header") row = Locator(By.CSS_SELECTOR, "mat-row[adwphover]", "Table row") class ActionPopup: """Common popup for action in tables.""" block = Locator(By.CSS_SELECTOR, "div[role='menu']", "Action popup block") button = TemplateLocator( By.XPATH, "//button[@adcm_test='action_btn' and ./span[text()='{}']]", "Button with action {}") class Pagination: """Common table pagination locators.""" previous_page = Locator(By.CSS_SELECTOR, "button[aria-label='Previous page']", "Previous page button") page_btn = Locator(By.CSS_SELECTOR, "a[class*='page-button']", "Page button") page_to_choose_btn = TemplateLocator( By.XPATH, "//a[contains(@class, 'page-button') and text()='{}']", "Page button") next_page = Locator(By.CSS_SELECTOR, "button[aria-label='Next page']", "Next page button")
class CommonFooterLocators: """ADCM footer locators""" version_link = Locator(By.CSS_SELECTOR, "footer a[href*='docs']", "Link to version doc page") logo = Locator(By.XPATH, "//footer//*[contains(text(), 'ARENADATA ©')]", "Footer logo")
class AdminIntroLocators: """Locators for Admin Intro menu""" intro_title = Locator(By.CSS_SELECTOR, ".content mat-card-header", "Intro header container") intro_text = Locator(By.CSS_SELECTOR, ".content mat-card-content", "Intro text container")
class GroupConfigListLocators: """Group Configuration list locators""" add_btn = Locator(By.CSS_SELECTOR, "button[adcm_test='create-btn']", "Add config group button") header_item = Locator(By.CSS_SELECTOR, "mat-table mat-header-cell", "Add config group button") group_config_row = Locator(By.CSS_SELECTOR, "mat-table mat-row", "Group Configuration row") class GroupConfigRow: """Group Configuration row locators""" name = Locator(By.CSS_SELECTOR, "mat-cell:first-child", "Row name") description = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Row description") delete_btn = Locator(By.CSS_SELECTOR, "button", "Row delete button") class CreateGroupPopup: block = Locator(By.CSS_SELECTOR, "app-dialog", "Popup block") name_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Name']", "Name input") description_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Description']", "Description input") create_btn = Locator(By.CSS_SELECTOR, "app-add-controls button[color='accent']", "Create button")
class GroupConfigRow: """Group Configuration row locators""" name = Locator(By.CSS_SELECTOR, "mat-cell:first-child", "Row name") description = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Row description") delete_btn = Locator(By.CSS_SELECTOR, "button", "Row delete button")
class DeleteDialog: """Delete Dialog class""" body = Locator(By.CSS_SELECTOR, "mat-dialog-container", "Dialog with choices") yes = Locator(By.XPATH, "//button//span[contains(text(), 'Yes')]", "Yes button in delete dialog")
class ObjectPageLocators: """Common locators for object's detailed page""" title = Locator(By.CSS_SELECTOR, "mat-card-header mat-card-title", "Title") subtitle = Locator(By.CSS_SELECTOR, "mat-card-header mat-card-subtitle", "Subtitle") text = Locator(By.CSS_SELECTOR, "mat-card-content", "Cluster main page text")
class Filter: """Task List page filter elements locators""" all = Locator(By.CSS_SELECTOR, "mat-button-toggle[value=''] button", "All jobs filter button") running = Locator(By.CSS_SELECTOR, "mat-button-toggle[value='running'] button", "Running filter button") success = Locator(By.CSS_SELECTOR, "mat-button-toggle[value='success'] button", "Success filter button") failed = Locator(By.CSS_SELECTOR, "mat-button-toggle[value='failed'] button", "Failed filter button") filter_btn = Locator(By.CSS_SELECTOR, "mat-button-toggle button", "Filter button")
class ImportItem: """Import item elements locators""" name = Locator(By.CSS_SELECTOR, "h3", "Import item name") import_chbx = Locator(By.CSS_SELECTOR, "mat-checkbox", "Import checkbox") description = Locator(By.CSS_SELECTOR, "app-exports>div>div", "Description text")
class Toolbar: """Bundle List page toolbar elements locators""" apps_btn = Locator(By.XPATH, "//a[.//mat-icon[text()='apps']]", "Apps button") upload_btn = Locator(By.CSS_SELECTOR, "input[value='upload_bundle_file']", "Bundle upload button")
class CommonLocators: """Locators common to all pages""" socket = Locator(By.CSS_SELECTOR, ".socket", "open socket marker") profile = Locator(By.CSS_SELECTOR, ".profile", "profile load marker") load_marker = Locator(By.CSS_SELECTOR, '.load_complete', "page load marker") mat_slide_toggle = Locator(By.CSS_SELECTOR, "mat-slide-toggle", "toggle")
class GroupRow: """Row with groups info""" checkbox = Locator(By.CSS_SELECTOR, "mat-checkbox", "Group checkbox") name = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Group name") description = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(3)", "Group description") users = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(4)", "Group users")
class AccountPopup: """ADCM header popup with account settings""" settings_link = Locator(By.CSS_SELECTOR, "a[adcm_test='settings']", "Settings link") profile_link = Locator(By.CSS_SELECTOR, "button[adcm_test='profile']", "Profile link") logout_button = Locator(By.CSS_SELECTOR, "button[adcm_test='logout']", "logout button")
class RoleRow: """Row with role info""" checkbox = Locator(By.CSS_SELECTOR, "mat-checkbox", "Role checkbox") name = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(2)", "Role name") description = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(3)", "Role description") permissions = Locator(By.CSS_SELECTOR, "mat-cell:nth-child(4)", "Role permissions")
class LicensePopup: """Bundle List page licence popup elements locators""" block = Locator(By.XPATH, "//app-dialog[./h3[contains(text(), 'license')]]", "block with license agreement") agree_btn = Locator(By.XPATH, "//button[./span[contains(text(), 'Yes')]]", "Agree button")
class CreateGroupPopup: block = Locator(By.CSS_SELECTOR, "app-dialog", "Popup block") name_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Name']", "Name input") description_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Description']", "Description input") create_btn = Locator(By.CSS_SELECTOR, "app-add-controls button[color='accent']", "Create button")
class ThirdStep: """Locators for third step""" back_btn_third = Locator( By.CSS_SELECTOR, "app-rbac-policy-form-step-three~div button[matstepperprevious]", "Next button from third step", ) cancel_btn = Locator(By.XPATH, "//button[./span[text()='Cancel']]", "Cancel button")
class ClusterActionLocators: """Cluster action page elements locators""" action_card = Locator(By.CSS_SELECTOR, "app-action-card", "Action card") info_text = Locator(By.CSS_SELECTOR, "app-action-card p", "Text on action page") class ActionCard: """Cluster action page action card elements locators""" play_btn = Locator(By.CSS_SELECTOR, "button", "Action run button")
class ClusterComponentsLocators: """Cluster components page elements locators""" restore_btn = Locator(By.XPATH, "//button[./span[contains(text(), 'Restore')]]", "Restore button") save_btn = Locator(By.XPATH, "//button[./span[contains(text(), 'Save')]]", "Save button") components_title = Locator(By.XPATH, "//h3[./span[contains(text(), 'Components')]]", "Title for Components block") service_page_link = Locator(By.CSS_SELECTOR, "mat-card-content a[href*='service']", "Link to service page") hosts_title = Locator(By.XPATH, "//h3[./span[contains(text(), 'Hosts')]]", "Title for Hosts block") hosts_page_link = Locator(By.CSS_SELECTOR, "mat-card-content a[href*='host']", "Link to hosts page") create_hosts_btn = Locator(By.CSS_SELECTOR, "button[adcm_test='create-btn']", "Create hosts button") host_row = Locator(By.XPATH, "//div[./h3/span[contains(text(), 'Host')]]//app-much-2-many", "Host row") component_row = Locator( By.XPATH, "//div[./h3/span[contains(text(), 'Components')]]//app-much-2-many", "Component row", ) class Row: """Cluster components page row elements locators""" name = Locator(By.XPATH, ".//button[@mat-button]/span/span[not(contains(@class, 'warn'))]", "Item name") number = Locator(By.CSS_SELECTOR, "button[mat-raised-button] span:first-of-type", "Amount of links") relations_row = Locator(By.CSS_SELECTOR, "div[class*='relations-list']", "Row with relations") class RelationsRow: """Cluster components page relations row elements locators""" name = Locator(By.CSS_SELECTOR, "div>span", "Related item name") delete_btn = Locator(By.CSS_SELECTOR, "button", "Delete item button")
class CreateClusterPopup: """Cluster List page create cluster popup elements locators""" block = Locator(By.CSS_SELECTOR, "mat-dialog-container", "Popup block") bundle_select_btn = Locator(By.CSS_SELECTOR, "mat-select[placeholder='Bundle']", "Select bundle") version_select_btn = Locator( By.CSS_SELECTOR, "mat-select[formcontrolname='bundle_id']", "Select bundle version") select_option = Locator(By.CSS_SELECTOR, "mat-option", "Select option") upload_bundle_btn = Locator(By.CSS_SELECTOR, "input[value='upload_bundle_file']", "Upload bundle button") cluster_name_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Cluster name']", "Cluster name input") description_input = Locator(By.CSS_SELECTOR, "input[data-placeholder='Description']", "Description input") create_btn = Locator(By.CSS_SELECTOR, "app-add-controls button:last-child", "Create button") cancel_btn = Locator(By.CSS_SELECTOR, "app-add-controls button:first-child", "Cancel button")
class CommonPopupLocators: """ADCM popup locators""" block = Locator(By.CSS_SELECTOR, "app-snack-bar", "Popup block") block_by_text = TemplateLocator(By.XPATH, "//app-snack-bar//div[text()='{}']", "Popup block with text {}") text = Locator(By.CSS_SELECTOR, "app-snack-bar .message", "Popup info message") hide_btn = Locator(By.XPATH, "//button[./span[text()='Hide']]", "Hide pop up button")
class Row: """Cluster components page row elements locators""" name = Locator(By.XPATH, ".//button[@mat-button]/span/span[not(contains(@class, 'warn'))]", "Item name") number = Locator(By.CSS_SELECTOR, "button[mat-raised-button] span:first-of-type", "Amount of links") relations_row = Locator(By.CSS_SELECTOR, "div[class*='relations-list']", "Row with relations") class RelationsRow: """Cluster components page relations row elements locators""" name = Locator(By.CSS_SELECTOR, "div>span", "Related item name") delete_btn = Locator(By.CSS_SELECTOR, "button", "Delete item button")