Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/org/labkey/test/components/domain/DomainFieldRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,18 @@ public DomainFieldRow setTextChoiceValues(List<String> values)
return addValuesDialog.clickApply();
}

public String setTextChoiceValuesExpectingError(List<String> values)
{
WebElement button = Locator.tagWithClass("span", "container--action-button").withText("Add Values").findElement(this);
button.click();

TextChoiceValueDialog addValuesDialog = new TextChoiceValueDialog(this);
addValuesDialog.addValues(values);
String error = addValuesDialog.getError();
addValuesDialog.clickCancel();
return error;
}

/**
* Get the displayed list of allowed values a TextChoice field.
*
Expand Down
12 changes: 12 additions & 0 deletions src/org/labkey/test/components/domain/TextChoiceValueDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ public String getValueCountText()
return elementCache().valueCount.getText();
}

/**
* Get the error message displayed in the dialog, if any.
*
* @return The error text, or null if no error is displayed.
*/
public String getError()
{
WebElement error = Locator.tagWithClass("div", "domain-text-choices-error")
.findElementOrNull(this);
return error != null ? error.getText() : null;
}

/**
* Click the apply button.
*
Expand Down
Loading