Skip to content

Commit 0b75179

Browse files
committed
GitHub Issue 947, 955 & 988
1 parent 3359c0c commit 0b75179

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/org/labkey/test/components/domain/DomainFieldRow.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,18 @@ public DomainFieldRow setTextChoiceValues(List<String> values)
790790
return addValuesDialog.clickApply();
791791
}
792792

793+
public String setTextChoiceValuesExpectingError(List<String> values)
794+
{
795+
WebElement button = Locator.tagWithClass("span", "container--action-button").withText("Add Values").findElement(this);
796+
button.click();
797+
798+
TextChoiceValueDialog addValuesDialog = new TextChoiceValueDialog(this);
799+
addValuesDialog.addValues(values);
800+
String error = addValuesDialog.getError();
801+
addValuesDialog.clickCancel();
802+
return error;
803+
}
804+
793805
/**
794806
* Get the displayed list of allowed values a TextChoice field.
795807
*

src/org/labkey/test/components/domain/TextChoiceValueDialog.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ public String getValueCountText()
6363
return elementCache().valueCount.getText();
6464
}
6565

66+
/**
67+
* Get the error message displayed in the dialog, if any.
68+
*
69+
* @return The error text, or null if no error is displayed.
70+
*/
71+
public String getError()
72+
{
73+
WebElement error = Locator.tagWithClass("div", "domain-text-choices-error")
74+
.findElementOrNull(this);
75+
return error != null ? error.getText() : null;
76+
}
77+
6678
/**
6779
* Click the apply button.
6880
*

0 commit comments

Comments
 (0)