|
7 | 7 | import org.labkey.test.components.UpdatingComponent; |
8 | 8 | import org.labkey.test.components.bootstrap.ModalDialog; |
9 | 9 | import org.labkey.test.components.html.Checkbox; |
| 10 | +import org.labkey.test.util.EscapeUtil; |
10 | 11 | import org.labkey.test.util.selenium.WebElementUtils; |
11 | 12 | import org.openqa.selenium.Keys; |
12 | 13 | import org.openqa.selenium.WebDriver; |
@@ -97,29 +98,29 @@ public List<String> getAvailableFieldLabels() |
97 | 98 | /** |
98 | 99 | * Check to see if the available field listed is shown as selected, has a checkmark, in the 'Available Fields' panel. |
99 | 100 | * |
100 | | - * @param fieldKeyParts Can be an individual field or a path to a nested field. |
| 101 | + * @param fieldNameParts Can be an individual field or a path to a nested field. |
101 | 102 | * @return True if row has the checkmark, false otherwise. |
102 | 103 | */ |
103 | | - public boolean isAvailableFieldSelected(String... fieldKeyParts) |
| 104 | + public boolean isAvailableFieldSelected(String... fieldNameParts) |
104 | 105 | { |
105 | | - WebElement listItem = elementCache().getListItemElementByFieldKey(expandAvailableFields(fieldKeyParts)); |
| 106 | + WebElement listItem = elementCache().getListItemElementByFieldKey(expandAvailableFields(fieldNameParts)); |
106 | 107 | return Locator.tagWithClass("i", "fa-check").findWhenNeeded(listItem).isDisplayed(); |
107 | 108 | } |
108 | 109 |
|
109 | | - public boolean isFieldAvailable(String... fieldKeyParts) |
| 110 | + public boolean isFieldAvailable(String... fieldNameParts) |
110 | 111 | { |
111 | | - return elementCache().getListItemElementByFieldKeyOrNull(expandAvailableFields(fieldKeyParts)) != null; |
| 112 | + return elementCache().getListItemElementByFieldKeyOrNull(expandAvailableFields(fieldNameParts)) != null; |
112 | 113 | } |
113 | 114 |
|
114 | 115 | /** |
115 | 116 | * Select a field the list of available fields. If more than one value is passed in it is assumed to be an expandable path. |
116 | 117 | * |
117 | | - * @param fieldKeyParts Either an individual field or the path to a field to add. |
| 118 | + * @param fieldNameParts Either an individual field or the path to a field to add. |
118 | 119 | * @return This dialog. |
119 | 120 | */ |
120 | | - public FieldSelectionDialog selectAvailableField(String... fieldKeyParts) |
| 121 | + public FieldSelectionDialog selectAvailableField(String... fieldNameParts) |
121 | 122 | { |
122 | | - return addFieldByFieldKeyToGrid(expandAvailableFields(fieldKeyParts)); |
| 123 | + return addFieldByFieldKeyToGrid(expandAvailableFields(fieldNameParts)); |
123 | 124 | } |
124 | 125 |
|
125 | 126 | public WebElement getAvailableFieldElement(String fieldName) |
@@ -154,18 +155,18 @@ private FieldSelectionDialog addFieldByFieldKeyToGrid(String fieldKey) |
154 | 155 | * Expand a field or a hierarchy of fieldKeyParts. If a single field is passed in only it will be expanded. If multiple values |
155 | 156 | * are passed in it is assumed to be a path and all fieldKeyParts will be expanded to the last field. |
156 | 157 | * |
157 | | - * @param fieldKeyParts The list of fieldKeyParts to expand. |
| 158 | + * @param fieldNameParts The list of fieldKeyParts to expand. |
158 | 159 | * @return key for the expanded field. |
159 | 160 | */ |
160 | | - private String expandAvailableFields(String... fieldKeyParts) |
| 161 | + private String expandAvailableFields(String... fieldNameParts) |
161 | 162 | { |
162 | 163 | StringBuilder fieldKey = new StringBuilder(); |
163 | 164 |
|
164 | | - Iterator<String> iterator = Arrays.stream(fieldKeyParts).iterator(); |
| 165 | + Iterator<String> iterator = Arrays.stream(fieldNameParts).iterator(); |
165 | 166 |
|
166 | 167 | while(iterator.hasNext()) |
167 | 168 | { |
168 | | - fieldKey.append(iterator.next().trim()); |
| 169 | + fieldKey.append(EscapeUtil.fieldKeyEncodePart(iterator.next().trim())); |
169 | 170 |
|
170 | 171 | // If this isn't the last item in the collection keep expanding and building the expected data-fieldkey value. |
171 | 172 | if(iterator.hasNext()) |
|
0 commit comments