Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

FlashExpansionTest.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.vaadin.tests.components.flash;
  2. import static org.junit.Assert.assertEquals;
  3. import static org.junit.Assert.assertNotEquals;
  4. import java.util.List;
  5. import org.junit.Test;
  6. import org.openqa.selenium.By;
  7. import org.openqa.selenium.WebElement;
  8. import org.openqa.selenium.remote.DesiredCapabilities;
  9. import com.vaadin.testbench.elements.ButtonElement;
  10. import com.vaadin.testbench.elements.FlashElement;
  11. import com.vaadin.testbench.parallel.Browser;
  12. import com.vaadin.tests.tb3.MultiBrowserTest;
  13. public class FlashExpansionTest extends MultiBrowserTest {
  14. @Override
  15. public List<DesiredCapabilities> getBrowsersToTest() {
  16. return getBrowsersSupportingFlash();
  17. }
  18. private final By locator = By.tagName("embed");
  19. @Test
  20. public void testFlashIsExpanded() throws Exception {
  21. openTestURL();
  22. /* Allow the flash plugin to load */
  23. waitForElementPresent(locator);
  24. WebElement embed = $(FlashElement.class).first().findElement(locator);
  25. String width = embed.getAttribute("width");
  26. assertEquals("Width is not 400.0px initially", "400", width);
  27. $(ButtonElement.class).first().click();
  28. embed = $(FlashElement.class).first().findElement(locator);
  29. String widthAfterExpansion = embed.getAttribute("width");
  30. assertNotEquals("Width is still 400.0px after expansion", "400",
  31. widthAfterExpansion);
  32. }
  33. private List<DesiredCapabilities> getBrowsersSupportingFlash() {
  34. // No Flash support in Chrome, FF, PhantomJS
  35. return getBrowserCapabilities(Browser.IE11);
  36. }
  37. }