1 package com.vaadin.tests.containers.sqlcontainer;
3 import java.util.ArrayList;
6 import org.junit.Assert;
8 import org.openqa.selenium.Keys;
9 import org.openqa.selenium.WebElement;
11 import com.vaadin.testbench.By;
12 import com.vaadin.tests.tb3.MultiBrowserTest;
13 import com.vaadin.v7.testbench.customelements.ComboBoxElement;
15 public class TableQueryWithNonUniqueFirstPrimaryKeyTest
16 extends MultiBrowserTest {
18 private static final String[] DATA = { "TARUSCIO GIOVANNI",
19 "RUSSO GAETANO AUTORICAMBI", "AMORUSO LUIGI SRL", "CARUSO ROCCO",
20 "F.LLI RUSSO DI GAETANO RUSSO & C", "RUSSO GIUSEPPE",
21 "TRUSCELLI ANTONIO", "CARUSO CALOGERO" };
24 public void testComboBoxSuggestionsListedCorrectly() throws Exception {
26 $(ComboBoxElement.class).first().findElement(By.vaadin("#textbox"))
27 .sendKeys("rus", Keys.ENTER);
29 List<String> result = new ArrayList<>();
31 // pick list items that are shown in suggestion popup
32 List<WebElement> elems = findElements(
33 By.cssSelector("td[role=\"listitem\"]"));
34 Assert.assertEquals("not enough suggestions shown", DATA.length,
37 for (WebElement elem : elems) {
38 result.add(elem.getText());
41 Assert.assertArrayEquals("popup items not what they should be", DATA,