You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OrderedLayoutInfiniteLayoutPassesTest.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.vaadin.tests.components.orderedlayout;
  2. import org.junit.Test;
  3. import org.openqa.selenium.By;
  4. import org.openqa.selenium.Keys;
  5. import org.openqa.selenium.WebElement;
  6. import com.vaadin.testbench.elements.ButtonElement;
  7. import com.vaadin.tests.tb3.MultiBrowserTest;
  8. public class OrderedLayoutInfiniteLayoutPassesTest extends MultiBrowserTest {
  9. @Override
  10. protected boolean requireWindowFocusForIE() {
  11. return true;
  12. }
  13. @Test
  14. public void ensureFiniteLayoutPhase() throws Exception {
  15. openTestURL("debug");
  16. zoomBrowserIn();
  17. try {
  18. $(ButtonElement.class).first().click();
  19. assertNoErrorNotifications();
  20. resetZoom();
  21. assertNoErrorNotifications();
  22. } finally {
  23. // Reopen test to ensure that modal window does not prevent zoom
  24. // reset from taking place
  25. openTestURL();
  26. resetZoom();
  27. }
  28. }
  29. private void zoomBrowserIn() {
  30. WebElement html = driver.findElement(By.tagName("html"));
  31. html.sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT));
  32. }
  33. private void resetZoom() {
  34. WebElement html = driver.findElement(By.tagName("html"));
  35. html.sendKeys(Keys.chord(Keys.CONTROL, "0"));
  36. }
  37. }