Search in sources :

Example 56 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class TodoSteps method fillHostUrl.

@When("^fill in TODO API host URL$")
public void fillHostUrl() {
    if (OpenShiftUtils.getInstance().getRoute("todo2") == null || !OpenShiftUtils.getInstance().getRoute("todo2").getSpec().getHost().equals("/")) {
        TodoUtils.createDefaultRouteForTodo("todo2", "/");
    }
    String host = "http://" + OpenShiftUtils.getInstance().getRoute("todo2").getSpec().getHost();
    Map<String, String> todoConfigMap = new HashMap<>();
    todoConfigMap.put("host", host);
    new Form($(By.id("root"))).fillByTestId(todoConfigMap);
}
Also used : HashMap(java.util.HashMap) Form(io.syndesis.qe.fragments.common.form.Form) When(io.cucumber.java.en.When)

Example 57 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ApiClientConnectorsSteps method setPetstoreCredentials.

@When("^set swagger petstore credentials")
public void setPetstoreCredentials() {
    Account petStoreAccount = new Account();
    petStoreAccount.setService("Swagger Petstore");
    Map<String, String> accountParameters = new HashMap<>();
    accountParameters.put("authenticationparametervalue", "special-key");
    petStoreAccount.setProperties(accountParameters);
    AccountsDirectory.getInstance().addAccount("Swagger Petstore Account", petStoreAccount);
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap) When(io.cucumber.java.en.When)

Example 58 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ApiProviderSteps method createApiProviderSpec.

@When("^create API Provider spec from ([\\w]+) (.+)$")
public void createApiProviderSpec(String source, String path) {
    if ("url".equals(source) && "todo-app".equals(path)) {
        TodoUtils.createDefaultRouteForTodo(path, "/");
        path = "http://" + OpenShiftUtils.getInstance().getRoute(path).getSpec().getHost() + "/swagger.json";
    }
    new UploadApiProviderSpecification().upload(source, path);
}
Also used : UploadApiProviderSpecification(io.syndesis.qe.pages.integrations.editor.apiprovider.wizard.UploadApiProviderSpecification) When(io.cucumber.java.en.When)

Example 59 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class SelectConnectionTypeSteps method selectConnectionType.

@When("^select \"([^\"]*)\" connection type$")
public void selectConnectionType(String connectionName) {
    selectConnectionTypePage.selectConnectionType(connectionName);
    ConfigureConnection connectionWizardStep = null;
    switch(connectionName) {
        case "AMQ":
            connectionWizardStep = new ConfigureConnectionAmq();
            break;
        default:
            connectionWizardStep = new ConfigureConnection();
    }
    wizard.replaceStep(connectionWizardStep, 1);
}
Also used : ConfigureConnectionAmq(io.syndesis.qe.pages.connections.wizard.phases.configure.ConfigureConnectionAmq) ConfigureConnection(io.syndesis.qe.pages.connections.wizard.phases.configure.ConfigureConnection) When(io.cucumber.java.en.When)

Example 60 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ApicurioSteps method configureSecuritySchema.

@When("configure the {string} security schema")
public void configureSecuritySchema(String name) {
    SelenideElement securityRow = $(Elements.SECURITY_SECTION).$$(Elements.SECURITY_SCHEMA_ROW).find(Condition.text(name));
    if (securityRow == null) {
        fail("Couldn't locate security schema {}, double check the spelling. Make sure you are using only the schema name, not also the type", name);
    }
    securityRow.$(".dropdown-toggle").click();
    securityRow.$(".dropdown-menu").$$("li").find(Condition.text("Edit")).click();
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)111 SelenideElement (com.codeborne.selenide.SelenideElement)23 Map (java.util.Map)10 File (java.io.File)8 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)7 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)7 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)6 Account (io.syndesis.qe.account.Account)6 Form (io.syndesis.qe.fragments.common.form.Form)6 Syndesis (io.syndesis.qe.resource.impl.Syndesis)6 TimeoutException (java.util.concurrent.TimeoutException)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 Slf4j (lombok.extern.slf4j.Slf4j)5 ElementsCollection (com.codeborne.selenide.ElementsCollection)4 DataTable (io.cucumber.datatable.DataTable)4 IntegrationsEndpoint (io.syndesis.qe.endpoint.IntegrationsEndpoint)4 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)4 List (java.util.List)4