[Templating] Enforce selenium tests runs on the expected platforms (#11602)
* Will cause the CI environment to fail if the E2E tests stop running by accident.
This commit is contained in:
parent
60a8f2348e
commit
635da5b73a
|
|
@ -56,6 +56,10 @@ namespace Templates.Test
|
|||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation();
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
using (var aspNetProcess = Project.StartPublishedProjectAsync())
|
||||
|
|
@ -70,6 +74,10 @@ namespace Templates.Test
|
|||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation();
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,8 +114,13 @@ namespace Templates.Test
|
|||
aspNetProcess.VisitInBrowser(Browser);
|
||||
TestBasicNavigation();
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
using (var aspNetProcess = Project.StartPublishedProjectAsync())
|
||||
{
|
||||
Assert.False(
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ namespace Templates.Test.SpaTemplateTest
|
|||
aspNetProcess.VisitInBrowser(browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
|
||||
if (usesAuth)
|
||||
|
|
@ -135,6 +139,10 @@ namespace Templates.Test.SpaTemplateTest
|
|||
aspNetProcess.VisitInBrowser(browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
|
||||
}
|
||||
else
|
||||
{
|
||||
BrowserFixture.EnforceSupportedConfigurations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Collections.Concurrent;
|
|||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
|
|
@ -28,6 +29,14 @@ namespace Microsoft.AspNetCore.E2ETesting
|
|||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue