Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/org/labkey/test/tests/ParticipantReportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.labkey.test.categories.Reports;
import org.labkey.test.components.ext4.Window;
import org.labkey.test.components.html.BootstrapMenu;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.LogMethod;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
Expand Down Expand Up @@ -262,25 +263,28 @@ private void doParticipantReportTest()
waitForElementToDisappear(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT);
click(Locator.xpath("//img[@data-qtip = 'Delete']")); // Delete 'Severity Grade' column.
clickButton("Save As", 0);
_extHelper.waitForExtDialog("Save As");
Window<?> saveAsDialog = new Window.WindowFinder(getDriver()).withTitle("Save As").waitFor();
_extHelper.setExtFormElementByLabel("Save As", "Report Name", PARTICIPANT_REPORT2_NAME);
_extHelper.setExtFormElementByLabel("Save As", "Report Description", PARTICIPANT_REPORT2_DESCRIPTION);
clickButtonByIndex("Save", 1, 0);
Ext4Helper.Locators.ext4ButtonEnabled("Save").waitForElement(saveAsDialog, 2_000).click();
saveAsDialog.waitForClose();
_ext4Helper.waitForComponentNotDirty("participant-report-panel-1");
waitForTextToDisappear("Severity Grade");

// Verify saving with existing report name.
click(Locator.xpath("//a[./span[@title = 'Edit']]"));
waitForElementToDisappear(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT);
clickButton("Save As", 0);
_extHelper.waitForExtDialog("Save As");
saveAsDialog = new Window.WindowFinder(getDriver()).withTitle("Save As").waitFor();
_extHelper.setExtFormElementByLabel("Save As", "Report Name", PARTICIPANT_REPORT_NAME);
_extHelper.setExtFormElementByLabel("Save As", "Report Description", PARTICIPANT_REPORT2_DESCRIPTION);
clickButtonByIndex("Save", 1, 0);
_extHelper.waitForExtDialog("Failure");
Ext4Helper.Locators.ext4ButtonEnabled("Save").waitForElement(saveAsDialog, 2_000).click();
Window<?> failureDialog = new Window.WindowFinder(getDriver()).withTitle("Failure").waitFor();
assertTextPresent("Another report with the same name already exists.");
clickButton("OK", 0);
failureDialog.waitForClose();
clickButton("Cancel", 0); // Verify cancel button.
saveAsDialog.waitForClose();
waitForElement(Locator.xpath("id('participant-report-panel-1-body')/div[contains(@style, 'display: none')]"), WAIT_FOR_JAVASCRIPT); // Edit panel should be hidden


Expand Down Expand Up @@ -350,12 +354,12 @@ private void doParticipantReportTest()
{
assertTextPresent(ptid);

String base = "//td//a[text()='" + ptid + "']/../../..//td[contains(text(), 'Groups:')]/following-sibling::td[contains(normalize-space(), '";
waitForElement(Locator.xpath(base + PARTICIPANT_GROUP_ONE + "')]"));
Locator.XPathLocator base = Locator.xpath("//td//a[text()='" + ptid + "']/../../..//td[contains(text(), 'Groups:')]/following-sibling::td");
waitForElement(base.containing(PARTICIPANT_GROUP_ONE));

if (ptid_list2.contains(ptid))
{
assertElementPresent(Locator.xpath(base + PARTICIPANT_GROUP_TWO + "')]"));
assertElementPresent(base.containing(PARTICIPANT_GROUP_TWO));
}

}
Expand Down