Search in sources :

Example 16 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class Kafka method addAccounts.

public void addAccounts() {
    final String brokersNameBase = "my-cluster-kafka";
    Account kafka = new Account();
    Map<String, String> kafkaParameters = new HashMap<>();
    kafkaParameters.put("brokers", brokersNameBase + "-brokers:9092");
    kafka.setService("kafka");
    kafka.setProperties(kafkaParameters);
    AccountsDirectory.getInstance().getAccounts().put("kafka", kafka);
    // for ui testing - plain:
    Account kafkaAutodetectPlain = new Account();
    Map<String, String> kafkaAutodetectPlainParameters = new HashMap<>();
    kafkaAutodetectPlainParameters.put("brokers", constructBrokerName(brokersNameBase, 9092));
    kafkaAutodetectPlainParameters.put("transportprotocol", "PLAIN");
    kafkaAutodetectPlain.setService("kafka-autodetect-plain");
    kafkaAutodetectPlain.setProperties(kafkaAutodetectPlainParameters);
    AccountsDirectory.getInstance().getAccounts().put("kafka-autodetect-plain", kafkaAutodetectPlain);
    // for ui testing - tls:
    Account kafkaAutodetectTls = new Account();
    Map<String, String> kafkaAutodetectTlsParameters = new HashMap<>();
    kafkaAutodetectTlsParameters.put("brokers", constructBrokerName(brokersNameBase, 9093));
    kafkaAutodetectTlsParameters.put("transportprotocol", "TLS");
    kafkaAutodetectTls.setService("kafka-autodetect-tls");
    kafkaAutodetectTls.setProperties(kafkaAutodetectTlsParameters);
    AccountsDirectory.getInstance().getAccounts().put("kafka-autodetect-tls", kafkaAutodetectTls);
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap)

Example 17 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class SettingsPage method fillOAuthItem.

public void fillOAuthItem(SelenideElement item, String credentialsName) {
    Form form = new Form(item);
    Account account = AccountsDirectory.getInstance().get(credentialsName);
    Map<String, String> properties = new HashMap<>();
    account.getProperties().forEach((key, value) -> properties.put(key.toLowerCase(), value));
    form.fillByTestId(properties);
}
Also used : Account(io.syndesis.qe.account.Account) Form(io.syndesis.qe.fragments.common.form.Form) HashMap(java.util.HashMap)

Example 18 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class SettingsPage method updateTwitterAccount.

public void updateTwitterAccount(String name) {
    Account account = AccountsDirectory.getInstance().get(name);
    if (!account.getProperties().containsKey("Client Secret")) {
        Map<String, String> additions = new HashMap<>();
        additions.put("clientId", account.getProperty("consumerKey"));
        additions.put("clientSecret", account.getProperty("consumerSecret"));
        account.getProperties().putAll(additions);
    }
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap)

Example 19 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class CommonSteps method fillAndValidateSalesforce.

private void fillAndValidateSalesforce() {
    Account account = AccountsDirectory.getInstance().get(Account.Name.SALESFORCE);
    if (isStringInUrl("%22message%22:%22Successfully%20authorized", 5)) {
        log.info("Salesforce is already connected");
        return;
    }
    // So instead if there's an alert saying you are already connected we skip clicking the validate button
    if ($(By.cssSelector("alert")).exists()) {
        log.info("Found alert, probably about account already being authorized");
        log.info("{}", $(By.className("alert")).getText());
        return;
    }
    $(By.id("username")).shouldBe(visible).sendKeys(account.getProperty("userName"));
    $(By.id("password")).shouldBe(visible).sendKeys(account.getProperty("password"));
    $(By.id("Login")).shouldBe(visible).click();
    // give it time to log in
    TestUtils.sleepForJenkinsDelayIfHigher(10);
}
Also used : GoogleAccount(io.syndesis.qe.utils.google.GoogleAccount) Account(io.syndesis.qe.account.Account)

Example 20 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class CommonSteps method fillAndValidateTwitter.

private void fillAndValidateTwitter() {
    Account account = AccountsDirectory.getInstance().get(Account.Name.TWITTER_LISTENER);
    try {
        OpenShiftWaitUtils.waitFor(() -> $(By.id("username_or_email")).exists(), 10 * 1000L);
    } catch (InterruptedException | TimeoutException e) {
        log.info("Already logged into Twitter, clicking on validate");
        $(By.id("allow")).click();
        return;
    }
    $(By.id("username_or_email")).shouldBe(visible).sendKeys(account.getProperty("login"));
    $(By.id("password")).shouldBe(visible).sendKeys(account.getProperty("password"));
    $(By.id("allow")).shouldBe(visible).click();
}
Also used : GoogleAccount(io.syndesis.qe.utils.google.GoogleAccount) Account(io.syndesis.qe.account.Account) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

Account (io.syndesis.qe.account.Account)51 HashMap (java.util.HashMap)21 GoogleAccount (io.syndesis.qe.utils.google.GoogleAccount)10 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)9 Then (io.cucumber.java.en.Then)6 When (io.cucumber.java.en.When)6 Given (io.cucumber.java.en.Given)5 ArrayList (java.util.ArrayList)5 TimeoutException (java.util.concurrent.TimeoutException)5 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Form (io.syndesis.qe.fragments.common.form.Form)3 AsynchronousJiraRestClientFactory (com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory)2 SelenideElement (com.codeborne.selenide.SelenideElement)2 ElementNotFound (com.codeborne.selenide.ex.ElementNotFound)2 DataTable (io.cucumber.datatable.DataTable)2 ContainerPort (io.fabric8.kubernetes.api.model.ContainerPort)2 ContainerPortBuilder (io.fabric8.kubernetes.api.model.ContainerPortBuilder)2 EnvVar (io.fabric8.kubernetes.api.model.EnvVar)2 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)2