File tree Expand file tree Collapse file tree
src/org/labkey/test/components/domain Expand file tree Collapse file tree Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments