Skip to content

Commit

Permalink
[JENKINS-39947] Added verification of all portlet links.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed May 29, 2017
1 parent 220c16b commit e4b6085
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions src/test/java/plugins/AbstractAnalysisTest.java
Expand Up @@ -38,6 +38,7 @@
import org.jenkinsci.test.acceptance.plugins.maven.MavenBuildStep;
import org.jenkinsci.test.acceptance.plugins.maven.MavenInstallation;
import org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet;
import org.jenkinsci.test.acceptance.plugins.nested_view.NestedView;
import org.jenkinsci.test.acceptance.po.Build;
import org.jenkinsci.test.acceptance.po.Container;
import org.jenkinsci.test.acceptance.po.Folder;
Expand Down Expand Up @@ -130,24 +131,34 @@ private Class<? extends AnalysisSettings> getFreeStyleSettingsFor(final FreeStyl
}

/**
* Sets up a job within a folder. Verifies that the project action from the job redirects to the result
* of the last build. Checks the correct number of warnings in the project overview and
* result details view. Finally checks if the warnings-per-project portlet and warnings column show the
* Sets up a nested view that contains a dashboard view with a warnings-per-project portlet.
* Creates a folder in this view and a freestyle job in this folder.
* Finally checks if the warnings-per-project portlet and warnings column show the
* correct number of warnings and provide a direct link to the actual warning results.
*/
@Test @Issue({"JENKINS-39947", "JENKINS-39950"}) @WithPlugins({"dashboard-view", "cloudbees-folder"})
@Test @Issue("JENKINS-39947") @WithPlugins({"dashboard-view", "nested-view", "cloudbees-folder", "analysis-core@1.87"})
public void should_show_warnings_in_folder() {
Folder folder = jenkins.jobs.create(Folder.class, jenkins.createRandomName());
folder.save();
NestedView nested = jenkins.getViews().create(NestedView.class);

DashboardView dashboard = nested.getViews().create(DashboardView.class);
dashboard.configure(() -> {
dashboard.matchAllJobs();
dashboard.checkRecurseIntoFolders();
});

Folder folder = dashboard.jobs.create(Folder.class);
folder.save();
folder.open();

FreeStyleJob job = createFreeStyleJob(folder);
runAndVerifyJobResults(job);

P projectAction = createProjectAction(job);

addDashboardViewAndBottomPortlet(projectAction.getTablePortlet(), folder);
dashboard.configure(() -> {
dashboard.addBottomPortlet(projectAction.getTablePortlet());
});

verifyPortlet(projectAction);

addListViewColumn(projectAction.getViewColumn(), folder);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/plugins/AnalysisCollectorPluginTest.java
Expand Up @@ -259,7 +259,7 @@ public void should_set_warnings_count_in_list_view_column() {
FreeStyleJob job = createFreeStyleJob();
buildSuccessfulJob(job);

ListView view = jenkins.views.create(ListView.class, createRandomName());
ListView view = jenkins.views.create(ListView.class);
view.configure();
view.matchAllJobs();
view.addColumn(AnalysisCollectorColumn.class);
Expand Down

0 comments on commit e4b6085

Please sign in to comment.