use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class SettingsSteps method clickButtonOfItem.
@When("^remove information about OAuth \"([^\"]*)\"$")
public void clickButtonOfItem(String itemTitle) {
settingsPage.openSettings(itemTitle);
settingsPage.clickButton(itemTitle, "Remove");
// confirm
ModalDialogPage modalDialogPage = new ModalDialogPage();
assertThat(modalDialogPage.getTitleText()).contains(String.format("Are you sure you want to remove the OAuth credentials for '%s'?", itemTitle));
modalDialogPage.getButton("Remove").shouldBe(enabled).click();
settingsPage.closeCurrentlyExpandedSettings();
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ConditionalFlowSteps method clickOnConditionIcon.
// data:
// |position |ACTION |
// |1 |UP |
// |0 |DOWN |
// |1 |DELETE |
@When("^click on the condition icon$")
public void clickOnConditionIcon(DataTable data) {
for (List<String> row : data.cells()) {
SelenideElement selectedCondition = $(EditFlowStepElements.getConditionIconsOnPosition(row.get(0))).shouldBe(visible);
By iconSelector;
switch(row.get(1)) {
case "UP":
iconSelector = EditFlowStepElements.ICON_UP;
break;
case "DOWN":
iconSelector = EditFlowStepElements.ICON_DOWN;
break;
case "DELETE":
iconSelector = EditFlowStepElements.ICON_DELETE;
break;
default:
throw new IllegalArgumentException("Incorrect data table value on position 1");
}
selectedCondition.$(iconSelector).shouldBe(visible).click();
}
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class JiraSteps method fillIssueKey.
@When("fill in issuekey for previously created issue")
public void fillIssueKey() {
Form.waitForInputs(20);
new Form(new SyndesisRootPage().getRootElement()).fillByTestId(TestUtils.map("issuekey", sharedIssueKey));
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ServiceNowSteps method mapModifiedNumberToIncidentNumber.
/**
* Number is modified according to browser name. (due to parallelization)
*/
@When("define modified service now number {string} and map it to {string}")
public void mapModifiedNumberToIncidentNumber(String incidentNumber, String mapTo) {
String modifiedNumber = snUtils.modifySNNumber(incidentNumber);
DataMapper mapper = new DataMapper();
mapper.addConstant(modifiedNumber, "String");
mapper.openDataMapperCollectionElement();
mapper.doCreateMapping(modifiedNumber, mapTo);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class CommonSteps method clickOnButton.
@When("^click? on the \"([^\"]*)\" button.*$")
public void clickOnButton(String buttonTitle) {
UIUtils.ensureUILoaded();
if ("Done".equals(buttonTitle)) {
// this is hack to replace Done with Next if not present
try {
syndesisRootPage.getRootElement().shouldBe(visible).findAll(By.tagName("button")).filter(matchText("(\\s*)" + buttonTitle + "(\\s*)")).first().waitUntil(visible, 10 * 1000);
} catch (Throwable t) {
buttonTitle = "Next";
}
}
SelenideElement button = syndesisRootPage.getButton(buttonTitle);
log.info(button.toString());
button.shouldBe(visible, enabled).shouldNotHave(attribute("disabled")).click();
}
Aggregations