use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method multiBuildJobShouldContainCorrectNumberOfJobsHeadline.
/**
* This tests verfies the width of the display. Stageviews have to adapt
* to new stages with future builds.
*/
@Test
@WithPlugins("pipeline-stage-view@2.18")
public void multiBuildJobShouldContainCorrectNumberOfJobsHeadline() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
String pre = "node {\n";
String post = "}";
String singleStage = "stage ('Clone sources'){\n" + " echo 'cloned'\n" + " }\n";
job.script.set("");
job.sandbox.check();
job.save();
Build build = job.startBuild().shouldSucceed();
for (int i = 0; i < 10; i++) {
String text = pre + repeatString(singleStage, i + 1) + post;
job.configure(() -> job.script.set(text));
build = job.startBuild().shouldSucceed();
}
assertThat(build, notNullValue());
job.open();
StageView stageView = new StageView(job, JOB_PATH);
assertThat(stageView.getAllStageViewJobs(), hasSize(10));
assertThat(stageView.getStageViewHeadlines(), hasSize(10));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method stageViewContainsMultipleStagesWithUnstable.
/**
* Does check multiple jobs in the stage view. One with a unstable, and one with a success. Unstable jobs
* are represented with yellow color and represented with the css class "UNSTABLE".
*/
@Test
public void stageViewContainsMultipleStagesWithUnstable() {
WorkflowJob job = this.createPipelineFromFile(MUTLI_JOB_UNSTABLE);
job.startBuild().shouldBeUnstable();
job.open();
job.getNavigationLinks();
StageView stageView = new StageView(job, JOB_PATH);
String firstJob = stageView.getLatestBuild().getStageViewItem(0).toString();
assertThat(stageView.getLatestBuild().getCssClasses(), containsString("UNSTABLE"));
assertThat(firstJob, containsString("ms"));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method stageViewContainsMultipleStagesWithAborted.
/**
* Does check multiple jobs in the stage view. One with a success, and one with aborted.
* Aborted jobs are not represented in the satgeview. They are also shown green.
*/
@Test
public void stageViewContainsMultipleStagesWithAborted() {
WorkflowJob job = this.createPipelineFromFile(MUTLI_JOB_ABORTED);
job.startBuild().shouldAbort();
job.open();
job.getNavigationLinks();
StageView stageView = new StageView(job, JOB_PATH);
String firstJob = stageView.getLatestBuild().getStageViewItem(0).toString();
assertThat(stageView.getLatestBuild().getCssClasses(), containsString("ABORTED"));
assertThat(firstJob, containsString("ms"));
}
Aggregations