File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
src/org/labkey/test/components/ui Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ public String getLabel()
6161
6262 public String getValue ()
6363 {
64- return elementCache ().toggle ().getText ();
64+ if (elementCache ().hasToggle ())
65+ return elementCache ().toggle ().getText ();
66+ return getComponentElement ().getText ();
6567 }
6668
6769 private boolean isOpen ()
@@ -125,6 +127,11 @@ WebElement toggle()
125127 return toggleLoc .waitForElement (this , 1_000 );
126128 }
127129
130+ boolean hasToggle ()
131+ {
132+ return toggleLoc .existsIn (this );
133+ }
134+
128135 WebElement pencil ()
129136 {
130137 return pencilLoc .waitForElement (this , 1_000 );
Original file line number Diff line number Diff line change @@ -109,6 +109,19 @@ else if (elementCache().dataFieldByKey(identifier).isDisplayed())
109109 }
110110 }
111111
112+ public boolean hasField (String identifier )
113+ {
114+ try
115+ {
116+ getField (identifier );
117+ return true ;
118+ }
119+ catch (NoSuchElementException nse )
120+ {
121+ return false ;
122+ }
123+ }
124+
112125 public boolean fieldHasFormatPill (String identifier )
113126 {
114127 return Locator .tagWithClass ("*" , "status-pill" ).existsIn (getField (identifier ));
You can’t perform that action at this time.
0 commit comments