diff --git a/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/BasicFeaturesTestingUITestContextExtensions.cs b/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/BasicFeaturesTestingUITestContextExtensions.cs index 116276cd6..c3592fb85 100644 --- a/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/BasicFeaturesTestingUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/BasicFeaturesTestingUITestContextExtensions.cs @@ -60,7 +60,7 @@ public static async Task TestBasicOrchardFeaturesAsync( Func customPageHeaderCheckAsync = null) { await context.TestSetupWithInvalidAndValidDataAsync(setupParameters); - await context.TestBasicOrchardFeaturesExceptSetupAsync(customPageHeaderCheckAsync); + await context.TestBasicOrchardFeaturesExceptSetupAsync(customPageHeaderCheckAsync: customPageHeaderCheckAsync); } /// @@ -128,9 +128,11 @@ public static async Task TestBasicOrchardFeaturesExceptRegistrationAsync( /// The custom page header check logic to locate and/or check the header's text. This ultimately gets passed to /// TestContentOperationsAsync(). /// + /// Boolean to decide whether to check content on frontend.> /// The same instance. public static async Task TestBasicOrchardFeaturesExceptSetupAsync( this UITestContext context, + bool dontCheckFrontend, Func customPageHeaderCheckAsync = null) { await context.TestRegistrationWithInvalidDataAsync(); @@ -138,7 +140,7 @@ public static async Task TestBasicOrchardFeaturesExceptSetupAsync( await context.TestRegistrationWithAlreadyRegisteredEmailAsync(); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); - await context.TestContentOperationsAsync(customPageHeaderCheckAsync: customPageHeaderCheckAsync); + await context.TestContentOperationsAsync(dontCheckFrontend: dontCheckFrontend, customPageHeaderCheckAsync: customPageHeaderCheckAsync); await context.TestTurningFeatureOnAndOffAsync(); await context.TestMediaOperationsAsync(); await context.TestAuditTrailAsync(); @@ -146,6 +148,20 @@ public static async Task TestBasicOrchardFeaturesExceptSetupAsync( await context.TestLogoutAsync(); } + /// + /// Tests all the basic Orchard features except for setup. + /// The test method assumes that the site is set up. + /// + /// + /// The custom page header check logic to locate and/or check the header's text. This ultimately gets passed to + /// TestContentOperationsAsync(). + /// + /// The same instance. + public static Task TestBasicOrchardFeaturesExceptSetupAsync( + this UITestContext context, + Func customPageHeaderCheckAsync = null) => + context.TestBasicOrchardFeaturesExceptSetupAsync(dontCheckFrontend: false, customPageHeaderCheckAsync: customPageHeaderCheckAsync); + /// /// Tests all the basic Orchard features except for setup and registration. /// The test method assumes that the site is set up. @@ -170,6 +186,7 @@ public static async Task TestBasicOrchardFeaturesExceptSetupAndRegistrationAsync await context.TestLoginAsync(); await context.TestContentOperationsAsync(dontCheckFrontend, customPageHeaderCheckAsync: customPageHeaderCheckAsync); await context.TestTurningFeatureOnAndOffAsync(); + await context.TestMediaOperationsAsync(); await context.TestAuditTrailAsync(); await context.TestWorkflowsAsync(); await context.TestLogoutAsync(); diff --git a/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/MediaOperationsTestingUITestContextExtensions.cs b/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/MediaOperationsTestingUITestContextExtensions.cs index 45fc0eff3..40e6c9256 100644 --- a/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/MediaOperationsTestingUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/BasicOrchardFeaturesTesting/MediaOperationsTestingUITestContextExtensions.cs @@ -98,7 +98,7 @@ await context context.WaitForPageLoad(); await context.GoToAdminRelativeUrlAsync(mediaPath); - context.Missing(By.XPath("//span[text()=' Image.png ' and @class='break-word']")); + context.Missing(By.XPath($"//span[text()=' {imageName} ' and @class='break-word']")); var deleteFolderButton = context.Get(By.CssSelector("#folder-tree li.selected div.btn-group.folder-actions .svg-inline--fa.fa-trash")); diff --git a/Lombiq.Tests.UI/Helpers/FileUploadHelper.cs b/Lombiq.Tests.UI/Helpers/FileUploadHelper.cs index 0f4abe1e8..ab7930c72 100644 --- a/Lombiq.Tests.UI/Helpers/FileUploadHelper.cs +++ b/Lombiq.Tests.UI/Helpers/FileUploadHelper.cs @@ -7,10 +7,10 @@ public static class FileUploadHelper { private static readonly string BasePath = Path.Combine(Environment.CurrentDirectory, "SampleUploadFiles"); - public static readonly string SamplePdfFileName = "Document.pdf"; - public static readonly string SamplePngFileName = "Image.png"; - public static readonly string SampleDocxFileName = "UploadingTestFileDOCX.docx"; - public static readonly string SampleXlsxFileName = "UploadingTestFileXLSX.xlsx"; + public static readonly string SamplePdfFileName = "document.pdf"; + public static readonly string SamplePngFileName = "image.png"; + public static readonly string SampleDocxFileName = "uploadingtestfiledocx.docx"; // #spell-check-ignore-line + public static readonly string SampleXlsxFileName = "uploadingtestfilexlsx.xlsx"; // #spell-check-ignore-line public static readonly string SamplePdfPath = Path.Combine(BasePath, SamplePdfFileName); public static readonly string SamplePngPath = Path.Combine(BasePath, SamplePngFileName); diff --git a/Lombiq.Tests.UI/SampleUploadFiles/Document.pdf b/Lombiq.Tests.UI/SampleUploadFiles/document.pdf similarity index 100% rename from Lombiq.Tests.UI/SampleUploadFiles/Document.pdf rename to Lombiq.Tests.UI/SampleUploadFiles/document.pdf diff --git a/Lombiq.Tests.UI/SampleUploadFiles/Image.png b/Lombiq.Tests.UI/SampleUploadFiles/image.png similarity index 100% rename from Lombiq.Tests.UI/SampleUploadFiles/Image.png rename to Lombiq.Tests.UI/SampleUploadFiles/image.png diff --git a/Lombiq.Tests.UI/SampleUploadFiles/UploadingTestFileDOCX.docx b/Lombiq.Tests.UI/SampleUploadFiles/uploadingtestfiledocx.docx similarity index 100% rename from Lombiq.Tests.UI/SampleUploadFiles/UploadingTestFileDOCX.docx rename to Lombiq.Tests.UI/SampleUploadFiles/uploadingtestfiledocx.docx diff --git a/Lombiq.Tests.UI/SampleUploadFiles/UploadingTestFileXLSX.xlsx b/Lombiq.Tests.UI/SampleUploadFiles/uploadingtestfilexlsx.xlsx similarity index 100% rename from Lombiq.Tests.UI/SampleUploadFiles/UploadingTestFileXLSX.xlsx rename to Lombiq.Tests.UI/SampleUploadFiles/uploadingtestfilexlsx.xlsx