Search in sources :

Example 41 with SeleniumWComponentsWebDriver

use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.

the class WLabelExample_Test method testGetByLabelSimplePartial.

@Test
public void testGetByLabelSimplePartial() {
    String labelText = "Normal input";
    SeleniumWComponentsWebDriver driver = getDriver();
    SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[0]"));
    SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, true));
    Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) SeleniumWComponentWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement) ByLabel(com.github.bordertech.wcomponents.test.selenium.ByLabel) Test(org.junit.Test)

Example 42 with SeleniumWComponentsWebDriver

use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.

the class WLabelExample_Test method testGetComponentReadOnly.

@Test
public void testGetComponentReadOnly() {
    SeleniumWComponentsWebDriver driver = getDriver();
    SeleniumWLabelWebElement label = driver.findWLabel(byWComponentPath("WLabel[2]"));
    Assert.assertTrue(label.isReadOnly());
    SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[2]"));
    Assert.assertEquals(expected.getAttribute("id"), label.getLabelledComponent().getAttribute("id"));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) SeleniumWLabelWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWLabelWebElement) SeleniumWComponentWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement) Test(org.junit.Test)

Example 43 with SeleniumWComponentsWebDriver

use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver 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 44 with SeleniumWComponentsWebDriver

use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver 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)

Example 45 with SeleniumWComponentsWebDriver

use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.

the class WRadioButtonSelectExample_Test method testGetOptions.

@Test
public void testGetOptions() {
    SeleniumWComponentsWebDriver driver = getDriver();
    Assert.assertEquals(9, getExampleNoSelection().getOptions().size());
    Assert.assertEquals(9, getDisabledExample().getOptions().size());
    Assert.assertTrue(CollectionUtils.isEmpty(getReadOnlyExampleNoSelection().getOptions()));
    // interactive but no options
    Assert.assertTrue(CollectionUtils.isEmpty(driver.findWRadioButtonSelect(new ByLabel("Select from no options", false)).getOptions()));
}
Also used : SeleniumWComponentsWebDriver(com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver) ByLabel(com.github.bordertech.wcomponents.test.selenium.ByLabel) 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