use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ConnectionSteps method clickOnKebabMenuButtonOfConnection.
@When("^click on the \"([^\"]*)\" kebab menu button of \"([^\"]*)\"$")
public void clickOnKebabMenuButtonOfConnection(String button, String connectionName) throws Throwable {
KebabMenu kebabMenu = new KebabMenu(connectionsPage.getConnection(connectionName).$(By.xpath(".//button")).shouldBe(visible));
kebabMenu.open();
kebabMenu.getItemElement(button).shouldBe(visible).click();
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ApicurioSteps method removeOperation.
@ExcludeFromSelectorReports
@When("^remove an operation via apicurio gui$")
public void removeOperation() {
$(Elements.PATH_SECTION).shouldBe(visible).$(Elements.OPERATION).shouldBe(visible).click();
$(Elements.OPERATION_KEBAB).shouldBe(visible).click();
SelenideElement kebabMenu = $(Elements.OPERATION_KEBAB_MENU);
try {
kebabMenu.$(Elements.OPERATION_KEBAB_MENU_DELETE).shouldBe(visible).click();
} catch (org.openqa.selenium.StaleElementReferenceException e) {
$(Elements.OPERATION_KEBAB_MENU).$(Elements.OPERATION_KEBAB_MENU_DELETE).shouldBe(visible).click();
}
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ApicurioSteps method addSecuritySchema.
@ExcludeFromSelectorReports
@When("^add security schema (BASIC|API Key|OAuth 2) via apicurio gui$")
public void addSecuritySchema(String schemeType) {
// child span element selected so the click is inside of the element
$(Elements.SECURITY_SECTION).shouldBe(visible).$(By.tagName("span")).click();
$(Elements.SECURITY_SECTION).shouldBe(visible).$(Elements.BUTTON_ADD_SCHEME).shouldBe(visible).click();
SelenideElement nameInput = $(SecurityPageElements.NAME).shouldBe(visible);
try {
nameInput.sendKeys("ImmovableName");
} catch (org.openqa.selenium.StaleElementReferenceException e) {
$(SecurityPageElements.NAME).shouldBe(visible).sendKeys("ImmovableName");
}
// select security option
$(SecurityPageElements.EDITOR).shouldBe(visible).$(SecurityPageElements.SECURITY_TYPE_DROPDOWN).shouldBe(visible).click();
$(SecurityPageElements.EDITOR).shouldBe(visible).$(SecurityPageElements.SECURITY_DROPDOWN_MENU).shouldBe(visible).$(By.xpath(".//a[contains(text(), \"" + schemeType + "\")]")).shouldBe(visible).click();
if ("API Key".equalsIgnoreCase(schemeType)) {
$(By.className("apiKey-auth")).find(By.id("in20")).click();
$(By.className("apiKey-auth")).findAll("li").filter(text("HTTP header")).first().click();
$(By.id("name20")).sendKeys("headerName");
}
if ("OAuth 2".equalsIgnoreCase(schemeType)) {
$(By.id("flow")).shouldBe(visible).click();
$(By.id("flow")).shouldBe(visible).parent().$(By.xpath(".//a[contains(text(), \"Access Code\")]")).shouldBe(visible).click();
$(By.id("authorizationUrl")).sendKeys("http://syndesis.io");
$(By.id("tokenUrl")).sendKeys("https://hihi.com");
}
ElementsCollection saveButtons = $(SecurityPageElements.ACTION_HEADER).shouldBe(visible).$$(SecurityPageElements.SAVE);
assertThat(saveButtons.size()).isEqualTo(1);
saveButtons.get(0).shouldBe(visible).click();
$(Elements.BUTTON_ADD_REQUIREMENT).shouldBe(visible).click();
try {
OpenShiftWaitUtils.waitFor(() -> $(SecurityPageElements.SECURITY_REQUIREMENT).exists(), 60 * 1000L);
} catch (InterruptedException | TimeoutException e) {
fail("Security requirement was not found.");
}
ElementsCollection items = $$(SecurityPageElements.SECURITY_REQUIREMENT_ITEMS).shouldBe(sizeGreaterThanOrEqual(1)).filterBy(text("ImmovableName"));
assertThat(items).hasSize(1);
items.first().click();
saveButtons = $(SecurityPageElements.ACTION_HEADER).shouldBe(visible).$$(SecurityPageElements.SAVE);
assertThat(saveButtons.size()).isEqualTo(1);
saveButtons.get(0).shouldBe(visible).click();
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class DashboardSteps method deleteIntegrationOnDashboard.
@When("^delete the \"([^\"]*)\" integration in top 5 integrations$")
public void deleteIntegrationOnDashboard(String integrationName) {
log.info("Trying to delete {} on top 5 integrations table");
IntegrationsList integrationsList = new IntegrationsList(By.cssSelector("syndesis-dashboard-integrations"));
integrationsList.invokeActionOnItem(integrationName, ListAction.DELETE);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class NameConnectionSteps method fillNameConnectionForm.
@When("^fills? Name Connection form$")
public void fillNameConnectionForm(DataTable data) {
new Form(nameConnectionPage.getRootElement()).fillByLabel(data.asMap(String.class, String.class));
TestUtils.sleepForJenkinsDelayIfHigher(1);
}
Aggregations