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

net.serenitybdd.screenplay.playwright.questions.SelectOptions Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
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