-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
140 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# WARNING: Only edit this file in the Lombiq .NET Analyzers repository's "Lombiq.Analyzers" folder. A copy of this file | ||
# anywhere else will be overwritten. | ||
|
||
# All files | ||
[*] | ||
|
||
# Basics | ||
charset = utf-8 | ||
guidelines = 120 1px solid a0ffc000, 150 1px solid 80ff0000 | ||
|
||
# Indentation and spacing | ||
indent_size = 4 | ||
indent_style = space | ||
trim_trailing_whitespace = true | ||
|
||
# New line preferences | ||
end_of_line = crlf | ||
insert_final_newline = true | ||
tab_width = 4 | ||
|
||
# Various config files | ||
[*.{config,csproj,json,props,targets}] | ||
|
||
indent_size = 2 | ||
|
||
# Markdown files | ||
[*.md] | ||
|
||
trim_trailing_whitespace = false | ||
|
||
# JavaScript files | ||
[*.js] | ||
|
||
# Placeholder, no unique rules for JS files at the moment. | ||
|
||
|
||
# SCSS files | ||
[*.scss] | ||
|
||
# Placeholder, no unique rules for SCSS files at the moment. | ||
|
||
# PowerShell files | ||
[*.ps1] | ||
|
||
# Placeholder, no unique rules for PS files at the moment. |
37 changes: 37 additions & 0 deletions
37
...iq.Hosting.MediaTheme.Bridge.Tests.UI/Extensions/TestCaseUIBridgeTestContextExtensions.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,37 @@ | ||
using Lombiq.Hosting.MediaTheme.Bridge.Constants; | ||
using Lombiq.Hosting.MediaTheme.Tests.UI.Extensions; | ||
using Lombiq.Tests.UI.Extensions; | ||
using Lombiq.Tests.UI.Services; | ||
using OrchardCore.Media; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Lombiq.Hosting.MediaTheme.Bridge.Tests.UI.Extensions; | ||
|
||
public static class TestCaseUIBridgeTestContextExtensions | ||
{ | ||
[SuppressMessage( | ||
"Security", | ||
"CA5400:HttpClient may be created without enabling CheckCertificateRevocationList", | ||
Justification = "It's only disabled for local testing.")] | ||
public static async Task TestMediaThemeTemplatePageAsync(this UITestContext context, string tenantPrefix = null) | ||
{ | ||
await context.ExecuteMediaThemeSampleRecipeDirectlyAsync(); | ||
await context.GoToMediaThemeTestContentPageAsync(); | ||
var mediaOptions = await context.GetTenantOptionsAsync<MediaOptions>(); | ||
|
||
// Instead of going to the page directly (which will fail) we'll check the response status code directly. | ||
var templatesPageUri = context.GetAbsoluteUri( | ||
$"{mediaOptions.Value.AssetsRequestPath}/{Paths.MediaThemeTemplatesWebPath}/Example.liquid"); | ||
using var handler = new HttpClientHandler(); | ||
handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; | ||
using var client = new HttpClient(handler); | ||
|
||
var response = await client.GetAsync(templatesPageUri); | ||
|
||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); | ||
} | ||
} |
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,13 @@ | ||
Copyright © 2022, [Lombiq Technologies Ltd.](https://lombiq.com) | ||
|
||
All rights reserved. | ||
|
||
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. |
39 changes: 39 additions & 0 deletions
39
Lombiq.Hosting.MediaTheme.Bridge.Tests.UI/Lombiq.Hosting.MediaTheme.Bridge.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,39 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Title>Lombiq Hosting - Media Theme for Orchard Core - UI Bridge Test Extensions</Title> | ||
<Authors>Lombiq Technologies</Authors> | ||
<Copyright>Copyright © 2022, Lombiq Technologies Ltd.</Copyright> | ||
<Description>Lombiq Hosting - Media Theme for Orchard Core - UI Bridge Test Extensions: Extensions to aid in UI bridge testing Lombiq Hosting - Media Theme for Orchard Core. See the project website for detailed documentation.</Description> | ||
<PackageIcon>NuGetIcon.png</PackageIcon> | ||
<PackageTags>OrchardCore;Lombiq;AspNetCore;Media;Theme</PackageTags> | ||
<RepositoryUrl>https://github.com/Lombiq/Hosting-Media-Theme</RepositoryUrl> | ||
<PackageProjectUrl>https://github.com/Lombiq/Hosting-Media-Theme/blob/dev/Readme.md</PackageProjectUrl> | ||
<PackageLicenseFile>License.md</PackageLicenseFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="node_modules\**" /> | ||
<None Include="License.md" Pack="true" PackagePath="" /> | ||
<None Include="NuGetIcon.png" Pack="true" PackagePath="" /> | ||
</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="9.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Lombiq.Hosting.MediaTheme.Bridge\Lombiq.Hosting.MediaTheme.Bridge.csproj" /> | ||
<ProjectReference Include="..\Lombiq.Hosting.MediaTheme.Tests.UI\Lombiq.Hosting.MediaTheme.Tests.UI.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions
28
Lombiq.Hosting.MediaTheme.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
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