Search in sources :

Example 6 with Lorsque

use of io.cucumber.java.fr.Lorsque in project NoraUi by NoraUi.

the class FileSteps method cleanDownloadDirectory.

/**
 * Empties the default downloaded files folder.
 *
 * @param conditions
 *            List of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
 */
@Conditioned
@Lorsque("Je vide le repertoire des téléchargements(\\?)")
@Given("I clean download directory(\\?)")
public void cleanDownloadDirectory(List<GherkinStepCondition> conditions) {
    try {
        FileUtils.forceMkdir(new File(System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER));
        FileUtils.cleanDirectory(new File(System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER));
    } catch (IOException e) {
        log.warn("IOException in cleanDownloadDirectory", e);
    }
}
Also used : IOException(java.io.IOException) File(java.io.File) Lorsque(io.cucumber.java.fr.Lorsque) Conditioned(com.github.noraui.cucumber.annotation.Conditioned) Given(io.cucumber.java.en.Given)

Example 7 with Lorsque

use of io.cucumber.java.fr.Lorsque in project NoraUi by NoraUi.

the class HelloByeSteps method checkFields.

@Lorsque("Mes champs sont prêts à être utilisés")
@Given("My fields are ready to use")
public void checkFields() throws FailureException {
    By inputSelectLocator = Utilities.getLocator(demoPage.inputSelect);
    By inputTextLocator = Utilities.getLocator(demoPage.inputText);
    Wait.untilAnd(NoraUiExpectedConditions.atLeastOneOfTheseElementsIsPresent(inputSelectLocator, inputTextLocator)).wait(() -> NoraUiExpectedConditions.presenceOfNbElementsLocatedBy(inputSelectLocator, 1)).wait(() -> NoraUiExpectedConditions.presenceOfNbElementsLocatedBy(inputTextLocator, 1)).wait(() -> NoraUiExpectedConditions.visibilityOfNbElementsLocatedBy(inputSelectLocator, 1)).wait(() -> NoraUiExpectedConditions.visibilityOfNbElementsLocatedBy(inputTextLocator, 1));
}
Also used : By(org.openqa.selenium.By) Lorsque(io.cucumber.java.fr.Lorsque) Given(io.cucumber.java.en.Given)

Aggregations

Lorsque (io.cucumber.java.fr.Lorsque)7 Then (io.cucumber.java.en.Then)5 TechnicalException (com.github.noraui.exception.TechnicalException)4 Conditioned (com.github.noraui.cucumber.annotation.Conditioned)3 AssertError (com.github.noraui.exception.AssertError)3 GherkinStepCondition (com.github.noraui.gherkin.GherkinStepCondition)3 Given (io.cucumber.java.en.Given)2 File (java.io.File)2 FailureException (com.github.noraui.exception.FailureException)1 Result (com.github.noraui.exception.Result)1 IOException (java.io.IOException)1 Pattern (java.util.regex.Pattern)1 By (org.openqa.selenium.By)1