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

net.serenitybdd.screenplay.ui.Select Maven / Gradle / Ivy

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

import net.serenitybdd.screenplay.Performable;
import net.serenitybdd.screenplay.actions.DeselectFromOptions;
import net.serenitybdd.screenplay.actions.SelectFromOptions;
import net.serenitybdd.screenplay.targets.Target;

/**
 * Interact with a SELECT Html element
 */
public class Select {
    public static SelectFromOptions option(String option) {
        return SelectFromOptions.byVisibleText(option);
    }

    public static SelectFromOptions options(String... options) {
        return SelectFromOptions.byVisibleText(options);
    }

    public static SelectFromOptions value(String value) {
        return SelectFromOptions.byValue(value);
    }

    public static SelectFromOptions values(String... values) {
        return SelectFromOptions.byValue(values);
    }

    public static SelectFromOptions optionNumber(int index) {
        return SelectFromOptions.byIndex(index);
    }

    public static SelectFromOptions optionNumbers(Integer... indexes) {
        return SelectFromOptions.byIndex(indexes);
    }

    public static Performable noOptionsIn(Target dropdownList) {
        return DeselectFromOptions.clear(dropdownList);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy