Skip to content

Commit

Permalink
Merge pull request #275 from Lombiq/issue/NEST-435
Browse files Browse the repository at this point in the history
NEST-435: Fix flaky UI tests
  • Loading branch information
wAsnk authored May 10, 2023
2 parents 831ea59 + a948535 commit 8e91eb3
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,11 @@ public static Task TestMediaOperationsAsync(this UITestContext context) =>
"Test media operations",
async () =>
{
const string mediaPath = "/Media";
var imageName = FileUploadHelper.SamplePngFileName;
var documentName = FileUploadHelper.SamplePdfFileName;
await context.GoToAdminRelativeUrlAsync("/Media");
await context.GoToAdminRelativeUrlAsync(mediaPath);
context.UploadSamplePngByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
Expand All @@ -583,7 +584,7 @@ await context
context.SwitchToFirstWindow();
context.WaitForPageLoad();
await context.GoToAdminRelativeUrlAsync("/Media");
await context.GoToAdminRelativeUrlAsync(mediaPath);
context.UploadSamplePdfByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
Expand All @@ -603,7 +604,7 @@ await context
context.SwitchToFirstWindow();
context.WaitForPageLoad();
await context.GoToAdminRelativeUrlAsync("/Media");
await context.GoToAdminRelativeUrlAsync(mediaPath);
await context
.Get(By.CssSelector("#folder-tree .treeroot .folder-actions")) // #spell-check-ignore-line
Expand All @@ -629,13 +630,18 @@ await context
.ClickReliablyAsync(context);
await context.ClickModalOkAsync();
context.WaitForPageLoad();
await context.GoToAdminRelativeUrlAsync(mediaPath);
context.Missing(By.XPath("//span[text()=' Image.png ' and @class='break-word']"));
var deleteFolderButton =
context.Get(By.CssSelector("#folder-tree li.selected div.btn-group.folder-actions .svg-inline--fa.fa-trash"));
await deleteFolderButton.ClickReliablyAsync(context);
await context.ClickModalOkAsync();
context.WaitForPageLoad();
await context.GoToAdminRelativeUrlAsync(mediaPath);
context.Missing(By.XPath("//div[text()='Example Folder' and @class='folder-name ms-2']"));
});
Expand Down

0 comments on commit 8e91eb3

Please sign in to comment.