Skip to content

Commit

Permalink
ui: page 'credentials' compatible with ui makeover
Browse files Browse the repository at this point in the history
  • Loading branch information
ruda committed Aug 9, 2023
1 parent 479d0a5 commit e0957b7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions camayoc/ui/models/pages/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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,
},
}
Expand Down

0 comments on commit e0957b7

Please sign in to comment.