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

net.serenitybdd.screenplay.waits.WaitUntil Maven / Gradle / Ivy

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


import net.serenitybdd.core.pages.WebElementState;
import net.serenitybdd.screenplay.Interaction;
import net.serenitybdd.screenplay.targets.Target;
import org.hamcrest.Matcher;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedCondition;

import static net.serenitybdd.screenplay.Tasks.instrumented;

public class WaitUntil {

    public static WaitUntilTargetIsReady the(Target target, Matcher expectedState) {
        return  instrumented(WaitUntilTargetIsReady.class, target, expectedState);
    }

    public static WaitUntilTargetIsReady the(String xpathOrCSSSelector, Matcher expectedState) {
        return  instrumented(WaitUntilTargetIsReady.class, Target.the(xpathOrCSSSelector).locatedBy(xpathOrCSSSelector), expectedState);
    }

    public static WaitUntilTargetIsReady the(By byLocator, Matcher expectedState) {
        return  instrumented(WaitUntilTargetIsReady.class, Target.the(byLocator.toString()).located(byLocator), expectedState);
    }

    public static  WaitUntilExpectation the(ExpectedCondition expectedCondition) {
        return new WaitUntilExpectation<>(expectedCondition);
    }

    public static Interaction angularRequestsHaveFinished() {
        return instrumented(WaitUntilAngularIsReady.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy