public void verifyHasErrorMessage(String field, String message) throws Exception { ElementStub formItemOfField = browser.textbox(Regex.matches("\\[" + field + "\\]")).parentNode().parentNode(); assertThat( browser.div(Regex.matches("form_error")).in(formItemOfField).getText().trim(), Is.is(message)); }
@com.thoughtworks.gauge.Step("Verify dropdown contains <resourceList>") public void verifyDropdownContains(String resourceList) throws Exception { for (String resourceName : new CommaSeparatedParams(resourceList)) { ElementStub itemInAutoComplete = browser.listItem(resourceName).in(browser.div(Regex.wholeWord("ac_results"))); assertThat(itemInAutoComplete.exists(), is(true)); } }
private ElementStub deleteIconWithClass(String materialName, String deleteIconClassName) { List<ElementStub> materialNamelinks = browserWrapper.collect("link", "material_name"); ElementStub deleteIcon = null; for (int i = 0; i < materialNamelinks.size(); i++) { if (materialNamelinks.get(i).getText().equals(scenarioState.expand(materialName))) { ElementStub materialRow = browser.row(i + 1).in(browser.table("list_table")); deleteIcon = browser.span(Regex.wholeWord(deleteIconClassName)).in(materialRow); break; } } return deleteIcon; }
private List<ElementStub> getSuggestionDropdown(final String containerDiv) { return browserWrapper.collectIn("listItem", Regex.startsWith("ac_"), browser.div(containerDiv)); }
public List<ElementStub> firstSuggestion() { return browserWrapper.collectIn( "listItem", Regex.wholeWord("ac_over"), browser.div("ac_results")); }
@com.thoughtworks.gauge.Step("Delete material with name <materialName>") public void deleteMaterialWithName(String materialName) throws Exception { ElementStub materialRow = getMaterialRowForMaterialName(materialName); browser.span(Regex.matches("icon_remove")).in(materialRow).click(); proceedWithConfirmPrompt(); }
@com.thoughtworks.gauge.Step("Click save - Already on Add Job Popup") public void clickSave() throws Exception { browser.submit(Regex.matches("finish submit")).click(); }
public void enterInCommandLookupAutocompleteBox(String textToEnter) throws Exception { browser.textbox(Regex.startsWith("lookup_command")).setValue(textToEnter); }
@com.thoughtworks.gauge.Step("Select <resourceName> from the dropdown") public void selectFromTheDropdown(String resourceName) throws Exception { browser.listItem(resourceName).in(browser.div(Regex.wholeWord("ac_results"))).click(); }