Package org.seleniuminspector.html

Examples of org.seleniuminspector.html.TableInspector


    public DropDownPopupInspector(ElementInspector element) {
        super(element);
    }

    public TableInspector itemsTable() {
        return new TableInspector(id() + DropDownPopup.INNER_TABLE_SUFFIX);
    }
View Full Code Here


                item2.childNodesByName("td").get(0).assertStyle("font-size: 18px;");
            item2.assertStyle("color: Teal;");

            popup.assertStyle("border: 1px dotted red");

            TableInspector itemsTable = popup.itemsTable();
            ElementInspector firstFooterCell = itemsTable.subElement("tfoot[0]/tr[0]/td[0]");
            firstFooterCell.assertStyle("color: silver");

            itemsTable.subElement("thead[0]/tr[0]").assertStyle("text-decoration: underline");
            ElementInspector firstHeaderCell = itemsTable.subElement("thead[0]/tr[0]/td[0]");
            firstHeaderCell.assertStyle("color: red");

            items.get(1).assertStyle("background: bisque;");

            items.get(2).subElement("td[0]").assertStyle("border-right: 1px solid blue; border-bottom: 2px dotted DarkOliveGreen");
View Full Code Here

    }

    private void verifyStyles(TabSetInspector tabSet, int selectedTabIndex) {
        ElementInspector firstTab = tabSet.tabs().get(0);
        ElementInspector secondTab = tabSet.tabs().get(1);
        TableInspector tabSetAsTable = new TableInspector(tabSet);
        TableCellInspector emptySpaceCell = tabSetAsTable.body().row(0).cell(4);

        emptySpaceCell.assertStyle("background: beige");

        // backBorderStyle="2px solid SpringGreen"
        if (selectedTabIndex == 0) {
            secondTab.assertStyle("border-left: 2px solid SpringGreen; border-right: 2px solid SpringGreen;");
        } else if (selectedTabIndex == 1) {
            firstTab.assertStyle("border-left: 2px solid SpringGreen; border-right: 2px solid SpringGreen");
        }

        // frontBorderStyle="3px dashed OliveDrab"
        if (selectedTabIndex == 0) {
            secondTab.assertStyle("border-bottom: 3px dashed OliveDrab");
            firstTab.assertStyle("border-right: 3px dashed OliveDrab");
        } else if (selectedTabIndex == 1) {
            firstTab.assertStyle("border-bottom: 3px dashed OliveDrab");
            secondTab.assertStyle("border-right: 3px dashed OliveDrab");
        }

        emptySpaceCell.assertStyle("border-bottom: 3px dashed OliveDrab");

        tabSetAsTable.body().row(0).cell(0).assertStyle("border-bottom: 3px dashed OliveDrab");

        // tabStyle="background: azure; border-top: 1px dotted darkgreen; width: 70px;"
        if (selectedTabIndex == 0) {
            secondTab.assertStyle("background: azure; width: 70px; border-top: 1px dotted darkgreen");
        } else if (selectedTabIndex == 1) {
View Full Code Here

    }

     @Test
    public void testColumnGroups_headers() {
        testAppFunctionalPage("/components/datatable/dataTableColumnGroups.jsf");
        TableInspector table = dataTable("formID:twoHeadersTable");

        TableSectionInspector header = table.header();
        TableRowInspector firstHeaderRow = header.row(0);
        firstHeaderRow.assertCellParams(new TableCellParams[]{
                new TableCellParams(NBSP_CHAR, 1, 2,
                        "border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Fields", 4, 1,
                        "background: SteelBlue; border-right: 1px solid #a0a0a0; border-bottom: ? none ?"),
                new TableCellParams("Integer Fields", 3, 1,
                        "background: ForestGreen; border-right: ? none ?; border-bottom: ? none ?")
        });
        TableRowInspector secondHeaderRow = header.row(1);
        secondHeaderRow.assertCellParams(new TableCellParams[]{
                new TableCellParams(null, 1, 1,
                        "background: LightSteelBlue; border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Field 1", 1, 1,
                        "background: LightSteelBlue; border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Field 2", 1, 1,
                        "background: LightSteelBlue; border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Field 3", 1, 1,
                        "background: LightSteelBlue; border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("Int Field 1", 1, 1,
                        "background: LawnGreen; border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("Int Field 2", 1, 1,
                        "background: LawnGreen; border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("Int Field 3", 1, 1,
                        "background: LawnGreen; border-right: ? none ?; border-bottom: 1px solid #a0a0a0")
        });

        TableSectionInspector body = table.body();
        assertEquals("Checking body row count", 10, body.rowCount());
        for (int i = 0, count = body.rowCount(); i < count - 1; i++) {
            body.row(i).assertCellStyles("border-bottom: 1px solid #e0e0e0");
        }

        body.assertColumnCellStyles(new String[]{
                "border-right: 1px solid #e0e0e0",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: 1px solid #e0e0e0",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: ? none ?"});

        table.footer().assertElementExists(false);
    }
View Full Code Here

     @Test
    public void testColumnGroups_styles() {
        testAppFunctionalPage("/components/datatable/dataTableColumnGroups.jsf");
        tabbedPane("formID:testSelector").setPageIndex(1, ServerLoadingMode.getInstance());

        TableInspector table = dataTable("formID:groupStylesTable");
        assertEquals("There should be two header rows", 2, table.header().rowCount());
        assertEquals("There should be 10 body rows", 10, table.body().rowCount());
        assertFalse("There should be no footer", table.footer().elementExists());

        table.header().row(0).assertCellParams(new TableCellParams[]{
                new TableCellParams(NBSP_CHAR),
                new TableCellParams("String Field 1"),
                new TableCellParams("String Field 2"),
                new TableCellParams("String Field 3"),
                new TableCellParams("Int Field 1"),
                new TableCellParams("Int Field 2"),
                new TableCellParams("Int Field 3")
        });

        assertEquals("Checking number of columns", 7, table.getColumnCount());

        for (int i = 0; i <= 3; i++)
            table.column(i).assertStyle("background: Tan");
        table.column(1).assertStyle("color: gray");
        table.column(2).assertStyle("color: green");
        table.column(3).assertStyle("color: blue");
        for (int i = 4; i <= 6; i++)
            table.column(i).assertStyle("color: black");
        table.column(4).assertStyle("background: LightSteelBlue");
        table.column(5).assertStyle("background: LightSteelBlue");
        table.column(6).assertStyle("background: SteelBlue");
    }
View Full Code Here

     @Test
    public void testColumnGroups_footers() {
        testAppFunctionalPage("/components/datatable/dataTableColumnGroups.jsf");
        tabbedPane("formID:testSelector").setPageIndex(2, ServerLoadingMode.getInstance());

        TableInspector table = dataTable("formID:twoFootersTable");
        TableSectionInspector body = table.body();
        assertFalse("There should be no header", table.header().elementExists());
        assertEquals("There should be 10 body rows", 10, body.rowCount());

        TableSectionInspector footer = table.footer();
        assertEquals("There should be 2 footer rows", 2, footer.rowCount());
        footer.row(0).assertCellStyles("border-top: 1px solid #a0a0a0");
        footer.row(0).assertCellStyles("border-bottom: ? none ?");
        footer.row(1).assertCellStyles("border-top: ? none ?");
        footer.row(1).assertCellStyles("border-bottom: ? none ?");

        table.footer().row(0).assertCellParams(new TableCellParams[]{
                new TableCellParams(null, 1, 1, "background: DarkKhaki"),
                new TableCellParams("String Field 1", 1, 1, "background: DarkKhaki"),
                new TableCellParams("String Field 2", 1, 1, "background: DarkKhaki"),
                new TableCellParams("String Field 3", 1, 1, "background: DarkKhaki"),
                new TableCellParams("Int Field 1", 1, 1, "background: BurlyWood"),
                new TableCellParams("Int Field 2", 1, 1, "background: LightSalmon"),
                new TableCellParams("Int Field 3", 1, 1, "background: BurlyWood")
        });
        table.footer().row(1).assertCellParams(new TableCellParams[]{
                new TableCellParams("String Fields", 4, 1, "background: Olive"),
                new TableCellParams("Integer Fields", 3, 1, "background: Peru")
        });

        assertEquals("Checking number of columns", 7, table.getColumnCount());
        for (int i = 0; i <= 3; i++)
            table.column(i).assertStyle("background: Khaki");
        for (int i = 4; i <= 6; i++)
            table.column(i).assertStyle("background: Bisque");
    }
View Full Code Here

     @Test
    public void testColumnGroups_mixed() {
        testAppFunctionalPage("/components/datatable/dataTableColumnGroups.jsf");
        tabbedPane("formID:testSelector").setPageIndex(3, ServerLoadingMode.getInstance());

        TableInspector table = dataTable("formID:mixedHeadersTable");

        assertEquals("Checking the number of columns", 9, table.getColumnCount());

        TableSectionInspector header = table.header();
        assertEquals("Checking the number of header rows", 4, header.rowCount());
        header.row(0).assertCellParams(new TableCellParams[]{
                new TableCellParams("Common Header", 9, 1, "border-bottom: 2px solid gray")
        });
        header.row(1).assertCellParams(new TableCellParams[]{
                new TableCellParams("", 1, 2, "border-right: 2px solid gray; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Field 1", 1, 2, "border-right: 2px solid gray; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams(NBSP_CHAR, 1, 2, "border-right: 2px solid gray; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Fields", 5, 1, "border-right: 1px solid orange; border-bottom: ? none ?"),
                new TableCellParams("Int Field 3 (header only)", 1, 2, "border-right: ? none ?; border-bottom: 1px solid #a0a0a0")
        });
        header.row(2).assertCellParams(new TableCellParams[]{
                new TableCellParams("String Field 3", 1, 1, "border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("Int Field 1", 1, 1, "border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("", 1, 1, "border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams(NBSP_CHAR, 1, 1, "border-right: ? none ?; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams(NBSP_CHAR, 1, 1, "border-right: 1px solid orange; border-bottom: 1px solid #a0a0a0"),
        });
        header.row(3).assertCellStyles("border-bottom: 2px solid gray");
        for (int i = 1; i <= 2; i++)
            header.row(i).assertStyle("color: OrangeRed; font-weight: bold; font-family: Tahoma,Arial; font-size: 19px;");

        TableSectionInspector body = table.body();
        assertEquals("Checking the number of body rows", 10, body.rowCount());
        body.assertColumnCellStyles(new String[]{
                "border-right: 2px solid silver",
                "border-right: 2px solid silver",
                "border-right: 2px solid silver",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: ? none ?",
                "border-right: 1px solid silver",
                "border-right: ? none ?",
        });

        TableSectionInspector footer = table.footer();
        assertEquals("Checking the number of footer rows", 4, footer.rowCount());
        footer.row(0).assertCellStyles("border-top: 2px solid gray");
        footer.row(0).assertCellParams(new TableCellParams[]{
                new TableCellParams(NBSP_CHAR, 1, 3, "border-right: 2px solid gray"),
                new TableCellParams("String Field 1 (footer)", 1, 3, "border-right: 2px solid gray"),
View Full Code Here

        //check default string for the no data corresponding to filter criterion
        dataTable("formID:emptyDataID").bodyRow(0).cell(0).assertText("No records");

        //check is message string for the no data visible
        assertEquals("There should be one invisible fake row", 1, new TableInspector("formID:emptyDataMessageForbiddenID").body().rowCount());
        dataTable("formID:emptyDataMessageForbiddenID").body().row(0).assertCellParams(new TableCellParams[]{
                new TableCellParams(null, 2, 1, "display: none")
        });

        //check custom message for the no data
View Full Code Here

        // headerondblclick
        dataTable("fn:dblclick").column(0).headerCell(0).doubleClick();
        assertTrue(selenium.isTextPresent("headerOndblclick works"));
        assertTrue(selenium.isTextPresent("dblclick"));

        TableInspector mousedownDt = dataTable("fn:mousedownDT");
        // headeronmousedown
        mousedownDt.column(0).headerCell(0).mouseDown();
        assertTrue(selenium.isTextPresent("headerOnmousedown works"));
        assertTrue(selenium.isTextPresent("mousedown"));

        // headeronmouseup
        mousedownDt.column(0).headerCell(0).mouseUp();
        assertTrue(selenium.isTextPresent("headerOnmouseup works"));
        assertTrue(selenium.isTextPresent("mouseup"));

        // headeronmouseover
        dataTable("fn:mouseoverDT").column(0).headerCell(0).mouseOver();
View Full Code Here

        // footerondblclick
        dataTable("fn:dblclickDT").column(0).footerCell(0).doubleClick();
        assertTrue(selenium.isTextPresent("footerOndblclick works"));
        assertTrue(selenium.isTextPresent("dblclick"));

        TableInspector mousedownDt = dataTable("fn:mousedownDT");
        // footeronmousedown
        mousedownDt.column(0).footerCell(0).mouseDown();
        assertTrue(selenium.isTextPresent("footerOnmousedown works"));
        assertTrue(selenium.isTextPresent("mousedown"));

        // footeronmouseup
        mousedownDt.column(0).footerCell(0).mouseUp();
        assertTrue(selenium.isTextPresent("footerOnmouseup works"));
        assertTrue(selenium.isTextPresent("mouseup"));

        // footeronmouseover
        dataTable("fn:mouseoverDT").column(0).footerCell(0).mouseOver();
View Full Code Here

TOP

Related Classes of org.seleniuminspector.html.TableInspector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.