Skip to content

Enforce selenium tests run on the expected platforms #11602

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

Merged
merged 1 commit into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions src/ProjectTemplates/test/RazorComponentsTemplateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public async Task RazorComponentsTemplateWorks_NoAuth()
aspNetProcess.VisitInBrowser(Browser);
TestBasicNavigation();
}
else
{
BrowserFixture.EnforceSupportedConfigurations();
}
}

using (var aspNetProcess = Project.StartPublishedProjectAsync())
Expand All @@ -70,6 +74,10 @@ public async Task RazorComponentsTemplateWorks_NoAuth()
aspNetProcess.VisitInBrowser(Browser);
TestBasicNavigation();
}
else
{
BrowserFixture.EnforceSupportedConfigurations();
}
}
}

Expand Down Expand Up @@ -106,8 +114,13 @@ public async Task RazorComponentsTemplateWorks_IndividualAuth(bool useLocalDB)
aspNetProcess.VisitInBrowser(Browser);
TestBasicNavigation();
}
else
{
BrowserFixture.EnforceSupportedConfigurations();
}
}


using (var aspNetProcess = Project.StartPublishedProjectAsync())
{
Assert.False(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ protected async Task SpaTemplateImplAsync(
aspNetProcess.VisitInBrowser(browser);
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
}
else
{
BrowserFixture.EnforceSupportedConfigurations();
}
}

if (usesAuth)
Expand All @@ -135,6 +139,10 @@ protected async Task SpaTemplateImplAsync(
aspNetProcess.VisitInBrowser(browser);
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
}
else
{
BrowserFixture.EnforceSupportedConfigurations();
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/Shared/E2ETesting/BrowserFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
Expand All @@ -27,6 +28,14 @@ public BrowserFixture(IMessageSink diagnosticsMessageSink)

public IMessageSink DiagnosticsMessageSink { get; }

public static void EnforceSupportedConfigurations()
{
// Do not change the current platform support without explicit approval.
Assert.False(
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && RuntimeInformation.ProcessArchitecture == Architecture.X64,
"Selenium tests should be running in this platform.");
}

public static bool IsHostAutomationSupported()
{
// We emit an assemblymetadata attribute that reflects the value of SeleniumE2ETestsSupported at build
Expand Down