Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEST-435: Fix flaky UI tests #275

Merged
merged 5 commits into from
May 10, 2023
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
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