Search in sources :

Example 1 with HtmlTableRow

use of com.gargoylesoftware.htmlunit.html.HtmlTableRow in project JSCover by tntim96.

the class HtmlUnitUITest method sortByField.

private void sortByField(HtmlPage page, String field) throws IOException {
    populateDataMap(field);
    page.getHtmlElementById("sortBy" + field).click();
    webClient.waitForBackgroundJavaScript(100);
    Collections.sort(data, HTMLCoverageData.by(field));
    int currentValue = Integer.MIN_VALUE;
    final int[] matched = new int[] { 0 };
    for (int i = 0; i < data.size(); i++) {
        HtmlTableRow htmlTableRow = (HtmlTableRow) page.getByXPath("//tbody[@id='summaryTbody']/tr[" + (i + 1) + "]").get(0);
        currentValue = verifyRow(field, currentValue, matched, htmlTableRow);
    }
    assertThat(matched[0], equalTo(data.size()));
}
Also used : HtmlTableRow(com.gargoylesoftware.htmlunit.html.HtmlTableRow)

Example 2 with HtmlTableRow

use of com.gargoylesoftware.htmlunit.html.HtmlTableRow in project selenium_java by sergueik.

the class WhenBrowsingReportsList method testShouldDisplayReportDetailsCorrectly.

@Test
public void testShouldDisplayReportDetailsCorrectly() {
    // each row in the reports list must have the report icon,
    // the report title, the report description, and report info
    final List<HtmlTableRow> rows = page.getReportsList();
    // first row contains the headers and can be skipped
    for (int rowCtr = 1; rowCtr < rows.size(); rowCtr++) {
        final HtmlTableRow reportData = rows.get(rowCtr);
        Assert.assertEquals("Unexpected number of cells", 4, reportData.getCells().size());
        checkReportIcon(reportData);
        checkReportTitle(reportData);
        checkReportHyperlinks(reportData);
        checkReportDescription(reportData);
        checkReportInfo(reportData);
    }
}
Also used : HtmlTableRow(com.gargoylesoftware.htmlunit.html.HtmlTableRow) Test(org.junit.Test)

Example 3 with HtmlTableRow

use of com.gargoylesoftware.htmlunit.html.HtmlTableRow in project selenium_java by sergueik.

the class JenkinsConfigurationPage method getAuditReportsPermissionColumnNumber.

public int getAuditReportsPermissionColumnNumber() {
    int retval = -1;
    // the auth matrix' header is actually the first row
    final HtmlTableRow firstRow = getSecurityMatrix().getRow(0);
    for (int cellCtr = 0; cellCtr < firstRow.getCells().size(); cellCtr++) {
        final HtmlTableCell cell = firstRow.getCell(cellCtr);
        if (cell.getTextContent().equalsIgnoreCase("Audit Reports")) {
            retval = cellCtr;
            break;
        }
    }
    return retval;
}
Also used : HtmlTableRow(com.gargoylesoftware.htmlunit.html.HtmlTableRow) HtmlTableCell(com.gargoylesoftware.htmlunit.html.HtmlTableCell)

Example 4 with HtmlTableRow

use of com.gargoylesoftware.htmlunit.html.HtmlTableRow in project selenium_java by sergueik.

the class JenkinsConfigurationPage method getUserPermissionRowNumber.

public int getUserPermissionRowNumber(final String userName) {
    int retval = -1;
    final HtmlTable securityMatrix = getSecurityMatrix();
    for (int rowCtr = 0; rowCtr < securityMatrix.getRowCount(); rowCtr++) {
        final HtmlTableRow row = securityMatrix.getRow(rowCtr);
        if (row.getAttribute("name").equalsIgnoreCase(userName)) {
            retval = rowCtr;
            break;
        }
    }
    return retval;
}
Also used : HtmlTableRow(com.gargoylesoftware.htmlunit.html.HtmlTableRow) HtmlTable(com.gargoylesoftware.htmlunit.html.HtmlTable)

Aggregations

HtmlTableRow (com.gargoylesoftware.htmlunit.html.HtmlTableRow)4 HtmlTable (com.gargoylesoftware.htmlunit.html.HtmlTable)1 HtmlTableCell (com.gargoylesoftware.htmlunit.html.HtmlTableCell)1 Test (org.junit.Test)1