public class GalenPageActionInjectJavascriptTest {
private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page1.html").getPath();
@Test public void shouldInject_javascript() throws IOException {
WebDriver driver = new FirefoxDriver();
Browser browser = new SeleniumBrowser(driver);
browser.load(TEST_URL);
GalenPageActionInjectJavascript action = new GalenPageActionInjectJavascript("/scripts/to-inject-1.js");
action.execute(new TestReport(), browser, new GalenPageTest(), null);
WebElement element = driver.findElement(By.xpath("//body/injected-tag"));
assertThat("Inject tags text should be", element.getText(), is("Some injected content"));
browser.quit();
}