Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ComboboxPageLengthZeroScrollTest.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 java.util.List;
  18. import org.junit.Assert;
  19. import org.junit.Test;
  20. import org.openqa.selenium.By;
  21. import org.openqa.selenium.Keys;
  22. import org.openqa.selenium.WebElement;
  23. import org.openqa.selenium.interactions.Actions;
  24. import org.openqa.selenium.remote.DesiredCapabilities;
  25. import com.vaadin.testbench.parallel.Browser;
  26. import com.vaadin.tests.tb3.MultiBrowserTest;
  27. /**
  28. * Test class for testing issue #13488 - changing pages with pagelength=0 breaks
  29. * the style.
  30. *
  31. * @author Vaadin Ltd
  32. */
  33. public class ComboboxPageLengthZeroScrollTest extends MultiBrowserTest {
  34. @Test
  35. public void testComboboxPageLength() {
  36. openTestURL();
  37. WebElement comboBox = vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VFilterSelect[0]#textbox");
  38. // navigate to the next page. keyboard navigation is the preferred
  39. // method here since it's much easier to implement.
  40. Actions keyNavigation = new Actions(driver).moveToElement(comboBox)
  41. .click();
  42. for (int i = 0; i < 25; ++i) {
  43. keyNavigation.sendKeys(Keys.ARROW_DOWN);
  44. }
  45. keyNavigation.perform();
  46. // The broken behavior always caused a v-shadow element to have
  47. // height: 10px. Verify that this does no longer happen.
  48. String cssValue = driver.findElement(By.className("v-shadow"))
  49. .getCssValue("height");
  50. Assert.assertNotEquals("v-shadow height should not be 10px", "10px",
  51. cssValue);
  52. }
  53. @Override
  54. public List<DesiredCapabilities> getBrowsersToTest() {
  55. return getBrowserCapabilities(Browser.IE8);
  56. }
  57. }