use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class ErrorGenerator_Test method testErrorButton2.
// TODO Look at supporting Parameterized tests wiht the BrowserRunner
// /**
// * The path to test with.
// */
// private final String path;
//
//
// /**
// * Creates a new ErrorGenerator_Test.
// *
// * @param path the path to test with.
// */
// public ErrorGenerator_Test(final String path) {
// super(new ErrorGenerator());
// this.path = path;
// }
//
// /**
// * @return the parameters for this test.
// */
// @Parameters
// public static List<String[]> data() {
// return Arrays.asList(new String[][]{
// {"WButton[2]"},
// {"WButton[3]"},
// {"WButton[4]"},
// {"WButton[5]"}
// });
// }
@Test
public void testErrorButton2() {
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
driver.findElement(byWComponentPath("WButton[2]")).click();
// Exception will have been caught by framework, so an error message should be displayed
Assert.assertTrue("Should be displaying an error page", driver.getPageSource().contains(ERROR_STRING));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class ErrorGenerator_Test method testErrorButton3.
@Test
public void testErrorButton3() {
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
driver.findElement(byWComponentPath("WButton[2]")).click();
// Exception will have been caught by framework, so an error message should be displayed
Assert.assertTrue("Should be displaying an error page", driver.getPageSource().contains(ERROR_STRING));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class ErrorGenerator_Test method testErrorButton4.
@Test
public void testErrorButton4() {
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
driver.findElement(byWComponentPath("WButton[2]")).click();
// Exception will have been caught by framework, so an error message should be displayed
Assert.assertTrue("Should be displaying an error page", driver.getPageSource().contains(ERROR_STRING));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class ErrorGenerator_Test method testErrorButton5.
@Test
public void testErrorButton5() {
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
driver.findElement(byWComponentPath("WButton[2]")).click();
// Exception will have been caught by framework, so an error message should be displayed
Assert.assertTrue("Should be displaying an error page", driver.getPageSource().contains(ERROR_STRING));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class HtmlInjector_Test method testExample.
@Test
public void testExample() {
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
String divText = "Hello world&";
String html = "<div id='HtmlInjector_Test.id'>" + WebUtilities.encode(divText) + "</div>";
driver.findWTextArea(byWComponentPath("WTextArea")).sendKeys(html);
driver.findElement(byWComponentPath("WButton")).click();
Assert.assertEquals("Incorrect div text", divText, driver.findElement(By.id("HtmlInjector_Test.id")).getText());
}
Aggregations