use of cucumber.api.java.fr.Lorsque 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);
}
use of cucumber.api.java.fr.Lorsque in project NoraUi by NoraUi.
the class LogoGameSteps method checkThatAllBrandsIsNotProhibited.
/**
* A check that all brands are not prohibited, because any minors can not play with alcohol and tobacco brands.
*
* @param jsonLogos
* Serialized Json representation of all logos (all brands)
* @throws TechnicalException
* is throws if you have a technical error (format, configuration, datas, ...) in NoraUi.
* @throws FailureException
* if the scenario encounters a functional error
*/
@Lorsque("Je vérifie que toutes les marques '(.*)' ne sont pas interdites")
@Given("I check that all brands '(.*)' are not prohibited")
public void checkThatAllBrandsIsNotProhibited(String jsonLogos) throws TechnicalException, FailureException {
Logos logos = new Logos();
logos.deserialize(jsonLogos);
for (int i = 0; i < logos.size(); i++) {
if (ProhibitedBrands.getAlcool().contains(logos.get(i).getBrand()) || ProhibitedBrands.getTabaco().contains(logos.get(i).getBrand())) {
new Result.Failure<>(logos.get(i).getBrand(), Messages.format("Brand « %s » is prohibited.", logos.get(i).getBrand()), false, logos.get(i).getNid(), Context.getCallBack(Callbacks.RESTART_WEB_DRIVER));
}
}
}
Aggregations