Search in sources :

Example 1 with CommonSteps

use of io.syndesis.qe.steps.CommonSteps 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)

Example 2 with CommonSteps

use of io.syndesis.qe.steps.CommonSteps in project syndesis-qe by syndesisio.

the class ExtensionSteps method importExtension.

@Given("^imported extensions$")
public void importExtension(DataTable extensionsData) throws Throwable {
    CommonSteps commonSteps = new CommonSteps();
    String extensionsLink = "Extensions";
    String importButton = "Import Extension";
    List<List<String>> dataTable = extensionsData.raw();
    for (List<String> dataRow : dataTable) {
        String extensionName = dataRow.get(0);
        String extensionFileName = dataRow.get(1);
        commonSteps.navigateTo("", "Customizations");
        commonSteps.validatePage("", "Customizations");
        commonSteps.clickOnLink(extensionsLink);
        commonSteps.validatePage("", "Extensions");
        SelenideElement techExtensionItem = techExtensionsListComponent.getExtensionItem(extensionName);
        if (techExtensionItem != null) {
            log.warn("Extension {} already exists!", extensionName);
        } else {
            commonSteps.clickOnButton(importButton);
            commonSteps.validatePage("", "Import Extension");
            uploadFile(extensionFileName);
            importDetails();
            commonSteps.clickOnButton(importButton);
            commonSteps.validatePage("", "Extension Details");
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) CommonSteps(io.syndesis.qe.steps.CommonSteps) List(java.util.List) Given(cucumber.api.java.en.Given)

Aggregations

CommonSteps (io.syndesis.qe.steps.CommonSteps)2 List (java.util.List)2 SelenideElement (com.codeborne.selenide.SelenideElement)1 Given (cucumber.api.java.en.Given)1 Then (cucumber.api.java.en.Then)1 WizardSteps (io.syndesis.qe.steps.customizations.connectors.wizard.WizardSteps)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1