use of io.syndesis.qe.pages.integrations.edit.steps.StepComponent in project syndesis-qe by syndesisio.
the class IntegrationFlowViewComponent method getStepsArray.
public List<String> getStepsArray() {
ElementsCollection steps = this.getRootElement().findAll(Element.STEP);
List<String> stepsArray = new ArrayList<String>();
for (int i = 1; i < (steps.size() - 1); i++) {
steps.get(i).click();
SelenideElement title = this.getRootElement().find(Element.ACTIVE_STEP);
String type = title.getText();
StepComponent stepComponent = stepComponentFactory.getStep(type, "");
// wait for root element to be loaded
stepComponent.getRootElement();
stepComponent.initialize();
stepsArray.add(stepComponent.getParameter());
}
this.getFirstVisibleButton("Done").shouldBe(visible).click();
return stepsArray;
}
use of io.syndesis.qe.pages.integrations.edit.steps.StepComponent in project syndesis-qe by syndesisio.
the class IntegrationSteps method fillStepConfiguration.
@Then("^she fills the configuration page for \"([^\"]*)\" step with \"([^\"]*)\" parameter$")
public void fillStepConfiguration(String stepType, String parameter) {
StepComponent stepComponent = editPage.getStepComponent(stepType, parameter);
stepComponent.fillConfiguration();
}
use of io.syndesis.qe.pages.integrations.edit.steps.StepComponent in project syndesis-qe by syndesisio.
the class IntegrationSteps method addRandomStepsAndCheckRest.
@Then("^she adds \"(\\d+)\" random steps and then checks the structure$")
public void addRandomStepsAndCheckRest(Integer numberOfSteps) {
log.info("Adding random phases");
List<String> list = editPage.getFlowViewComponent().getStepsArray();
editPage.getButton("Add a Step").shouldBe(visible).click();
ElementsCollection links = editPage.getLinks("Add a step");
Integer count = links.size();
List<Integer> randomIndexes = new ArrayList<>();
for (int i = 0; i < numberOfSteps; i++) {
randomIndexes.add((int) Math.floor((Math.random() * count)));
}
for (int randomIndex : randomIndexes) {
links.get(randomIndex).click();
String stepType = "Basic Filter";
String stepParameter = "ANY of the following, pathx " + randomIndex + ", Contains, valuex " + randomIndex;
editPage.getIntegrationStepSelectComponent().chooseStep(stepType);
StepComponent stepComponent = editPage.getStepComponent(stepType, stepParameter);
stepComponent.fillConfiguration();
editPage.getButton("Next").shouldBe(visible).click();
editPage.getButton("Add a Step").shouldBe(visible).click();
list.add(randomIndex, stepParameter);
}
List<String> list2 = editPage.getFlowViewComponent().getStepsArray();
for (int i = 0; i < list2.size(); i++) {
log.info("assserting {} and {}", list.get(i), list2.get(i));
assertThat(list.get(i), is(list2.get(i)));
}
}
use of io.syndesis.qe.pages.integrations.edit.steps.StepComponent in project syndesis-qe by syndesisio.
the class IntegrationSteps method verifyConfigureStepPage.
@Then("^she is presented with \"([^\"]*)\" step configuration page$")
public void verifyConfigureStepPage(String stepType) {
StepComponent stepComponent = editPage.getStepComponent(stepType, "");
log.info("there must be add step editPage root element");
stepComponent.getRootElement().shouldBe(visible);
assertThat(stepComponent.validate(), is(true));
}
Aggregations