use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class JdkTest method autoinstallJdk.
@Test
@TestActivation({ "ORACLE_LOGIN", "ORACLE_PASSWORD" })
public void autoinstallJdk() {
final String login = System.getProperty("JdkTest.ORACLE_LOGIN");
final String passwd = System.getProperty("JdkTest.ORACLE_PASSWORD");
ToolInstallation.waitForUpdates(jenkins, JdkInstallation.class);
JdkInstallation jdk = ToolInstallation.addTool(jenkins, JdkInstallation.class);
jdk.name.set("jdk_1.8.0");
jdk.installVersion("jdk-8u141-oth-JPR");
jdk.getPage().save();
jdk.setCredentials(login, passwd);
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.addShellStep("java -version");
job.save();
int tenMinutes = 600000;
job.startBuild().waitUntilFinished(tenMinutes).shouldSucceed().shouldContainsConsoleOutput("Installing JDK jdk-8u141-oth-JPR").shouldContainsConsoleOutput("Downloading JDK from http://download.oracle.com");
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_send_mail_with_expanded_tokens.
/**
* Checks that the plug-in sends a mail after a build has been failed. The content of the mail contains several
* tokens that should be expanded in the mail with the correct values.
*/
// TODO: we should have two builds so that the numbers are different
@Test
@Issue("JENKINS-25501")
@WithPlugins("email-ext")
public void should_send_mail_with_expanded_tokens() {
// avoid JENKINS-49026
checkExtensionAreDeployed("hudson.plugins.analysis.tokens.AbstractTokenMacro", Collections.EMPTY_SET);
setUpMailer();
FreeStyleJob job = createFreeStyleJob();
P projectAction = createProjectAction(job);
job.editPublisher(projectAction.getFreeStyleSettings(), settings -> settings.setBuildFailedTotalAll("0"));
String name = projectAction.getUrl().toUpperCase();
String title = "Analysis-Result";
configureEmailNotification(job, String.format("%s: ${%s_RESULT}", title, name), String.format("%s: ${%s_COUNT}-${%s_FIXED}-${%s_NEW}", title, name, name, name));
buildFailingJob(job);
verifyReceivedMail(String.format("%s: FAILURE", title), String.format("%s: %d-0-%d", title, getNumberOfWarnings(), getNumberOfWarnings()));
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_show_warning_totals_in_view_column_with_link_to_results.
/**
* Sets up a list view with a warnings column. Builds a job and checks if the column shows the correct number of
* warnings and provides a direct link to the actual warning results.
*/
@Test
@Issue("JENKINS-24436")
public void should_show_warning_totals_in_view_column_with_link_to_results() {
FreeStyleJob job = createFreeStyleJob();
buildJobAndWait(job).shouldSucceed();
P projectAction = createProjectAction(job);
addListViewColumn(projectAction.getViewColumn(), jenkins);
verifyColumn(projectAction);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_show_build_health.
/**
* Builds a freestyle job with an enabled publisher of the plug-in under test. Sets the thresholds for the trend
* report so that a health of 0-19% is evaluated for the plug-in under test (shown as tool tip in the Jenkins
* main view).
* TODO: Add different health percentages
*/
@Test
@Issue("JENKINS-28360")
public void should_show_build_health() {
FreeStyleJob job = createFreeStyleJob();
AnalysisAction projectAction = createProjectAction(job);
job.editPublisher(projectAction.getFreeStyleSettings(), settings -> {
settings.setBuildHealthyThreshold(0);
settings.setBuildUnhealthyThreshold(getNumberOfWarnings());
});
buildSuccessfulJob(job);
jenkins.open();
List<WebElement> healthElements = all(by.xpath("//div[@class='healthReportDetails']//tr"));
assertThat(healthElements.size(), is(3));
String expectedText = String.format("%s: %d %s%s found.", projectAction.getPluginName(), getNumberOfWarnings(), projectAction.getAnnotationName(), plural(getNumberOfWarnings()));
assertThatHealthReportIs(healthElements.get(1), expectedText, "00to19");
assertThatHealthReportIs(healthElements.get(2), "Build stability: No recent builds failed.", "80plus");
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method addAndConfigureTasksPublisher.
private void addAndConfigureTasksPublisher(final FreeStyleJob job) {
TasksFreestyleSettings taskScannerSettings = job.addPublisher(TasksFreestyleSettings.class);
AnalysisConfigurator<TasksFreestyleSettings> configurator = settings -> {
settings.setHighPriorityTags("PRIO1");
settings.setNormalPriorityTags("PRIO2,TODO");
settings.setLowPriorityTags("PRIO3");
};
configurator.accept(taskScannerSettings);
}
Aggregations