Add page objects for ForensicsTable
@@ -16,6 +16,7 @@ import org.jenkinsci.test.acceptance.po.Build;
import org.jenkinsci.test.acceptance.po.PageObject;
import io.jenkins.plugins.analysis.warnings.BlamesTable.BlamesTableRowType;
+import io.jenkins.plugins.analysis.warnings.ForensicsTable.ForensicsTableRowType;
import io.jenkins.plugins.analysis.warnings.IssuesTable.IssuesTableRowType;
/**
@@ -125,6 +126,18 @@ public class AnalysisResult extends PageObject {
return BlamesTableRowType.DEFAULT;
}
+ /**
+ * Returns the type of the rows in the forensics table.
+ *
+ * @return the row type
+ */
+ private ForensicsTableRowType getForensicsTableType() {
+ if (ArrayUtils.contains(DRY_TOOLS, id)) {
+ return ForensicsTableRowType.DRY;
+ }
+ return ForensicsTableRowType.DEFAULT;
+ }
+
/**
* Opens the analysis details page and selects the specified tab.
*
@@ -158,6 +171,19 @@ public class AnalysisResult extends PageObject {
return new BlamesTable(blamesTab, this, getBlamesTableType());
}
+ /**
+ * Opens the analysis details page, selects the tab {@link Tab#FORENSICS} and returns the {@link PageObject} of the
+ * forensics table.
+ *
+ * @return page object of the forensics table.
+ */
+ public ForensicsTable openForensicsTable() {
+ openTab(Tab.FORENSICS);
+
+ WebElement forensicsTab = find(By.id("forensicsContent"));
+ return new ForensicsTable(forensicsTab, this, getForensicsTableType());
+ }
+
/**
* Opens a link on the page leading to another page.
*
@@ -206,7 +232,8 @@ public class AnalysisResult extends PageObject {
CATEGORIES("category"),
TYPES("type"),
ISSUES("issues"),
- BLAMES("blames");
+ BLAMES("blames"),
+ FORENSICS("forensics");
private final String href;
