Examples of TableElement


Examples of com.google.gwt.dom.client.TableElement

    return tr.getCells().getLength();
  }

  @Override
  protected TableCellElement getHeaderElement(CellTable<String> table, int column) {
    TableElement tableElem = table.getElement().cast();
    TableSectionElement thead = tableElem.getTHead();
    TableRowElement tr = thead.getRows().getItem(0);
    return tr.getCells().getItem(column);
  }
View Full Code Here

Examples of com.google.gwt.dom.client.TableElement

     */
    private void replaceTableSection(AbstractCellTable<?> table, TableSectionElement section,
        SafeHtml html) {
      String sectionName = StringCase.toLower(section.getTagName());
      TableSectionElement newSection = convertToSectionElement(table, sectionName, html);
      TableElement tableElement = table.getElement().cast();
      tableElement.replaceChild(newSection, section);
      if ("tbody".equals(sectionName)) {
        ((TableSectionChangeHandler) table).onTableBodyChange(newSection);
      } else if ("thead".equals(sectionName)) {
        ((TableSectionChangeHandler) table).onTableHeadChange(newSection);
      } else if ("tfoot".equals(sectionName)) {
View Full Code Here

Examples of com.google.gwt.dom.client.TableElement

    Resources res = GWT.create(Resources.class);
    DataGrid<String> dataGrid = new DataGrid<String>(20, res);
   
    String dataGridWidgetStyle = res.dataGridStyle().dataGridWidget();
   
    TableElement tableElem = dataGrid.getElement().cast();
    assertTrue(tableElem.getClassName().contains(dataGridWidgetStyle));
  }
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

        ButtonElement decreaseSize = $(ButtonElement.class).caption(
                "Decrease size").first();
        decreaseSize.click(); // decreasing container size from 50 to 40
        decreaseSize.click(); // decreasing container size from 40 to 30

        TableElement table = $(TableElement.class).first();
        // TableElement scroll not working properly, so we need to do this.
        // http://dev.vaadin.com/ticket/13826
        testBenchElement(table.findElement(By.className("v-scrollable")))
                .scroll(1000);

        // waitforvaadin not worky currently for table scroll, so we need to use
        // thread sleep :(
        Thread.sleep(1500);
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

    @Test
    public void testSorting() {
        openTestURL();

        TableElement table = $(TableElement.class).first();
        List<WebElement> rows = table.findElement(By.className("v-table-body"))
                .findElements(By.tagName("tr"));
        assertEquals("unexpect amount of rows", 46, rows.size());

        // click the button on the first visible row
        clickButton(table, 0, 3, "1. Button Button999 clicked");
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

        ButtonElement btnAdd = $(ButtonElement.class).get(0);

        for (int i = 0; i < ITERATIONS; i++) {
            btnAdd.click();
            ButtonElement btnDel = $(ButtonElement.class).get(1);
            TableElement tbl = $(TableElement.class).get(0);
            Random rand = new Random();
            int scrollValue = rand.nextInt(1500);
            scrollTable(tbl, scrollValue);
            try {
                Thread.sleep(1000);
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

    @Test
    public void testSorting() {
        openTestURL();

        TableElement table = $(TableElement.class).first();

        // check unsorted
        assertEquals("Text 0", table.getCell(0, 0).getText());
        assertEquals("Label 0", table.getCell(0, 1).getText());
        assertEquals("Text 14", table.getCell(14, 0).getText());
        assertEquals("Label 14", table.getCell(14, 1).getText());

        // sort by first column (ascending order)
        table.getHeaderCell(0).click();

        // check sorted
        assertEquals("Text 0", table.getCell(0, 0).getText());
        assertEquals("Label 0", table.getCell(0, 1).getText());
        assertEquals("Text 10", table.getCell(2, 0).getText());
        assertEquals("Label 10", table.getCell(2, 1).getText());
        assertEquals("Text 19", table.getCell(11, 0).getText());
        assertEquals("Label 19", table.getCell(11, 1).getText());
        assertEquals("Text 4", table.getCell(14, 0).getText());
        assertEquals("Label 4", table.getCell(14, 1).getText());

        // sort by first column (descending order)
        table.getHeaderCell(0).click();

        // check sorted
        assertEquals("Text 9", table.getCell(0, 0).getText());
        assertEquals("Label 9", table.getCell(0, 1).getText());
        assertEquals("Text 19", table.getCell(8, 0).getText());
        assertEquals("Label 19", table.getCell(8, 1).getText());
        assertEquals("Text 13", table.getCell(14, 0).getText());
        assertEquals("Label 13", table.getCell(14, 1).getText());

        // sort by second column (descending order)
        table.getHeaderCell(1).click();

        // check no change
        assertEquals("Text 9", table.getCell(0, 0).getText());
        assertEquals("Label 9", table.getCell(0, 1).getText());
        assertEquals("Text 19", table.getCell(8, 0).getText());
        assertEquals("Label 19", table.getCell(8, 1).getText());
        assertEquals("Text 13", table.getCell(14, 0).getText());
        assertEquals("Label 13", table.getCell(14, 1).getText());

        // sort by second column (ascending order)
        table.getHeaderCell(1).click();

        // check back to first sorting results
        assertEquals("Text 0", table.getCell(0, 0).getText());
        assertEquals("Label 0", table.getCell(0, 1).getText());
        assertEquals("Text 10", table.getCell(2, 0).getText());
        assertEquals("Label 10", table.getCell(2, 1).getText());
        assertEquals("Text 19", table.getCell(11, 0).getText());
        assertEquals("Label 19", table.getCell(11, 1).getText());
        assertEquals("Text 4", table.getCell(14, 0).getText());
        assertEquals("Label 4", table.getCell(14, 1).getText());
    }
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

    @Test
    public void testScrolling() throws IOException, InterruptedException {
        openTestURL();

        ButtonElement button = $(ButtonElement.class).first();
        TableElement table = $(TableElement.class).first();

        // initialise contents
        button.click();
        sleep(500);

        List<WebElement> rows = table.findElement(By.className("v-table-body"))
                .findElements(By.tagName("tr"));

        // check that the final row is the one intended
        WebElement finalRow = rows.get(rows.size() - 1);
        WebElement label = finalRow.findElement(By.className("v-label"));
        assertEquals(TableRowScrolledBottom.part1 + 100
                + TableRowScrolledBottom.part2, label.getText());

        // add more rows
        button.click();
        sleep(500);

        rows = table.findElement(By.className("v-table-body")).findElements(
                By.tagName("tr"));

        // check that the final row is the one intended
        finalRow = rows.get(rows.size() - 1);
        label = finalRow.findElement(By.className("v-label"));
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

    @Test
    public void tableIsNotScrolledOnSelect() throws IOException {
        openTestURL();

        TableElement table = $(TableElement.class).first();

        scrollTable(table, 80, 79);

        table.getCell(79, 0).click();

        compareScreen("scrolled-down");
    }
View Full Code Here

Examples of com.vaadin.testbench.elements.TableElement

        openTestURL();

        selectRows();
        $(ButtonElement.class).first().click();

        TableElement table = getTable();
        assertThat(table.getCell(LASTSELECTEDROW, 1).getText(), is("updated"));
        assertThat(table.getCell(LASTSELECTEDROW-1, 1).getText(), is("updated"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.