From 5b941c5b7c48ce1bef0481baa04dfb6d5f85955b Mon Sep 17 00:00:00 2001 From: Szabolcs Deme Date: Wed, 4 Jan 2023 15:30:29 +0100 Subject: [PATCH 1/2] Simplifying (and potentially fixing) TestMediaOperationsAsync method --- .../BasicOrchardFeaturesTestingUITestContextExtensions.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs index 4a029917f..d7e27e58b 100644 --- a/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs @@ -591,11 +591,7 @@ await context await deleteFolderButton.ClickReliablyAsync(context); await context.ClickModalOkAsync(); - var folders = context.GetAll(By.CssSelector("#folder-tree ol li .folder-name")); - foreach (var folder in folders) - { - folder.Text.ShouldNotBe("Example Folder"); - } + context.Missing(By.CssSelector("#folder-tree ol li .folder-name [text='Example Folder']")); }); /// From 6fdb1aeb11d4c724f0dc7190363c9691e60cea70 Mon Sep 17 00:00:00 2001 From: Szabolcs Deme Date: Wed, 4 Jan 2023 16:33:11 +0100 Subject: [PATCH 2/2] Simplifying more --- .../BasicOrchardFeaturesTestingUITestContextExtensions.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs index d7e27e58b..903c7184b 100644 --- a/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs @@ -580,18 +580,14 @@ await context await context.ClickModalOkAsync(); - var fileNames = context.GetAll(By.CssSelector("#mediaContainerMain tbody tr .break-word")); - foreach (var fileName in fileNames) - { - fileName.Text.ShouldNotBe(imageName); - } + 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.Missing(By.CssSelector("#folder-tree ol li .folder-name [text='Example Folder']")); + context.Missing(By.XPath("//div[text()='Example Folder' and @class='folder-name ms-2']")); }); ///