Skip to content

Commit

Permalink
[JENKINS-42581] Adapt to changes in JENKINS-41416.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evaristo Gutiérrez committed Mar 9, 2017
1 parent 2756ba7 commit ba4dd2f
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -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).
Expand Down Expand Up @@ -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.