Search in sources :

Example 1 with Form

use of io.syndesis.qe.fragments.common.form.Form in project syndesis-qe by syndesisio.

the class CommonSteps method fillTextIntoTextEditor.

// for CodeMirror text editor
@When("^fill text into text-editor$")
public void fillTextIntoTextEditor(DataTable data) {
    StringBuilder text = new StringBuilder();
    data.asList().forEach(s -> {
        text.append(s);
    });
    new Form(new SyndesisRootPage().getRootElement()).fillEditor(text.toString());
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) Form(io.syndesis.qe.fragments.common.form.Form) When(io.cucumber.java.en.When)

Example 2 with Form

use of io.syndesis.qe.fragments.common.form.Form in project syndesis-qe by syndesisio.

the class CommonSteps method fillFormViaTestID.

@Then("^fill in values by element data-testid")
public void fillFormViaTestID(DataTable data) {
    Form.waitForInputs(20);
    TestUtils.sleepIgnoreInterrupt(2000);
    Map<String, String> dataMap = new HashMap<>(data.asMap(String.class, String.class));
    dataMap.replaceAll((key, value) -> value == null ? "" : value);
    new Form(new SyndesisRootPage().getRootElement()).fillByTestId(dataMap);
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) HashMap(java.util.HashMap) Form(io.syndesis.qe.fragments.common.form.Form) Then(io.cucumber.java.en.Then)

Example 3 with Form

use of io.syndesis.qe.fragments.common.form.Form in project syndesis-qe by syndesisio.

the class CommonSteps method forceFillFormViaTestID.

@Then("^force fill in values by element data-testid$")
public void forceFillFormViaTestID(DataTable data) {
    Form.waitForInputs(20);
    TestUtils.sleepIgnoreInterrupt(2000);
    new Form(new SyndesisRootPage().getRootElement()).forceFillByTestId(data.asMap(String.class, String.class));
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) Form(io.syndesis.qe.fragments.common.form.Form) Then(io.cucumber.java.en.Then)

Example 4 with Form

use of io.syndesis.qe.fragments.common.form.Form in project syndesis-qe by syndesisio.

the class ConfigureConnectionSteps method fillFormInLowerCase.

private void fillFormInLowerCase(Map<String, String> properties) {
    SelenideElement form = $(By.className("pf-c-form")).waitUntil(visible, 5000);
    new Form(form.shouldBe(visible)).fillByTestId(properties.entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey().toLowerCase(), Map.Entry::getValue)));
}
Also used : Form(io.syndesis.qe.fragments.common.form.Form) SelenideElement(com.codeborne.selenide.SelenideElement)

Example 5 with Form

use of io.syndesis.qe.fragments.common.form.Form 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);
}
Also used : Form(io.syndesis.qe.fragments.common.form.Form) When(io.cucumber.java.en.When)

Aggregations

Form (io.syndesis.qe.fragments.common.form.Form)14 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)8 When (io.cucumber.java.en.When)6 HashMap (java.util.HashMap)6 Then (io.cucumber.java.en.Then)5 SelenideElement (com.codeborne.selenide.SelenideElement)2 Account (io.syndesis.qe.account.Account)2 GoogleAccount (io.syndesis.qe.utils.google.GoogleAccount)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1