Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 committed Jul 14, 2024
1 parent 26c2f60 commit 416f7ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/src/test/java/jenkins/widgets/BuildTimeTrendTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void withAbstractJob_OnBuiltInNode() throws Exception {
wc.withThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.getPage(p, "buildTimeTrend");

HtmlTable table = page.getDocumentElement().querySelector("table[data-is-distributed-build-enabled=false]");
HtmlTable table = page.getDocumentElement().querySelector("table[data-show-agent=false]");
assertNotNull(table);
}

Expand All @@ -91,7 +91,7 @@ public void withAbstractJob_OnAgentNode() throws Exception {

wc.withThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.getPage(p, "buildTimeTrend");
DomNodeList<DomNode> anchors = page.getDocumentElement().querySelectorAll("table[data-is-distributed-build-enabled=true] td a");
DomNodeList<DomNode> anchors = page.getDocumentElement().querySelectorAll("table[data-show-agent=true] td a");
Optional<DomNode> anchor = anchors.stream()
.filter(a -> a.getTextContent().equals(agent.getNodeName()))
.findFirst();
Expand All @@ -115,15 +115,15 @@ public void withAbstractJob_OnBoth() throws Exception {
wc.withThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.getPage(p, "buildTimeTrend");

DomNodeList<DomNode> anchors = page.getDocumentElement().querySelectorAll("table[data-is-distributed-build-enabled=true] td a");
DomNodeList<DomNode> anchors = page.getDocumentElement().querySelectorAll("table[data-show-agent=true] td a");
Optional<DomNode> anchor = anchors.stream()
.filter(a -> a.getTextContent().equals(agent.getNodeName()))
.findFirst();
// for the build on agent
assertTrue(anchor.isPresent());

String builtInNode = hudson.model.Messages.Hudson_Computer_DisplayName();
DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-is-distributed-build-enabled=true] td");
DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-show-agent=true] td");
Optional<DomNode> td = tds.stream()
.filter(t -> t.getTextContent().equals(builtInNode))
.findFirst();
Expand All @@ -142,7 +142,7 @@ public void withNonAbstractJob_withoutAgents() throws Exception {
wc.withThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.getPage(p, "buildTimeTrend");

DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-is-distributed-build-enabled=false] td");
DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-show-agent=false] td");
Optional<DomNode> td = tds.stream()
.filter(t -> t.getTextContent().equals("#1"))
.findFirst();
Expand All @@ -168,7 +168,7 @@ public void withNonAbstractJob_withAgents() throws Exception {
wc.withThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.getPage(p, "buildTimeTrend");

DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-is-distributed-build-enabled=true] td");
DomNodeList<DomNode> tds = page.getDocumentElement().querySelectorAll("table[data-show-agent=false] td");
Optional<DomNode> td = tds.stream()
.filter(t -> t.getTextContent().equals("#1"))
.findFirst();
Expand Down

0 comments on commit 416f7ce

Please sign in to comment.