Search in sources :

Example 6 with Conditioned

use of com.github.noraui.cucumber.annotation.Conditioned in project NoraUi by NoraUi.

the class CommonSteps method waitStalenessOf.

/**
 * Waits staleness of element with timeout of x seconds.
 *
 * @param page
 *            The concerned page of field
 * @param element
 *            is key of PageElement concerned
 * @param time
 *            is custom timeout
 * @param conditions
 *            list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
 * @throws TechnicalException
 *             is throws if you have a technical error (format, configuration, datas, ...) in NoraUi.
 */
@Conditioned
@Lorsque("J'attends la diparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\.|\\?]")
@Then("I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\.|\\?]")
public void waitStalenessOf(String page, String element, int time, List<GherkinStepCondition> conditions) throws TechnicalException {
    final WebElement we = Utilities.findElement(Page.getInstance(page).getPageElementByKey('-' + element));
    Context.waitUntil(ExpectedConditions.stalenessOf(we), time);
}
Also used : WebElement(org.openqa.selenium.WebElement) Lorsque(cucumber.api.java.fr.Lorsque) Conditioned(com.github.noraui.cucumber.annotation.Conditioned) Then(cucumber.api.java.en.Then)

Aggregations

Conditioned (com.github.noraui.cucumber.annotation.Conditioned)6 Lorsque (cucumber.api.java.fr.Lorsque)4 Then (cucumber.api.java.en.Then)3 FailureException (com.github.noraui.exception.FailureException)2 Result (com.github.noraui.exception.Result)2 TechnicalException (com.github.noraui.exception.TechnicalException)2 File (java.io.File)2 WebElement (org.openqa.selenium.WebElement)2 RetryOnFailure (com.github.noraui.cucumber.annotation.RetryOnFailure)1 And (cucumber.api.java.en.And)1 Given (cucumber.api.java.en.Given)1 When (cucumber.api.java.en.When)1 Et (cucumber.api.java.fr.Et)1 Quand (cucumber.api.java.fr.Quand)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 Flags (javax.mail.Flags)1 Folder (javax.mail.Folder)1 Message (javax.mail.Message)1 MessagingException (javax.mail.MessagingException)1