// Path: web-selenium/src/main/java/org/jbehave/web/selenium/FlashDriver.java
// @SuppressWarnings("serial")
// public static class JavascriptNotSupported extends RuntimeException {
// 
//     public JavascriptNotSupported(WebDriver delegate) {
//         super("Javascript not supported by WebDriver "+delegate);
//     }
//         
// }
// 
// Path: web-selenium/src/main/java/org/jbehave/web/selenium/FlashPage.java
// @SuppressWarnings("serial")
// public static class FlashNotSupported extends RuntimeException {
// 
//     public FlashNotSupported(WebDriver driver) {
//         super("Flash not supported by WebDriver "+driver);
//     }
//         
// }


import org.jbehave.web.selenium.FlashDriver.JavascriptNotSupported;
import org.jbehave.web.selenium.FlashPage.FlashNotSupported;
import org.junit.Test;
import org.mockito.Mockito;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package org.jbehave.web.selenium;





public class FlashDriverTest {

    @Test
    public void shouldExecuteJavascriptMethodsOnFlashObject() {
        FirefoxDriver delegate = Mockito.mock(FirefoxDriver.class);
        FlashDriver driver = new FlashDriver(delegate, "flashObjectId");

        driver.click();
        verify(delegate).executeScript("return arguments[0].click();", (Object[]) null);

        when(delegate.executeScript("return arguments[0].PercentLoaded();", (Object[]) null)).thenReturn("100");
        assertThat(driver.percentLoaded(), equalTo(100));
        verify(delegate).executeScript("return arguments[0].PercentLoaded();", (Object[]) null);
    }

// Path: web-selenium/src/main/java/org/jbehave/web/selenium/FlashDriver.java
// @SuppressWarnings("serial")
// public static class JavascriptNotSupported extends RuntimeException {
// 
//     public JavascriptNotSupported(WebDriver delegate) {
//         super("Javascript not supported by WebDriver "+delegate);
//     }
//         
// }
// 
// Path: web-selenium/src/main/java/org/jbehave/web/selenium/FlashPage.java
// @SuppressWarnings("serial")
// public static class FlashNotSupported extends RuntimeException {
// 
//     public FlashNotSupported(WebDriver driver) {
//         super("Flash not supported by WebDriver "+driver);
//     }
//         
// }


// Path: web-selenium/src/test/java/org/jbehave/web/selenium/FlashDriverTest.java
import org.jbehave.web.selenium.FlashDriver.JavascriptNotSupported;
import org.jbehave.web.selenium.FlashPage.FlashNotSupported;
import org.junit.Test;
import org.mockito.Mockito;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package org.jbehave.web.selenium;





public class FlashDriverTest {

    @Test
    public void shouldExecuteJavascriptMethodsOnFlashObject() {
        FirefoxDriver delegate = Mockito.mock(FirefoxDriver.class);
        FlashDriver driver = new FlashDriver(delegate, "flashObjectId");

        driver.click();
        verify(delegate).executeScript("return arguments[0].click();", (Object[]) null);

        when(delegate.executeScript("return arguments[0].PercentLoaded();", (Object[]) null)).thenReturn("100");
        assertThat(driver.percentLoaded(), equalTo(100));
        verify(delegate).executeScript("return arguments[0].PercentLoaded();", (Object[]) null);
    }

    @Test(expected = JavascriptNotSupported.class)