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
12 changes: 7 additions & 5 deletions src/org/labkey/test/tests/wiki/WikiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ public void testDeleteUndeleteAttachment() throws IOException
wikiHelper.setWikiBody("<p>" + wikiContent + "</p>");
wikiHelper.saveWikiPage();
numberOfWikiCreated++;
clickAndWait(wikiPageLinkLoc);
waitAndClickAndWait(wikiPageLinkLoc);

log("adding an attachment");
clickAndWait(editLinkLoc);
waitAndClickAndWait(editLinkLoc);
click(filePickerLinkLoc);
setFormElement(fileInputLoc, testAttachment);
waitForElement(removeLinkLoc); // when just attached, 'remove' will be an option but delete will not be
Expand All @@ -287,7 +287,7 @@ public void testDeleteUndeleteAttachment() throws IOException
clickAndWait(wikiPageLinkLoc);

log("Deleting attachment");
clickAndWait(editLinkLoc);
waitAndClickAndWait(editLinkLoc);
click(deleteLinkLoc);
waitForElement(attachmentParentLoc.withAttributeContaining("style", "text-decoration: line-through"));
wikiHelper.saveWikiPage();
Expand All @@ -297,21 +297,23 @@ public void testDeleteUndeleteAttachment() throws IOException

log("prepare to delete/undelete attachment");
// re-attach the file and save
clickAndWait(editLinkLoc);
waitAndClickAndWait(editLinkLoc);
click(filePickerLinkLoc);
setFormElement(fileInputLoc, testAttachment);
wikiHelper.saveWikiPage();
clickAndWait(wikiPageLinkLoc);

log("Un-Deleting attachment");
clickAndWait(editLinkLoc);
waitAndClickAndWait(editLinkLoc);
click(deleteLinkLoc); // delete
waitForElement(attachmentParentLoc.withAttributeContaining("style", "text-decoration: line-through"));
waitAndClick(undeleteLinkLoc);
checker().awaiting(Duration.ofMillis(500), ()-> Assertions.assertThat(attachmentParentLoc.findElement(getDriver()).getAttribute("style"))
.as("expect strikethrough style not to be present")
.doesNotContain("text-decoration: line-through"));
wikiHelper.saveWikiPage();
// note: attaching the file and leaving it there will create a search result, so increment wikiCreated count here
numberOfWikiCreated++;

// verify save after undelete persists the attachment
assertElementPresent(Locator.linkWithText(fileName));
Expand Down