diff --git a/Jenkinsfile b/Jenkinsfile index 0dd16004a..0d99f649b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -109,8 +109,6 @@ for (int i = 0; i < splits.size(); i++) { if (jdk != 21 && jenkinsVersion == 'latest') { return } - // TODO enable on LTS line when it is based on 2.480 or later - def cspRule = jenkinsVersion == 'latest' def name = "${jenkinsVersion}-${platform}-jdk${jdk}-${browser}-split${index}" branches[name] = { stage(name) { @@ -149,7 +147,7 @@ for (int i = 0; i < splits.size(); i++) { eval \$(vnc.sh) java -version mvn -v - run.sh ${browser} ${jenkinsVersion} -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo -Dmaven.test.failure.ignore=true -Dcsp.rule=${cspRule} -DforkCount=1 -B + run.sh ${browser} ${jenkinsVersion} -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo -Dmaven.test.failure.ignore=true -Dcsp.rule -DforkCount=1 -B cp --verbose target/surefire-reports/TEST-*.xml /reports """ } diff --git a/src/main/java/org/jenkinsci/test/acceptance/plugins/ssh_slaves/SshSlaveLauncher.java b/src/main/java/org/jenkinsci/test/acceptance/plugins/ssh_slaves/SshSlaveLauncher.java index 0afb48c15..540dd04b7 100644 --- a/src/main/java/org/jenkinsci/test/acceptance/plugins/ssh_slaves/SshSlaveLauncher.java +++ b/src/main/java/org/jenkinsci/test/acceptance/plugins/ssh_slaves/SshSlaveLauncher.java @@ -3,7 +3,6 @@ import static org.junit.Assert.assertTrue; import edu.umd.cs.findbugs.annotations.CheckForNull; -import hudson.util.VersionNumber; import java.time.Duration; import org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential; import org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshCredentialDialog; @@ -13,7 +12,6 @@ import org.jenkinsci.test.acceptance.po.Describable; import org.jenkinsci.test.acceptance.po.PageObject; import org.jenkinsci.test.acceptance.selenium.UselessFileDetectorReplacement; -import org.openqa.selenium.By; /** * @author Kohsuke Kawaguchi @@ -37,29 +35,9 @@ public SshSlaveLauncher(PageObject context, String path) { public SshCredentialDialog addCredential() { find(by.button("Add")).click(); - if (getElement(By.cssSelector(".credentials-add-menu-items")) != null) { - /* - * This condition is for backwards compatibility and can be removed when we drop support for Credentials - * 1381 and earlier. - */ - String providerXpathExpr = "//div[contains(@class,'credentials-add-menu-items')]" - + "/div[@class='bd']/ul[@class='first-of-type']/li[contains(@class, 'yuimenuitem')]" - + "/span[contains(@class,'yuimenuitemlabel') and contains(@tooltip, 'Jenkins Credentials Provider')]"; - waitFor(by.xpath(providerXpathExpr)).click(); - } else if (getPage().getJenkins().getVersion().isOlderThan(new VersionNumber("2.480"))) { - /* - * This condition is for backwards compatibility and can be removed when we drop support for 2.479 and - * earlier. - */ - all(by.css(".jenkins-dropdown")) - .get(1) - .findElement(by.button("Jenkins Credentials Provider")) - .click(); - } else { - find(by.css(".jenkins-dropdown")) - .findElement(by.button("Jenkins Credentials Provider")) - .click(); - } + find(by.css(".jenkins-dropdown")) + .findElement(by.button("Jenkins Credentials Provider")) + .click(); return new SshCredentialDialog(getPage(), "/credentials"); } diff --git a/src/main/java/org/jenkinsci/test/acceptance/po/LabelAxis.java b/src/main/java/org/jenkinsci/test/acceptance/po/LabelAxis.java index 48bbc9fd1..15797e579 100644 --- a/src/main/java/org/jenkinsci/test/acceptance/po/LabelAxis.java +++ b/src/main/java/org/jenkinsci/test/acceptance/po/LabelAxis.java @@ -1,7 +1,6 @@ package org.jenkinsci.test.acceptance.po; import java.time.Duration; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; /** @@ -17,25 +16,11 @@ public void select(String name) { WebElement checkBox = find(by.path(getPath())).findElement(by.xpath(".//input[@name='values' and @json='%s']", name)); if (!checkBox.isDisplayed()) { - try { - // unfold the labels and slaves sub-nodes - find(by.xpath("(//button[@class='jenkins-button mp-label-axis__button'])[1]")) - .click(); - find(by.xpath("(//button[@class='jenkins-button mp-label-axis__button'])[2]")) - .click(); - } catch (NoSuchElementException e) { - // forward compatibility - } - - try { - // unfold the labels and slaves sub-nodes - find(by.xpath("//div[@class='yahooTree labelAxis-tree']//table[@id='ygtvtableel1']//a")) - .click(); - find(by.xpath("//div[@class='yahooTree labelAxis-tree']//table[@id='ygtvtableel2']//a")) - .click(); - } catch (NoSuchElementException e) { - // backward compatibility - } + // unfold the labels and slaves sub-nodes + find(by.xpath("(//button[@class='jenkins-button mp-label-axis__button'])[1]")) + .click(); + find(by.xpath("(//button[@class='jenkins-button mp-label-axis__button'])[2]")) + .click(); waitFor().withTimeout(Duration.ofSeconds(3)).until(checkBox::isDisplayed); }