-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
OSOE-146: Flow 'Additional Styling Part' flyout not activating
- Loading branch information
Showing
57 changed files
with
277 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ wwwroot/ | |
node_modules/ | ||
*.user | ||
.pnpm-debug.log | ||
.editorconfig |
6 changes: 6 additions & 0 deletions
6
Lombiq.HelpfulExtensions.Tests.UI/Constants/TextInputValues.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Lombiq.HelpfulExtensions.Tests.UI.Constants; | ||
|
||
public static class TextInputValues | ||
{ | ||
public const string TestClass = "test-class"; | ||
} |
10 changes: 10 additions & 0 deletions
10
Lombiq.HelpfulExtensions.Tests.UI/Constants/WidgetTypes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Lombiq.HelpfulExtensions.Tests.UI.Constants; | ||
|
||
public static class WidgetTypes | ||
{ | ||
public const string Container = nameof(Container); | ||
public const string Html = nameof(Html); | ||
public const string Liquid = nameof(Liquid); | ||
public const string Menu = nameof(Menu); | ||
public const string Markdown = nameof(Markdown); | ||
} |
18 changes: 18 additions & 0 deletions
18
Lombiq.HelpfulExtensions.Tests.UI/Constants/XPathSelectors.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Lombiq.HelpfulExtensions.Tests.UI.Constants; | ||
|
||
public static class XPathSelectors | ||
{ | ||
public const string AddWidgetButtonGroup = "//div[contains(@class, 'btn-widget-add-below-wrapper')]" | ||
+ "//div[contains(@class, 'btn-group')]"; | ||
public const string AddWidgetButton = $"{AddWidgetButtonGroup}/button[@title='Add Widget']"; | ||
public const string WidgetList = $"{AddWidgetButtonGroup}/div[contains(@class, 'dropdown-menu')]"; | ||
public const string WidgetEditorHeader = "//div[contains(@class, 'widget-template')]" | ||
+ "/div[contains(@class, 'widget-editor')]" | ||
+ "/div[contains(@class, 'widget-editor-header')]"; | ||
public const string WidgetEditorHeaderText = $"{WidgetEditorHeader}/span[contains(@class, 'widget-editor-header-text')]"; | ||
public const string FlowSettingsButtonGroup = $"{WidgetEditorHeader}/div[contains(@class, 'btn-widget-metadata')]" | ||
+ "/div[contains(@class, 'btn-group')]/div[contains(@class, 'btn-group')]"; | ||
public const string FlowSettingsButton = $"{FlowSettingsButtonGroup}/button[@title='Settings']"; | ||
public const string FlowSettingsDropdown = $"{FlowSettingsButtonGroup}/div[contains(@class, 'dropdown-menu')]"; | ||
public const string CustomClassesInput = "id('FlowPart-0_ContentItem_CustomClasses')"; | ||
} |
100 changes: 100 additions & 0 deletions
100
Lombiq.HelpfulExtensions.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using Atata; | ||
using Lombiq.HelpfulExtensions.Tests.UI.Constants; | ||
using Lombiq.Tests.UI.Extensions; | ||
using Lombiq.Tests.UI.Services; | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.Interactions; | ||
using Shouldly; | ||
using System.Threading.Tasks; | ||
using static Lombiq.HelpfulExtensions.Tests.UI.Constants.TextInputValues; | ||
using static Lombiq.HelpfulExtensions.Tests.UI.Constants.XPathSelectors; | ||
|
||
namespace Lombiq.HelpfulExtensions.Tests.UI.Extensions; | ||
|
||
public static class TestCaseUITestContextExtensions | ||
{ | ||
public static async Task TestFeatureWidgetsAsync(this UITestContext context) | ||
{ | ||
await context.SignInDirectlyAsync(); | ||
await context.EnableFeatureDirectlyAsync(FeatureIds.ContentTypes); | ||
await context.EnableFeatureDirectlyAsync(FeatureIds.Widgets); | ||
|
||
var widgets = new[] | ||
{ | ||
WidgetTypes.Container, | ||
WidgetTypes.Html, | ||
WidgetTypes.Liquid, | ||
WidgetTypes.Markdown, | ||
WidgetTypes.Menu, | ||
}; | ||
|
||
foreach (var widget in widgets) | ||
{ | ||
await context.TestWidgetAsync(widget); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// <see href="https://github.com/Lombiq/Helpful-Extensions/issues/76"> | ||
/// Flow 'Additional Styling Part' flyout not activating | ||
/// </see>. | ||
/// </summary> | ||
public static async Task TestFlowAdditionalStylingPartAsync(this UITestContext context) | ||
{ | ||
await context.SignInDirectlyAsync(); | ||
await context.EnableFeatureDirectlyAsync(FeatureIds.Flows); | ||
await context.EnableFeatureDirectlyAsync(FeatureIds.ContentTypes); | ||
await context.EnableFeatureDirectlyAsync(FeatureIds.Widgets); | ||
|
||
await context.GoToCreatePageAsync(); | ||
|
||
// Adding 'Html' to flow. | ||
context.AddWidgetToPageFlow(WidgetTypes.Html); | ||
|
||
// To show toolbar. | ||
new Actions(context.Driver) | ||
.MoveToElement(context.Get(By.XPath(WidgetEditorHeader))) | ||
.Build() | ||
.Perform(); | ||
|
||
var flowSettingsButtonSelector = By.XPath(FlowSettingsButton); | ||
|
||
// Check that the settings button exists and is visible. | ||
context.Exists(flowSettingsButtonSelector); | ||
|
||
// To show 'AdditionalStylingPart' view. | ||
new Actions(context.Driver) | ||
.Click(context.Get(flowSettingsButtonSelector)) | ||
.Build() | ||
.Perform(); | ||
|
||
// Check that the 'AdditionalStylingPart' view exists and is visible. | ||
context.Exists(By.XPath(FlowSettingsDropdown)); | ||
|
||
// Check CustomClasses input. | ||
var customClassesInputSelector = By.XPath(CustomClassesInput); | ||
context.Get(customClassesInputSelector) | ||
.SendKeys(TestClass); | ||
|
||
context.Get(customClassesInputSelector) | ||
.GetValue() | ||
.ShouldBe(TestClass); | ||
} | ||
|
||
private static async Task TestWidgetAsync(this UITestContext context, string widget) | ||
{ | ||
await context.GoToCreatePageAsync(); | ||
context.AddWidgetToPageFlow(widget); | ||
|
||
context.Get(By.XPath(WidgetEditorHeaderText)) | ||
.GetAttribute("data-content-type-display-text") | ||
.ShouldBe($"{widget} Widget"); | ||
} | ||
|
||
private static void AddWidgetToPageFlow(this UITestContext context, string widget) => | ||
new Actions(context.Driver) | ||
.Click(context.Get(By.XPath(AddWidgetButton))) | ||
.Click(context.Get(By.XPath($"{WidgetList}/a[text()='{widget} Widget']").OfAnyVisibility())) | ||
.Build() | ||
.Perform(); | ||
} |
11 changes: 11 additions & 0 deletions
11
Lombiq.HelpfulExtensions.Tests.UI/Extensions/UITestContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Lombiq.Tests.UI.Extensions; | ||
using Lombiq.Tests.UI.Services; | ||
using System.Threading.Tasks; | ||
|
||
namespace Lombiq.HelpfulExtensions.Tests.UI.Extensions; | ||
|
||
public static class UITestContextExtensions | ||
{ | ||
public static Task GoToCreatePageAsync(this UITestContext context) => | ||
context.CreateNewContentItemAsync("Page", onlyIfNotAlreadyThere: false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Copyright © 2013, [Lombiq Technologies Ltd.](https://lombiq.com) | ||
|
||
All rights reserved. | ||
|
||
For more information and requests about licensing please [contact us through our website](https://lombiq.com/contact-us). | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
48 changes: 48 additions & 0 deletions
48
Lombiq.HelpfulExtensions.Tests.UI/Lombiq.HelpfulExtensions.Tests.UI.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> | ||
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Title>Lombiq Helpful Extensions for Orchard Core - UI Test Extensions</Title> | ||
<Authors>Lombiq Technologies</Authors> | ||
<Copyright>Copyright © 2013, Lombiq Technologies Ltd.</Copyright> | ||
<Description>Lombiq Helpful Extensions for Orchard Core - UI Test Extensions: Extension methods that test various features in Lombiq Helpful Extensions for Orchard Core.</Description> | ||
<PackageIcon>NuGetIcon.png</PackageIcon> | ||
<PackageTags>OrchardCore;Lombiq;AspNetCore;CodeGeneration;ShapeTracing;Widgets</PackageTags> | ||
<RepositoryUrl>https://github.com/Lombiq/Helpful-Extensions</RepositoryUrl> | ||
<PackageProjectUrl>https://github.com/Lombiq/Helpful-Extensions/Lombiq.HelpfulExtensions.Tests.UI/Readme.md</PackageProjectUrl> | ||
<PackageLicenseFile>License.md</PackageLicenseFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="License.md" Pack="true" PackagePath="" /> | ||
<None Include="Readme.md" /> | ||
<None Include="NuGetIcon.png" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="node_modules\**" /> | ||
<None Remove="Tests\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Lombiq.HelpfulExtensions\Lombiq.HelpfulExtensions.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' != 'true'"> | ||
<ProjectReference Include="..\..\..\..\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Lombiq.Tests.UI.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' == 'true'"> | ||
<PackageReference Include="Lombiq.Tests.UI" Version="3.3.1-alpha.osoe-146.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Lombiq Helpful Extensions for Orchard Core - UI Test Extensions | ||
|
||
## About | ||
|
||
Extension methods that test various features in Lombiq Helpful Extensions for Orchard Core. | ||
|
||
Call these from a UI test project to verify the module's basic features; as seen in [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions). | ||
|
||
|
||
## Contributing and support | ||
|
||
Bug reports, feature requests, comments, questions, code contributions, and love letters are warmly welcome, please do so via GitHub issues and pull requests. Please adhere to our [open-source guidelines](https://lombiq.com/open-source-guidelines) while doing so. | ||
|
||
This project is developed by [Lombiq Technologies](https://lombiq.com/). Commercial-grade support is available through Lombiq. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32319.34 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.HelpfulExtensions", "Lombiq.HelpfulExtensions\Lombiq.HelpfulExtensions.csproj", "{207243C1-5934-4D94-AAF2-F46D4DB2F20F}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.HelpfulExtensions.Tests.UI", "Lombiq.HelpfulExtensions.Tests.UI\Lombiq.HelpfulExtensions.Tests.UI.csproj", "{B1077AC7-10D3-451C-B467-DA0B4D7BD5A4}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{207243C1-5934-4D94-AAF2-F46D4DB2F20F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{207243C1-5934-4D94-AAF2-F46D4DB2F20F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{207243C1-5934-4D94-AAF2-F46D4DB2F20F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{207243C1-5934-4D94-AAF2-F46D4DB2F20F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B1077AC7-10D3-451C-B467-DA0B4D7BD5A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B1077AC7-10D3-451C-B467-DA0B4D7BD5A4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B1077AC7-10D3-451C-B467-DA0B4D7BD5A4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B1077AC7-10D3-451C-B467-DA0B4D7BD5A4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5F8B26CF-89E9-487E-B4B0-643F1A109459} | ||
EndGlobalSection | ||
EndGlobal |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Copyright © 2013, [Lombiq Technologies Ltd.](https://lombiq.com) | ||
|
||
All rights reserved. | ||
|
||
For more information and requests about licensing please [contact us through our website](https://lombiq.com/contact-us). | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
Views/AdditionalStylingPart.Edit.cshtml → ...s/Views/AdditionalStylingPart.Edit.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters