diff --git a/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/ManagedCredentials.java b/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/ManagedCredentials.java index 06a6736078..4fd315217b 100644 --- a/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/ManagedCredentials.java +++ b/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/ManagedCredentials.java @@ -41,11 +41,7 @@ public Control checkSystemPage(String name) { * Check if the given credential is part of the domain. */ public Control checkIfCredentialsExist(String name) { - By xpath = by.xpath("//a[@title='" + name + "']"); - if (getElement(xpath) == null) { - // post credentials-2.3.2 - xpath = by.xpath("//td[contains(text(),'" + name + "')]"); - } + By xpath = by.xpath("//td[contains(text(),'" + name + "')] | //a[contains(text(), '" + name + "')]"); return control(xpath); } @@ -53,11 +49,8 @@ public Control checkIfCredentialsExist(String name) { * Find the href of the associted */ public String credentialById(String name) { - By xpath = by.xpath("//a[@title='" + name + "']"); - if (getElement(xpath) == null) { - // post credentials-2.3.2 - xpath = by.xpath("//td[contains(text(),'" + name + "')]/parent::tr//a"); - } + By xpath = by.xpath("//td[contains(text(),'" + name + "')]/parent::tr//a | //span[contains(text(),'" + name + + "')]/parent::div/parent::div//a"); return control(xpath).resolve().getAttribute("href"); } } diff --git a/src/test/java/core/CredentialsTest.java b/src/test/java/core/CredentialsTest.java index f2343e9a4f..0d55ecbeac 100644 --- a/src/test/java/core/CredentialsTest.java +++ b/src/test/java/core/CredentialsTest.java @@ -33,7 +33,7 @@ public class CredentialsTest extends AbstractJUnitTest { private static final String CRED_DOMAIN = "mydomain"; private static final String CRED_USER = "user"; private static final String CRED_PWD = "password"; - private static final String CRED_DESCR = "descr"; + private static final String CRED_DESCR = "My-super-unique-description"; @Test @WithPlugins("ssh-credentials")