use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method jobShouldContainStageView.
@Test
public void jobShouldContainStageView() {
WorkflowJob job = this.createPipelineFromFile(SINGLE_JOB);
job.startBuild().shouldSucceed();
job.open();
StageView stageView = new StageView(job, JOB_PATH);
assertThat(stageView.getRootElementName().getText(), containsString("Stage View"));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method multiBuildJobShouldContainCorrectNumberOfJobsBuilt.
/**
* This tests verifies the height of the diplay. The standard height is 11 of the maximum builds dislayed
* aka Pagination
*/
@Test
@WithPlugins("pipeline-stage-view@2.18")
public void multiBuildJobShouldContainCorrectNumberOfJobsBuilt() {
WorkflowJob job = this.createPipelineFromFile(SINGLE_JOB);
Build build = null;
for (int i = 0; i < 8; i++) {
build = job.startBuild().shouldSucceed();
}
assertThat(build, notNullValue());
job.open();
StageView stageView = new StageView(job, JOB_PATH);
// as not max display
assertThat(stageView.getAllStageViewJobs(), hasSize(8));
for (int i = 0; i < 10; i++) {
build = job.startBuild().shouldSucceed();
}
assertThat(build, notNullValue());
job.open();
stageView = new StageView(job, JOB_PATH);
// max diplay is 10
assertThat(stageView.getAllStageViewJobs(), hasSize(10));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method stageViewContainsMultipleStages.
/**
* Does check multiple jobs in the stage view. Second part uses long name to verify the display.
* Note: emptyjob names are not allowed
*/
@Test
public void stageViewContainsMultipleStages() {
WorkflowJob job = this.createPipelineFromFile(MULTI_JOB);
job.startBuild().shouldSucceed();
job.open();
StageView stageView = new StageView(job, JOB_PATH);
assertThat(stageView.getStageViewHeadlines().get(0).getName(), containsString("Clone sources"));
assertThat(stageView.getStageViewHeadlines().get(1).getName(), containsString("Build"));
job = this.createPipelineFromFile(MULTI_JOB_IRR_NAMES);
job.startBuild().shouldSucceed();
job.open();
stageView = new StageView(job, JOB_PATH);
assertThat(stageView.getStageViewHeadlines().get(0).getName(), containsString("-"));
assertThat(stageView.getStageViewHeadlines().get(1).getName(), containsString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"));
assertThat(stageView.getStageViewHeadlines().get(2).getName(), containsString(",.-;:_*+#"));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method jobNumberShouldbeCorrect.
@Test
public void jobNumberShouldbeCorrect() {
WorkflowJob job = this.createPipelineFromFile(SINGLE_JOB);
Build build = job.startBuild().shouldSucceed();
job.open();
job.getNavigationLinks();
StageView stageView = new StageView(job, JOB_PATH);
assertThat(stageView.getLatestBuild().getBuildNo(), containsString(String.valueOf(build.getNumber())));
}
use of org.jenkinsci.test.acceptance.plugins.stageview.StageView in project acceptance-test-harness by jenkinsci.
the class StageViewTest method stageViewContainsMultipleStagesWithFail.
/**
* Does check multiple jobs in the stage view. One with a failed, and one with a success.
*/
@Test
public void stageViewContainsMultipleStagesWithFail() {
WorkflowJob job = this.createPipelineFromFile(MUTLI_JOB_FAIL);
job.startBuild().shouldFail();
job.open();
job.getNavigationLinks();
StageView stageView = new StageView(job, JOB_PATH);
String firstJob = stageView.getLatestBuild().getStageViewItem(0).toString();
String secondJob = stageView.getLatestBuild().getStageViewItem(1).toString();
assertThat(stageView.getLatestBuild().getCssClasses(), containsString("FAILED"));
assertThat(firstJob, containsString("ms"));
assertThat(secondJob, containsString("failed"));
}
Aggregations