Skip to content

Commit b60d7e8

Browse files
authored
WorkflowUpgradeTest for verification of workflow refactor upgrade script (#2791)
- EditInlineField update to get value based on component text in read only case - DetailTable helper for hasField()
1 parent b1ceaff commit b60d7e8

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/org/labkey/test/components/ui/edit/EditInlineField.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

src/org/labkey/test/components/ui/grids/DetailTable.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)