java.lang.IllegalArgumentException: None of [] allows for delegation from cle.application.page.applicationui.BasePage.isDisplayed()

36 Views Asked by At
Caused by: java.lang.IllegalArgumentException: None of \[public static java.lang.Object net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(java.lang.Object,java.lang.reflect.Method,java.lang.Object\[\],java.la
ng.Object,net.thucydides.core.steps.Interceptor,java.lang.reflect.Method) throws java.lang.Throwable\] allows for delegation from public abstract boolean cle.application.page.applicationui.BasePage.isDisplayed()

issue while running the UI test cases

@Slf4j
@NoArgsConstructor
public abstract class BasePage extends UIInteractionSteps {

public Map\<String, By\> locatorsMap;
public Map\<String, String\> wildcardLocatorsMap;

public abstract boolean isDisplayed();

@Step
public boolean isDisplayed(final List\<By\> selectors) {
try {
waitUntilPageIsLoaded(this.getDriver());
selectors.forEach(selector -\> $(selector).waitUntilVisible());
} catch (TimeoutException | NoSuchElementException ex) {
log.info("could not locate page \[{}\] element(s) - the page is not loaded due to \[{}\]", this.getClass().getSimpleName(), ex);
return false;
}
return true;
}

@SuppressWarnings("PMD")
public void waitUntilPageIsLoaded(final WebDriver driver) {
final long timeout = this.getImplicitWaitTimeout().toMillis();
// PMD: LiteralsFirstInComparison
new WebDriverWait(driver, Duration.ofMillis(timeout)).until(
webDriver -\> ((JavascriptExecutor) webDriver).executeScript("return document.readyState").equals("complete"));
}
}

@Slf4j
@DefaultUrl("page:application.summary.page")
public class applicationOrderSummaryPage extends BasePage {
private final By summaryPageTitle = By.className("CLAASS12");

public applicationOrderSummaryPage () {
final Map\<String, By\> summaryPageLocatorsMap = ImmutableMap.\<String, By\>builder()
.put("Homepage", By.cssSelector("a\[href\*='abc'\]"))
.build();

    locatorsMap = ImmutableMap.<String, By>builder()
        .putAll(summaryPageLocatorsMap)
        .build();

}

@Override
public boolean isDisplayed() {
return isDisplayed(List.of(summaryPageTitle));
}
}

@Slf4j
public class UiSteps extends UIInteractionSteps {
@Step
public void openPage(AppPage appPage) {
log.info("opening page: \[{}\]", appPage);
BasePage webpage = getWebPageAssertNotNull(appPage);
try {
webpage.open();
webpage.waitUntilPageIsLoaded(webpage.getDriver());
} catch (SerenityManagedException ex) {
log.error("an error occurred opening ui page", ex);
fail("Couldn't open page due to: " + ExceptionUtils.getRootCauseMessage(ex));
}
}
}
enter code here

enter code here
0

There are 0 best solutions below