aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxFastTabbingOut.java
blob: 1789f3ba85fdee1967ff593d61137fa6b9b88f69 (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.components.combobox;

import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.ComboBox;

import java.util.ArrayList;

@Widgetset("com.vaadin.DefaultWidgetSet")
public class ComboboxFastTabbingOut extends AbstractTestUI {
    @Override
    protected void setup(VaadinRequest request) {
        ComboBox<String> combobox = new ComboBox<>(
                "Press any letter and tab out fast. The pop-up should stay closed");
        ArrayList<String> values = new ArrayList<>();
        values.add("AMERICAN SAMOA");
        values.add("ANTIGUA AND BARBUDA");
        values.add("Bali");
        combobox.setId("firstCombobox");
        combobox.setItems(values);

        ComboBox<String> combobox2 = new ComboBox<>(
                "Focusing after tabbing from another CB should not open the pop-up");

        combobox2.setItems("AMERICAN SAMOA", "ANTIGUA AND BARBUDA", "Lake 1",
                "Lake 2");
        combobox2.setId("secondCombobox");
        addComponent(combobox);
        addComponent(combobox2);
    }

    @Override
    protected String getTestDescription() {
        return "On tabbing out fast, the popup window stays closed";
    }

    @Override
    protected Integer getTicketNumber() {
        return 11354;
    }

}