All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.screenplay.questions.page.TheWebPage Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.screenplay.questions.page;

import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.abilities.BrowseTheWeb;

public class TheWebPage {
    public static Question title() {
        return Question.about("the title of the page").answeredBy(actor -> BrowseTheWeb.as(actor).getTitle());
    }

    public static Question currentUrl() {
        return Question.about("the current URL").answeredBy(actor -> BrowseTheWeb.as(actor).getDriver().getCurrentUrl());
    }

    public static Question alertText() {
        return Question.about("alert text").answeredBy(actor -> BrowseTheWeb.as(actor).getAlert().getText());
    }

    public static Question source() {
        return Question.about("page source").answeredBy(actor -> BrowseTheWeb.as(actor).getDriver().getPageSource());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy