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);
}
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);
}
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();
}
}
}
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);
}
}
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));
}
Aggregations