Skip to content
Permalink
Browse files

[JENKINS-42581] Adapt to changes in JENKINS-41416.

  • Loading branch information...
varyvol committed Mar 9, 2017
1 parent 2756ba7 commit ba4dd2f6562672e7919f6db496d8854b3cc5a0e5
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/main/java/org/jenkinsci/test/acceptance/po/WorkflowMultiBranchJob.java
@@ -2,13 +2,15 @@

import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.IOUtils;
import org.jenkinsci.test.acceptance.plugins.workflow_multibranch.BranchSource;

import com.google.inject.Injector;
import org.openqa.selenium.WebElement;

/**
* A pipeline multi-branch job (requires installation of multi-branch-project-plugin).
@@ -59,8 +61,16 @@ public WorkflowJob getJob(final String name) {
}

public void reIndex() {
driver.findElement(by.xpath("//div[@class=\"task\"]//*[text()=\"Scan Repository\" or text()=\"Branch Indexing\"]")).click();
driver.findElement(by.xpath("//div[@class=\"subtasks\"]//*[text()=\"Run Now\"]")).click();
final List<WebElement> scanRepoNow = driver.findElements(by.xpath("//div[@class=\"task\"]//*[text()=\"Scan Repository Now\"]"));

if (scanRepoNow.size() > 0) {
// JENKINS-41416
scanRepoNow.get(0).click();
} else {
// Previous versions
find(by.xpath("//div[@class=\"task\"]//*[text()=\"Scan Repository\" or text()=\"Branch Indexing\"]")).click();
find(by.xpath("//div[@class=\"subtasks\"]//*[text()=\"Run Now\"]")).click();
}
}

}

0 comments on commit ba4dd2f

Please sign in to comment.
You can’t perform that action at this time.