use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetByLabelComplexPartial.
@Test
public void testGetByLabelComplexPartial() {
String labelText = "one or more";
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WCheckBoxSelect[1]"));
SeleniumWComponentWebElement actual = driver.findElement(new ByLabel(labelText, true));
Assert.assertEquals(expected.getAttribute("id"), actual.getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement in project wcomponents by BorderTech.
the class WLabelExample_Test method testGetComponentComplex.
@Test
public void testGetComponentComplex() {
SeleniumWComponentsWebDriver driver = getDriver();
SeleniumWLabelWebElement label = driver.findWLabel(byWComponentPath("WLabel[7]"));
SeleniumWComponentWebElement expected = driver.findElement(byWComponentPath("WCheckBoxSelect[1]"));
Assert.assertEquals(expected.getAttribute("id"), label.getLabelledComponent().getAttribute("id"));
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWComponentWebElement 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.element.SeleniumWComponentWebElement 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.element.SeleniumWComponentWebElement 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"));
}
Aggregations