From e0957b7d391c2b7725a3a84ada05bd1ef248ac25 Mon Sep 17 00:00:00 2001 From: Ruda Moura Date: Mon, 3 Oct 2022 15:58:54 -0300 Subject: [PATCH] ui: page 'credentials' compatible with ui makeover --- camayoc/ui/models/pages/credentials.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/camayoc/ui/models/pages/credentials.py b/camayoc/ui/models/pages/credentials.py index b4053e5f..991c96b6 100644 --- a/camayoc/ui/models/pages/credentials.py +++ b/camayoc/ui/models/pages/credentials.py @@ -37,12 +37,12 @@ def confirm(self) -> CredentialsMainPage: class NetworkCredentialForm(CredentialForm): class FormDefinition: credential_name = InputField("input[placeholder$=credential]") - authentication_type = SelectField("button#auth-type-select") - username = InputField("input[placeholder$=Username]") - password = InputField("input[placeholder$=Password]") + authentication_type = SelectField('button:has-text("Username and Password")') + username = InputField('input[placeholder="Enter Username"]') + password = InputField('input[placeholder="Enter Password"]') ssh_key_file = InputField('label:has-text("SSH Key File") + div input') passphrase = InputField('label:has-text("Passphrase") + div input') - become_method = SelectField("button#become-method-select") + become_method = SelectField('button:has-text("sudo")') become_user = InputField('label:has-text("Become User") + div input') become_password = InputField('label:has-text("Become Password") + div input') @@ -97,18 +97,18 @@ def add_credential(self, data: AddCredentialDTO) -> CredentialsMainPage: @record_action def open_add_credential(self, source_type: CredentialTypes) -> CredentialForm: - create_credential_button = "#createCredentialButton" + create_credential_button = 'button:has-text("Add Credential")' source_type_map = { CredentialTypes.NETWORK: { - "selector": f"{create_credential_button} ~ ul li:nth-of-type(1) a", + "selector": f"{create_credential_button} ~ ul li >> text=Network Credential", "class": NetworkCredentialForm, }, CredentialTypes.SATELLITE: { - "selector": f"{create_credential_button} ~ ul li:nth-of-type(2) a", + "selector": f"{create_credential_button} ~ ul li >> text=Satellite Credential", "class": SatelliteCredentialForm, }, CredentialTypes.VCENTER: { - "selector": f"{create_credential_button} ~ ul li:nth-of-type(3) a", + "selector": f"{create_credential_button} ~ ul li >> text=VCenter Credential", "class": VCenterCredentialForm, }, }