use of com.consol.citrus.selenium.model.PageValidator in project yaks by citrusframework.
the class SeleniumSteps method pageByType.
@Given("^(?:Browser|browser) page \"([^\"]+)\" of type ([^\\s]+)$")
public void pageByType(String id, String type) {
try {
Object page = Class.forName(type).newInstance();
pages.put(id, (WebPage) page);
if (page instanceof PageValidator) {
validators.put(id, (PageValidator<?>) page);
}
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
throw new CitrusRuntimeException("Failed to load page object", e);
}
}
use of com.consol.citrus.selenium.model.PageValidator in project yaks by citrusframework.
the class SeleniumSteps method page.
@Given("^(?:Browser|browser) page \"([^\"]+)\"$")
public void page(String id) {
if (!citrus.getCitrusContext().getReferenceResolver().isResolvable(id, WebPage.class)) {
throw new CitrusRuntimeException("Unable to find page for id: " + id);
}
WebPage page = citrus.getCitrusContext().getReferenceResolver().resolve(id, WebPage.class);
pages.put(id, page);
if (page instanceof PageValidator) {
validators.put(id, (PageValidator<?>) page);
}
}
Aggregations