Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ComboBoxSuggestionPopupWidthLegacyTest.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  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
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.combobox;
  17. import org.junit.Test;
  18. import org.openqa.selenium.WebElement;
  19. import com.vaadin.testbench.By;
  20. import com.vaadin.testbench.elements.ComboBoxElement;
  21. import com.vaadin.tests.tb3.MultiBrowserTest;
  22. /**
  23. * @author Vaadin Ltd
  24. */
  25. public class ComboBoxSuggestionPopupWidthLegacyTest extends MultiBrowserTest {
  26. @Test
  27. public void suggestionPopupLegacyWidthTest() throws Exception {
  28. openTestURL();
  29. waitForElementVisible(By.className("legacy"));
  30. WebElement selectTextbox = $(ComboBoxElement.class).first()
  31. .findElement(By.vaadin("#textbox"));
  32. selectTextbox.click();
  33. CustomComboBoxElement cb = $(CustomComboBoxElement.class).first();
  34. cb.openPopup();
  35. WebElement popup = cb.getSuggestionPopup();
  36. int width = popup.getSize().getWidth();
  37. assertGreater("Legacy mode popup should be quite wide", width, 600);
  38. assertLessThan(
  39. "Even legacy mode popup should not be over 1000px wide with the set item captions ",
  40. width, 1000);
  41. }
  42. };