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