aboutsummaryrefslogtreecommitdiffstats
path: root/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java
blob: 03d4f1ce185afad9e3c23b983ab2c417fe43a7d6 (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
package com.vaadin.tests.integration;

import org.junit.Assert;
import org.junit.Test;

import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.LabelElement;

public abstract class AbstractServletIntegrationTest
        extends AbstractIntegrationTest {

    @Test
    public void runTest() throws Exception {
        // Test initial state
        GridElement grid = $(GridElement.class).first();
        Assert.assertFalse("Row should not be initially selected",
                grid.getRow(0).isSelected());
        compareScreen("initial");

        // Test selection and side effects
        grid.getCell(0, 1).click();
        Assert.assertTrue("Row should be selected on click",
                grid.getRow(0).isSelected());
        Assert.assertEquals("Text label should contain 'FI'", "FI",
                $(LabelElement.class).first().getText());
        compareScreen("finland");

    }

}