Search in sources :

Example 1 with SeleniumWMessageBoxWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement in project wcomponents by BorderTech.

the class WMessagesExample_Test method testMessageBoxTypes.

@Test
public void testMessageBoxTypes() {
    SeleniumWComponentsWebDriver driver = getDriver();
    SeleniumWMessagesWebElement messages = driver.findWMessages(byWComponentPath("WMessages[0]"));
    List<SeleniumWMessageBoxWebElement> messageBoxes = messages.getMessageBoxes();
    Assert.assertEquals(4, messageBoxes.size());
    // first one is expected to be an error box
    Assert.assertTrue(messageBoxes.get(0).getAttribute("class").contains(SeleniumWMessageBoxWebElement.TYPE_ERROR_CLASS_NAME));
    Assert.assertTrue(messageBoxes.get(1).getAttribute("class").contains(SeleniumWMessageBoxWebElement.TYPE_WARNING_CLASS_NAME));
    Assert.assertTrue(messageBoxes.get(2).getAttribute("class").contains(SeleniumWMessageBoxWebElement.TYPE_INFO_CLASS_NAME));
    Assert.assertTrue(messageBoxes.get(3).getAttribute("class").contains(SeleniumWMessageBoxWebElement.TYPE_SUCCESS_CLASS_NAME));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) SeleniumWMessagesWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement) SeleniumWMessageBoxWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement) Test(org.junit.Test)

Example 2 with SeleniumWMessageBoxWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement in project wcomponents by BorderTech.

the class WMessagesExample_Test method testMessageBoxes.

@Test
public void testMessageBoxes() {
    SeleniumWComponentsWebDriver driver = getDriver();
    SeleniumWMessagesWebElement messages = driver.findWMessages(byWComponentPath("WMessages[0]"));
    List<SeleniumWMessageBoxWebElement> messageBoxes = messages.getMessageBoxes();
    Assert.assertEquals(4, messageBoxes.size());
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) SeleniumWMessagesWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement) SeleniumWMessageBoxWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement) Test(org.junit.Test)

Aggregations

SeleniumWComponentsWebDriver (com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver)2 SeleniumWMessageBoxWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement)2 SeleniumWMessagesWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement)2 Test (org.junit.Test)2