Search in sources :

Example 71 with Given

use of io.cucumber.java.en.Given in project grakn by graknlabs.

the class TypeQLSteps method typeql_undefine.

@Given("typeql undefine")
public void typeql_undefine(String undefineQueryStatements) {
    TypeQLUndefine typeQLQuery = TypeQL.parseQuery(String.join("\n", undefineQueryStatements)).asUndefine();
    tx().query().undefine(typeQLQuery);
}
Also used : TypeQLUndefine(com.vaticle.typeql.lang.query.TypeQLUndefine) Given(io.cucumber.java.en.Given)

Example 72 with Given

use of io.cucumber.java.en.Given in project grakn by graknlabs.

the class TypeQLSteps method typeql_define.

@Given("typeql define")
public void typeql_define(String defineQueryStatements) {
    TypeQLDefine typeQLQuery = TypeQL.parseQuery(String.join("\n", defineQueryStatements)).asDefine();
    tx().query().define(typeQLQuery);
}
Also used : TypeQLDefine(com.vaticle.typeql.lang.query.TypeQLDefine) Given(io.cucumber.java.en.Given)

Example 73 with Given

use of io.cucumber.java.en.Given in project grakn by graknlabs.

the class ReasonerSteps method schema.

@Given("reasoning schema")
public void schema(String defineQueryStatements) {
    if (correctnessVerifier != null)
        correctnessVerifier.close();
    if (session != null)
        session.close();
    try (CoreSession session = databaseMgr.session(DATABASE, Arguments.Session.Type.SCHEMA)) {
        try (CoreTransaction tx = session.transaction(Arguments.Transaction.Type.WRITE)) {
            tx.query().define(TypeQL.parseQuery(String.join("\n", defineQueryStatements)).asDefine());
            tx.commit();
        }
    }
}
Also used : CoreSession(com.vaticle.typedb.core.database.CoreSession) CoreTransaction(com.vaticle.typedb.core.database.CoreTransaction) Given(io.cucumber.java.en.Given)

Example 74 with Given

use of io.cucumber.java.en.Given 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 75 with Given

use of io.cucumber.java.en.Given 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

Given (io.cucumber.java.en.Given)125 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)27 ArrayList (java.util.ArrayList)11 Transactional (org.springframework.transaction.annotation.Transactional)11 Ssld (org.opensmartgridplatform.domain.core.entities.Ssld)8 Date (java.util.Date)7 DeviceOutputSetting (org.opensmartgridplatform.domain.core.entities.DeviceOutputSetting)6 ActivityCalendar (org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar)5 Device (org.opensmartgridplatform.domain.core.entities.Device)5 RelayType (org.opensmartgridplatform.domain.core.valueobjects.RelayType)5 ByteString (com.google.protobuf.ByteString)4 Account (io.syndesis.qe.account.Account)4 File (java.io.File)4 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Field (java.lang.reflect.Field)3 HashMap (java.util.HashMap)3 ResponseData (org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData)3 ResponseDataBuilder (org.opensmartgridplatform.cucumber.platform.glue.steps.database.ws.ResponseDataBuilder)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2