Search in sources :

Example 16 with Element

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

the class ActionWaitIT method setDefaultWaitElementTest.

@Test(groups = { "integration", "actions", "wait" }, description = "An integration test to check changing the default wait method")
public void setDefaultWaitElementTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Element element = app.newElement(Locator.ID, "five_second_button");
    element.waitFor().changeDefaultWait(3.0);
    element.click();
    // verify 1 issue
    finish(1);
}
Also used : App(com.coveros.selenified.application.App) Element(com.coveros.selenified.element.Element) Test(org.testng.annotations.Test)

Example 17 with Element

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

the class ConflictBIT method conflictingTestName.

@Test(groups = { "integration", "conflict" }, description = "A sample test to show how to loop through elements with multiple matches")
public void conflictingTestName() {
    // 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)

Example 18 with Element

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

the class ElementIT method checkMultipleChildTest.

@Test(groups = { "integration", "element" }, description = "An integration test to check that a child element is properly located")
public void checkMultipleChildTest() {
    // use this object to manipulate the app
    App app = this.apps.get();
    // perform some actions
    Element table = app.newElement(Locator.ID, "table");
    Element body = table.findChild(app.newElement(Locator.TAGNAME, "tbody"));
    Element row = body.findChild(app.newElement(Locator.TAGNAME, "tr"));
    Element cell1 = row.findChild(app.newElement(Locator.TAGNAME, "th"));
    cell1.assertEquals().text("President");
    Element cell2 = row.findChild(app.newElement(Locator.TAGNAME, "td"));
    cell2.assertEquals().text("Alfreds Futterkiste");
    // verify no issues
    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