12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.vaadin.tests.components.flash;
-
- import static org.junit.Assert.assertEquals;
- import static org.junit.Assert.assertNotEquals;
-
- import java.util.List;
-
- import org.junit.Test;
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.remote.DesiredCapabilities;
-
- import com.vaadin.testbench.elements.ButtonElement;
- import com.vaadin.testbench.elements.FlashElement;
- import com.vaadin.testbench.parallel.Browser;
- import com.vaadin.tests.tb3.MultiBrowserTest;
-
- public class FlashExpansionTest extends MultiBrowserTest {
-
- @Override
- public List<DesiredCapabilities> getBrowsersToTest() {
- return getBrowsersSupportingFlash();
- }
-
- private final By locator = By.tagName("embed");
-
- @Test
- public void testFlashIsExpanded() throws Exception {
- openTestURL();
- /* Allow the flash plugin to load */
- waitForElementPresent(locator);
- WebElement embed = $(FlashElement.class).first().findElement(locator);
- String width = embed.getAttribute("width");
- assertEquals("Width is not 400.0px initially", "400", width);
- $(ButtonElement.class).first().click();
- embed = $(FlashElement.class).first().findElement(locator);
- String widthAfterExpansion = embed.getAttribute("width");
- assertNotEquals("Width is still 400.0px after expansion", "400",
- widthAfterExpansion);
- }
-
- private List<DesiredCapabilities> getBrowsersSupportingFlash() {
- // No Flash support in Chrome, FF, PhantomJS
- return getBrowserCapabilities(Browser.IE11);
- }
- }
|