Search in sources :

Example 6 with Element

use of com.coveros.selenified.element.Element in project selenified by Coveros.

the class ElementTest method checkPrettyOutputEndTest.

@Test
public void checkPrettyOutputEndTest() {
    Element element = new Element(null, null, Locator.ID, "myId");
    Assert.assertEquals(element.prettyOutputEnd(), "element with <i>ID</i> of <i>myId</i>.");
}
Also used : Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Example 7 with Element

use of com.coveros.selenified.element.Element in project selenified by Coveros.

the class ElementTest method checkFullElementWebDriverTest.

@Test
public void checkFullElementWebDriverTest() {
    Element element = new Element(null, null, Locator.ID, "myId", 2);
    Assert.assertNull(element.getDriver());
}
Also used : Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Example 8 with Element

use of com.coveros.selenified.element.Element in project selenified by Coveros.

the class ElementIT method checkChildTest.

@Test(groups = { "integration", "element" }, description = "An integration test to check that a child element is properly located")
public void checkChildTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Element table = app.newElement(Locator.ID, "table");
    Element cell = table.findChild(app.newElement(Locator.TAGNAME, "th"));
    cell.assertEquals().text("");
    // verify no issues
    finish();
}
Also used : App(com.coveros.selenified.application.App) Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Example 9 with Element

use of com.coveros.selenified.element.Element in project selenified by Coveros.

the class ConflictAIT method conflictingTestName.

@Test(groups = { "integration", "conflict" }, description = "A sample test to show how to loop through elements with multiple matches")
public void conflictingTestName() {
    System.setProperty("packageResults", "true");
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Element element = app.newElement(Locator.XPATH, "//form/input[@type='checkbox']");
    for (int match = 0; match < element.get().matchCount(); match++) {
        element.setMatch(match);
        element.click();
        element.assertState().checked();
    }
    // close out the test
    finish();
    System.setProperty("packageResults", "false");
}
Also used : App(com.coveros.selenified.application.App) Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Example 10 with Element

use of com.coveros.selenified.element.Element in project selenified by Coveros.

the class SimpleSampleIT method sampleTestLoopThroughElements.

@Test(groups = { "sample" }, description = "A sample test to show how to loop through elements with multiple matches")
public void sampleTestLoopThroughElements() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Element element = app.newElement(Locator.XPATH, "//form/input[@type='checkbox']");
    for (int match = 0; match < element.get().matchCount(); match++) {
        element.setMatch(match);
        element.click();
        element.assertState().checked();
    }
    // close out the test
    finish();
}
Also used : App(com.coveros.selenified.application.App) Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Aggregations

Element (com.coveros.selenified.element.Element)18 Test (org.testng.annotations.Test)18 App (com.coveros.selenified.application.App)6