Skip to content

Commit

Permalink
Adjust to jenkinsci-matrix-project-plugin#213 (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 authored Oct 7, 2024
1 parent 6e205c4 commit 4cf2fd6
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/main/java/org/jenkinsci/test/acceptance/po/LabelAxis.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jenkinsci.test.acceptance.po;

import java.time.Duration;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;

/**
Expand All @@ -16,11 +17,25 @@ public void select(String name) {
WebElement checkBox =
find(by.path(getPath())).findElement(by.xpath(".//input[@name='values' and @json='%s']", name));
if (!checkBox.isDisplayed()) {
// 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();
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
}

waitFor().withTimeout(Duration.ofSeconds(3)).until(checkBox::isDisplayed);
}
Expand Down

0 comments on commit 4cf2fd6

Please sign in to comment.