|
22 | 22 | import org.labkey.test.categories.Reports; |
23 | 23 | import org.labkey.test.components.ext4.Window; |
24 | 24 | import org.labkey.test.components.html.BootstrapMenu; |
| 25 | +import org.labkey.test.util.Ext4Helper; |
25 | 26 | import org.labkey.test.util.LogMethod; |
26 | 27 | import org.openqa.selenium.By; |
27 | 28 | import org.openqa.selenium.WebElement; |
@@ -262,25 +263,30 @@ private void doParticipantReportTest() |
262 | 263 | waitForElementToDisappear(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT); |
263 | 264 | click(Locator.xpath("//img[@data-qtip = 'Delete']")); // Delete 'Severity Grade' column. |
264 | 265 | clickButton("Save As", 0); |
265 | | - _extHelper.waitForExtDialog("Save As"); |
| 266 | + Window<?> saveAsDialog = new Window.WindowFinder(getDriver()).withTitle("Save As").waitFor(); |
266 | 267 | _extHelper.setExtFormElementByLabel("Save As", "Report Name", PARTICIPANT_REPORT2_NAME); |
267 | 268 | _extHelper.setExtFormElementByLabel("Save As", "Report Description", PARTICIPANT_REPORT2_DESCRIPTION); |
268 | | - clickButtonByIndex("Save", 1, 0); |
| 269 | + Ext4Helper.Locators.ext4Button("Save").withoutAttributeContaining("class", "disabled") |
| 270 | + .waitForElement(saveAsDialog, 2_000).click(); |
| 271 | + saveAsDialog.waitForClose(); |
269 | 272 | _ext4Helper.waitForComponentNotDirty("participant-report-panel-1"); |
270 | 273 | waitForTextToDisappear("Severity Grade"); |
271 | 274 |
|
272 | 275 | // Verify saving with existing report name. |
273 | 276 | click(Locator.xpath("//a[./span[@title = 'Edit']]")); |
274 | 277 | waitForElementToDisappear(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT); |
275 | 278 | clickButton("Save As", 0); |
276 | | - _extHelper.waitForExtDialog("Save As"); |
| 279 | + saveAsDialog = new Window.WindowFinder(getDriver()).withTitle("Save As").waitFor(); |
277 | 280 | _extHelper.setExtFormElementByLabel("Save As", "Report Name", PARTICIPANT_REPORT_NAME); |
278 | 281 | _extHelper.setExtFormElementByLabel("Save As", "Report Description", PARTICIPANT_REPORT2_DESCRIPTION); |
279 | | - clickButtonByIndex("Save", 1, 0); |
280 | | - _extHelper.waitForExtDialog("Failure"); |
| 282 | + Ext4Helper.Locators.ext4Button("Save").withoutAttributeContaining("class", "disabled") |
| 283 | + .waitForElement(saveAsDialog, 2_000).click(); |
| 284 | + Window<?> failureDialog = new Window.WindowFinder(getDriver()).withTitle("Failure").waitFor(); |
281 | 285 | assertTextPresent("Another report with the same name already exists."); |
282 | 286 | clickButton("OK", 0); |
| 287 | + failureDialog.waitForClose(); |
283 | 288 | clickButton("Cancel", 0); // Verify cancel button. |
| 289 | + saveAsDialog.waitForClose(); |
284 | 290 | waitForElement(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT); // Edit panel should be hidden |
285 | 291 |
|
286 | 292 |
|
@@ -350,12 +356,12 @@ private void doParticipantReportTest() |
350 | 356 | { |
351 | 357 | assertTextPresent(ptid); |
352 | 358 |
|
353 | | - String base = "//td//a[text()='" + ptid + "']/../../..//td[contains(text(), 'Groups:')]/following-sibling::td[contains(normalize-space(), '"; |
354 | | - waitForElement(Locator.xpath(base + PARTICIPANT_GROUP_ONE + "')]")); |
| 359 | + Locator.XPathLocator base = Locator.xpath("//td//a[text()='" + ptid + "']/../../..//td[contains(text(), 'Groups:')]/following-sibling::td"); |
| 360 | + waitForElement(base.containing(PARTICIPANT_GROUP_ONE)); |
355 | 361 |
|
356 | 362 | if (ptid_list2.contains(ptid)) |
357 | 363 | { |
358 | | - assertElementPresent(Locator.xpath(base + PARTICIPANT_GROUP_TWO + "')]")); |
| 364 | + assertElementPresent(base.containing(PARTICIPANT_GROUP_TWO)); |
359 | 365 | } |
360 | 366 |
|
361 | 367 | } |
|
0 commit comments