aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridScrollTest.java
blob: af4f2707d19188f71d46d7837c90f21c4640485f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.vaadin.tests.components.grid.basics;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.vaadin.testbench.elements.GridElement;

public class GridScrollTest extends GridBasicsTest {

    @Test
    public void workPendingWhileScrolling() {
        openTestURL("theme=valo");
        String script = "var c = window.vaadin.clients.runcomvaadintestscomponentsgridbasicsGridBasics;\n"
                // Scroll down and cause lazy loading
                + "c.getElementByPath(\"//Grid[0]#cell[21]\"); \n"
                + "return c.isActive();";

        Boolean active = (Boolean) executeScript(script);
        assertTrue("Grid should be marked to have workPending while scrolling",
                active);
    }

    @Test
    public void scrollIntoViewThroughSubPart() {
        openTestURL("theme=valo");
        GridElement grid = $(GridElement.class).first();
        assertEquals("(10, 0)", grid.getCell(10, 0).getText());
    }
}