Search in sources :

Example 1 with BsDataEntryDriver

use of org.activityinfo.test.driver.BsDataEntryDriver in project activityinfo by bedatadriven.

the class DataEntryTab method newSubmission.

public DataEntryDriver newSubmission() {
    buttonClick(I18N.CONSTANTS.newSite());
    final FluentElement windowElement = container.root();
    return container.waitFor(new Function<WebDriver, DataEntryDriver>() {

        @Override
        public DataEntryDriver apply(WebDriver input) {
            if (windowElement.find().div(withClass(GxtModal.CLASS_NAME)).exists()) {
                return new GxtDataEntryDriver(new GxtModal(windowElement));
            } else if (windowElement.find().div(withClass("formPanel")).firstIfPresent().isPresent()) {
                return new BsDataEntryDriver(windowElement);
            } else {
                return null;
            }
        }
    });
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) WebDriver(org.openqa.selenium.WebDriver) GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) DataEntryDriver(org.activityinfo.test.driver.DataEntryDriver) BsDataEntryDriver(org.activityinfo.test.driver.BsDataEntryDriver) BsDataEntryDriver(org.activityinfo.test.driver.BsDataEntryDriver)

Aggregations

BsDataEntryDriver (org.activityinfo.test.driver.BsDataEntryDriver)1 DataEntryDriver (org.activityinfo.test.driver.DataEntryDriver)1 FluentElement (org.activityinfo.test.pageobject.api.FluentElement)1 GxtModal (org.activityinfo.test.pageobject.gxt.GxtModal)1 WebDriver (org.openqa.selenium.WebDriver)1