Search in sources :

Example 1 with SeleniumWMessagesWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement 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 SeleniumWMessagesWebElement

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

the class WMessagesExample_Test method testHiddenWMessages.

@Test
public void testHiddenWMessages() {
    SeleniumWComponentsWebDriver driver = getDriver();
    SeleniumWMessagesWebElement messages = driver.findWMessages(byWComponentPath("WMessages[1]"));
    Assert.assertTrue(messages.isHidden());
    Assert.assertFalse(messages.isDisplayed());
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) SeleniumWMessagesWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement) Test(org.junit.Test)

Example 3 with SeleniumWMessagesWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement 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)3 SeleniumWMessagesWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessagesWebElement)3 Test (org.junit.Test)3 SeleniumWMessageBoxWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMessageBoxWebElement)2