use of org.jenkinsci.test.acceptance.plugins.analysis_core.GraphConfigurationView in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method deactivateTrendGraph.
private void deactivateTrendGraph(final Job job, final AnalysisAction action) {
GraphConfigurationView view = action.configureTrendGraphForUser();
view.open();
view.deactivateTrend();
view.save();
List<WebElement> enableLinks = job.all(By.partialLinkText("Enable"));
assertThat(enableLinks.size(), is(1));
enableLinks.get(0).click();
elasticSleep(500);
assertThat(getCurrentUrl(), containsRegexp(action.getUrl() + "/configure/"));
}
use of org.jenkinsci.test.acceptance.plugins.analysis_core.GraphConfigurationView in project acceptance-test-harness by jenkinsci.
the class CheckStylePluginTest method should_show_warnings_per_user.
/**
* Verifies that blaming of warnings works on agents: creates a new project in a Git repository in a docker
* container. Registers the same docker container as slave agent to build the project. Uses the recorded build
* results in checkstyle-result.xml (no actual maven goal is invoked). Verifies that the blame information is
* correctly assigned for each of the warnings. Also checks, that the age is increased for yet another build.
*/
@Test
@WithPlugins({ "git", "dashboard-view", "analysis-core@1.88-SNAPSHOT", "ssh-slaves" })
@WithDocker
@Issue("JENKINS-6748")
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, CREDENTIALS_KEY })
public void should_show_warnings_per_user() {
// avoid JENKINS-49026
jenkins.restart();
DumbSlave agent = createDockerAgent();
String gitRepositoryUrl = createGitRepositoryInDockerContainer();
FreeStyleJob job = createFreeStyleJob(jenkins, null, settings -> settings.pattern.set("**/checkstyle-result.xml"));
job.configure(() -> {
job.useScm(GitScm.class).url(gitRepositoryUrl).credentials(CREDENTIALS_ID);
job.setLabelExpression(agent.getName());
});
buildSuccessfulJob(job);
CheckStyleAction action = new CheckStyleAction(job);
action.open();
SortedMap<String, Integer> expectedPeople = new TreeMap<>();
expectedPeople.put("Unknown authors", 1);
expectedPeople.put("Jenkins-ATH <jenkins-ath@example.org>", 11);
assertThat(action.getPeopleTabContents(), is(expectedPeople));
action.find(By.partialLinkText("Jenkins-ATH")).click();
assertThat(driver, hasContent("Checkstyle Warnings - Jenkins-ATH"));
action.open();
SortedMap<String, String> expectedOrigin = new TreeMap<>();
expectedOrigin.put("Main.java:0", "-");
expectedOrigin.put("Main.java:2", "Jenkins-ATH");
expectedOrigin.put("Main.java:4", "Jenkins-ATH");
expectedOrigin.put("Main.java:6", "Jenkins-ATH");
expectedOrigin.put("Main.java:9", "Jenkins-ATH");
expectedOrigin.put("Main.java:13", "Jenkins-ATH");
expectedOrigin.put("Main.java:18", "Jenkins-ATH");
expectedOrigin.put("Main.java:23", "Jenkins-ATH");
expectedOrigin.put("Main.java:24", "Jenkins-ATH");
expectedOrigin.put("Main.java:27", "Jenkins-ATH");
assertThat(action.getOriginTabContentsAsStrings(AUTHOR), is(expectedOrigin));
assertThatAgeIsAt(action, expectedOrigin, 1);
buildSuccessfulJob(job);
assertThatAgeIsAt(action, expectedOrigin, 2);
GraphConfigurationView view = action.configureTrendGraphForUser();
view.open();
view.setUserGraph();
view.save();
WebElement graph = find(getUsersTrendGraphXpath());
assertThat(graph.isDisplayed(), is(true));
verifyNoAuthors(action, true);
WebElement nothing = getElement(getUsersTrendGraphXpath());
assertThat(nothing, nullValue());
verifyNoAuthors(action, false);
}
Aggregations