use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.
the class OAuthSettingsComponent method fillSettingsItemForm.
/**
* @param itemTitle title of settings entry
* @param formData object where key is name of input field and value it's content
*/
public void fillSettingsItemForm(String itemTitle, Map<String, String> formData) {
log.info("filling {} with data '{}'", itemTitle, formData.toString());
SelenideElement item = this.getSettingsItem(itemTitle);
for (String key : formData.keySet()) {
SelenideElement input = item.$(String.format("input[name = \"%s\"]", key));
item.sendKeys(formData.get(key));
}
}
use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.
the class CommonSteps method navigateToHelp.
@When("^.*navigates? to the \"([^\"]*)\" page in help menu$")
public void navigateToHelp(String title) {
SelenideElement helpDropdownMenu = $(By.id("dropdownHelp")).shouldBe(visible);
if (!helpDropdownMenu.getAttribute("class").contains("open")) {
helpDropdownMenu.click();
}
SelenideElement dropdownElementsTable = $(By.className("dropdown-menu")).shouldBe(visible);
ElementsCollection dropdownElements = dropdownElementsTable.findAll(By.tagName("a"));
dropdownElements.filter(text(title)).shouldHaveSize(1).get(0).shouldBe(visible).click();
}
use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.
the class CommonSteps method login.
@Given("^\"([^\"]*)\" logs into the Syndesis$")
public void login(String username) throws Throwable {
Selenide.open(TestConfiguration.syndesisUrl());
String currentUrl = WebDriverRunner.getWebDriver().getCurrentUrl();
if (currentUrl.contains("api.fuse-ignite.openshift.com")) {
// click only if there is Ignite cluster login page
SelenideElement login = $(By.className("login-redhat"));
if (login.isDisplayed()) {
login.click();
}
RHDevLogin rhDevLogin = new RHDevLogin();
rhDevLogin.login(TestConfiguration.syndesisUsername(), TestConfiguration.syndesisPassword());
} else if (currentUrl.contains(":8443/login")) {
log.info("Minishift cluster login page");
MinishiftLogin minishiftLogin = new MinishiftLogin();
minishiftLogin.login(TestConfiguration.syndesisUsername(), TestConfiguration.syndesisPassword());
} else if (currentUrl.contains("github.com/login")) {
GitHubLogin gitHubLogin = new GitHubLogin();
gitHubLogin.login(TestConfiguration.syndesisUsername(), TestConfiguration.syndesisPassword());
}
currentUrl = WebDriverRunner.getWebDriver().getCurrentUrl();
if (currentUrl.contains("oauth/authorize/approve")) {
log.info("Authorize access login page");
$("input[name=\"approve\"]").shouldBe(visible).click();
}
}
use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.
the class CommonSteps method expectTableTitlePresent.
public void expectTableTitlePresent(String tableTitle) {
SelenideElement table = new SyndesisRootPage().getTitleByText(tableTitle);
table.shouldBe(visible);
}
use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.
the class CommonSteps method successNotificationIsPresentWithError.
@Then("^she can see \"([^\"]*)\" in alert-success notification$")
public void successNotificationIsPresentWithError(String textMessage) {
SelenideElement allertSucces = new SyndesisRootPage().getElementByClassName("alert-success");
allertSucces.shouldBe(visible);
Assertions.assertThat(allertSucces.getText().equals(textMessage)).isTrue();
log.info("Text message {} was found.", textMessage);
}
Aggregations