Add detailstab UI tests to SmokeTests
package io.jenkins.plugins.analysis.warnings;
+import java.util.List;
+
import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
import org.jenkinsci.test.acceptance.junit.WithPlugins;
import org.jenkinsci.test.acceptance.po.Build;
@@ -8,6 +12,9 @@ import org.jenkinsci.test.acceptance.po.Folder;
import org.jenkinsci.test.acceptance.po.FreeStyleJob;
import org.jenkinsci.test.acceptance.po.WorkflowJob;
+import io.jenkins.plugins.analysis.warnings.AnalysisResult.Tab;
+
+import static io.jenkins.plugins.analysis.warnings.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;
/**
@@ -102,6 +109,25 @@ public class SmokeTests extends UiTest {
verifyFindBugs(build);
verifyCheckStyle(build);
verifyCpd(build);
+ verifyDetailsTab(build);
+ }
+
+ /**
+ * Asserts correct display of Page Objects in the details section of a CheckStyle result page.
+ */
+ private void verifyDetailsTab(final Build build) {
+ build.open();
+
+ AnalysisResult resultPage = new AnalysisResult(build, "checkstyle");
+ resultPage.open();
+ assertThat(resultPage).hasOnlyAvailableTabs(Tab.ISSUES, Tab.TYPES, Tab.CATEGORIES);
+ PropertyDetailsTable categoriesDetailsTable = resultPage.openPropertiesTable(Tab.CATEGORIES);
+ assertThat(categoriesDetailsTable).hasHeaders("Category", "Total", "Distribution");
+ assertThat(categoriesDetailsTable).hasSize(2).hasTotal(2);
+
+ WebElement categoryPaginate = resultPage.getPaginateElementByActiveTab();
+ List<WebElement> categoryPaginateButtons = categoryPaginate.findElements(By.cssSelector("ul li"));
+ assertThat(categoryPaginateButtons.size()).isEqualTo(1);
}
private StringBuilder createReportFilesStep(final WorkflowJob job, final int build) {
