Search in sources :

Example 1 with WizardSteps

use of io.syndesis.qe.steps.customizations.connectors.wizard.WizardSteps in project syndesis-qe by syndesisio.

the class ApiClientConnectorsSteps method createNewApiConnector.

// ***************************************************************************
// ******************************* bulk phases ********************************
// ***************************************************************************
@Then("^(\\w+) creates new API connector \"([^\"]*)\"$")
public void createNewApiConnector(String user, String connectorName, DataTable properties) throws Throwable {
    String securityAuthType = null;
    for (List<String> property : properties.raw()) {
        switch(property.get(0)) {
            case "security":
                switch(property.get(1)) {
                    // | security | authType | OAuth 2.0 |
                    case "authType":
                        securityAuthType = property.get(2);
                        break;
                    default:
                }
                break;
            default:
        }
    }
    CommonSteps commonSteps = new CommonSteps();
    commonSteps.navigateTo(user, "Customizations");
    commonSteps.validatePage(user, "Customizations");
    commonSteps.clickOnLink("API Client Connectors");
    commonSteps.validatePage(user, "API Client Connectors");
    openNewApiConnectorWizard(user);
    WizardSteps wizardSteps = new WizardSteps();
    List<String> row = asList("file", "swagger/connectors/petstore.json");
    List<List<String>> dataTable = new ArrayList<>();
    dataTable.add(row);
    wizardSteps.uploadSwaggerFile(user, DataTable.create(dataTable));
    wizardSteps.navigateToNextWizardStep(user, "Review Swagger Action");
    wizardSteps.navigateToNextWizardStep(user, "Security");
    wizardSteps.setUpSecurityBy(user, securityAuthType);
    wizardSteps.navigateToNextWizardStep(user, "General Connector Info");
    wizardSteps.finishNewConnectorWizard(user);
    checkNewConnectorIsPresent(user, connectorName);
}
Also used : WizardSteps(io.syndesis.qe.steps.customizations.connectors.wizard.WizardSteps) ArrayList(java.util.ArrayList) CommonSteps(io.syndesis.qe.steps.CommonSteps) List(java.util.List) Arrays.asList(java.util.Arrays.asList) ArrayList(java.util.ArrayList) Then(cucumber.api.java.en.Then)

Aggregations

Then (cucumber.api.java.en.Then)1 CommonSteps (io.syndesis.qe.steps.CommonSteps)1 WizardSteps (io.syndesis.qe.steps.customizations.connectors.wizard.WizardSteps)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 List (java.util.List)1