net.serenitybdd.screenplay.playwright.questions.SelectOptions Maven / Gradle / Ivy
package net.serenitybdd.screenplay.playwright.questions;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.playwright.Target;
import net.serenitybdd.screenplay.playwright.abilities.BrowseTheWebWithPlaywright;
import java.util.List;
/**
* Get a list of select options from a dropdown
*/
public class SelectOptions {
public static Question> of(Target target) {
return of(target.asSelector());
}
public static Question> of(String locator) {
return Question.about("options of " + locator).answeredBy(actor ->
BrowseTheWebWithPlaywright.as(actor).getCurrentPage().locator(locator + " > option").allInnerTexts()
);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy