Search in sources :

Example 16 with SeleniumWComponentsWebDriver

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));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) Test(org.junit.Test)

Example 17 with SeleniumWComponentsWebDriver

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));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) Test(org.junit.Test)

Example 18 with SeleniumWComponentsWebDriver

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));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) Test(org.junit.Test)

Example 19 with SeleniumWComponentsWebDriver

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));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) Test(org.junit.Test)

Example 20 with SeleniumWComponentsWebDriver

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());
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) Test(org.junit.Test)

Aggregations

SeleniumWComponentsWebDriver (com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver)63 Test (org.junit.Test)62 ByLabel (com.github.bordertech.wcomponents.test.selenium.ByLabel)16 UIContext (com.github.bordertech.wcomponents.UIContext)9 SeleniumWComponentWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement)9 WDropdown (com.github.bordertech.wcomponents.WDropdown)6 SeleniumWCheckBoxSelectWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWCheckBoxSelectWebElement)6 WebElement (org.openqa.selenium.WebElement)5 SeleniumWTableWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWTableWebElement)4 SeleniumWLabelWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWLabelWebElement)3 SeleniumWMessagesWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement)3 WButton (com.github.bordertech.wcomponents.WButton)2 WComponent (com.github.bordertech.wcomponents.WComponent)2 SeleniumWMessageBoxWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement)2 SeleniumWMultiSelectPairWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiSelectPairWebElement)2 Environment (com.github.bordertech.wcomponents.Environment)1 WCheckBoxSelect (com.github.bordertech.wcomponents.WCheckBoxSelect)1 SeleniumWRadioButtonSelectWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWRadioButtonSelectWebElement)1 File (java.io.File)1 Date (java.util.Date)1