2 * Copyright 2000-2013 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.tests.components.combobox;
18 import static org.junit.Assert.assertTrue;
20 import org.junit.Test;
22 import com.vaadin.testbench.By;
23 import com.vaadin.testbench.TestBenchElement;
24 import com.vaadin.testbench.elements.ButtonElement;
25 import com.vaadin.tests.tb3.MultiBrowserTest;
26 import com.vaadin.v7.testbench.customelements.ComboBoxElement;
28 public class ComboBoxItemAddingWithFocusListenerTest extends MultiBrowserTest {
31 public void testPopupViewContainsAddedItem() {
33 ComboBoxElement cBox = $(ComboBoxElement.class).first();
34 ButtonElement focusTarget = $(ButtonElement.class).first();
38 assertTrue("No item added on focus",
39 cBox.getPopupSuggestions().contains("Focus" + i++));
41 ((TestBenchElement) cBox.findElement(By.vaadin("#textbox")))
44 assertTrue("No item added on focus",
45 cBox.getPopupSuggestions().contains("Focus" + i));