aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/fonticon/FontIconsTest.java
blob: e59b5d59a10784993a5debe0d945d3877f2a69d6 (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
32
33
34
35
36
37
38
39
40
41
42
43
package com.vaadin.tests.fonticon;

import static org.junit.Assert.assertEquals;

import java.io.IOException;

import org.junit.Test;
import org.openqa.selenium.Keys;

import com.vaadin.testbench.elements.ComboBoxElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class FontIconsTest extends MultiBrowserTest {

    @Test
    public void checkScreenshot() throws IOException {
        openTestURL();
        waitUntilLoadingIndicatorNotVisible();
        compareScreen("allVaadinIcons");
    }

    @Test
    public void comboBoxItemIconsOnKeyboardNavigation() throws Exception {
        openTestURL();

        ComboBoxElement comboBox = $(ComboBoxElement.class).first();

        // No initial value.
        assertEquals("", comboBox.getText());

        // Navigate to the first item with keyboard navigation.
        comboBox.sendKeys(400, Keys.ARROW_DOWN, Keys.ARROW_DOWN);

        // Value must be "One" without any extra characters.
        // See ticket #14660
        assertEquals("One", comboBox.getText());

        // Check also the second item.
        comboBox.sendKeys(Keys.ARROW_DOWN);
        assertEquals("Two", comboBox.getText());
    }

}