use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetByLabelSimple.
// Use ByLabel to get a component by label text
@Test
public void testGetByLabelSimple() {
SeleniumWComponentsWebDriver driver = getDriver();
String labelText = "Normal input component";
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[0]"));
SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, false));
Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetByLabelComplex.
@Test
public void testGetByLabelComplex() {
String labelText = "Select one or more options";
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WCheckBoxSelect[1]"));
SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, false));
Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetComponentSimple.
@Test
public void testGetComponentSimple() {
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWLabelWebElement label = driver.findWLabel(byWComponentPath("WLabel[0]"));
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[0]"));
Assert.assertEquals(expected.getAttribute("id"), label.getLabelledComponent().getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetByLabelReadOnly.
@Test
public void testGetByLabelReadOnly() {
String labelText = "A hidden label for a read only field";
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[2]"));
SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, false));
Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.driver.SeleniumWComponentsWebDriver in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetByLabelReadOnlyPartial.
@Test
public void testGetByLabelReadOnlyPartial() {
String labelText = "for a read only";
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WTextField[2]"));
SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, true));
Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
Aggregations