Skip to content

Commit a142da0

Browse files
committed
Additional tests
1 parent b97f174 commit a142da0

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

src/org/labkey/test/pages/assay/AssayImportPage.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ public AssayImportPage selectUploadFileRadioButton()
9595
return this;
9696
}
9797

98+
public @Nullable String getFieldValue(String fieldName)
99+
{
100+
var input = Locator.input(getTableViewFormFieldName(fieldName));
101+
if (isElementPresent(input))
102+
return getFormElement(input);
103+
104+
return null;
105+
}
106+
98107
/**
99108
* Retrieves the file name for a field if it has been previously uploaded. In this case the server
100109
* will display a file name with an icon and a "[remove]" link. If a value has not been previously uploaded,
@@ -114,11 +123,17 @@ public AssayImportPage selectUploadFileRadioButton()
114123
return StringUtils.trimToNull(text.replace("[remove]", ""));
115124
}
116125

117-
var fileInput = Locator.input(getTableViewFormFieldName(fieldName));
118-
if (isElementPresent(fileInput))
119-
return getFormElement(fileInput);
126+
return getFieldValue(fieldName);
127+
}
120128

121-
return null;
129+
public AssayImportPage removeFileValue(String fieldName)
130+
{
131+
var removeFileLink = Locator.tagWithClass("div", "lk-remove-file")
132+
.withAttribute("data-fieldname", fieldName)
133+
.child(Locator.tagWithText("a", "remove"));
134+
135+
removeFileLink.findElement(getDriver()).click();
136+
return this;
122137
}
123138

124139
/* button actions */

0 commit comments

Comments
 (0)