diff --git a/Test/UITest/SpecFlowProjectBDD/Hooks/SeleniumSpecFlowHooks.cs b/Test/UITest/SpecFlowProjectBDD/Hooks/SeleniumSpecFlowHooks.cs index 77e6db46..4ec160fc 100644 --- a/Test/UITest/SpecFlowProjectBDD/Hooks/SeleniumSpecFlowHooks.cs +++ b/Test/UITest/SpecFlowProjectBDD/Hooks/SeleniumSpecFlowHooks.cs @@ -24,7 +24,7 @@ public SeleniumSpecFlowHooks(IObjectContainer container) public void SetupDrivers() { CleanupDrivers(); - SeleniumDriver webDriver = new SeleniumDriver(SeleniumDriver.DRIVERTYPE.CHROME); + SeleniumDriver webDriver = new SeleniumDriver(SeleniumDriver.DRIVERTYPE.CHROME, Headless:true); webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); _Container.RegisterInstanceAs(webDriver); diff --git a/Test/UITest/SpecFlowProjectBDD/SpecFlowProjectBDD.csproj b/Test/UITest/SpecFlowProjectBDD/SpecFlowProjectBDD.csproj index 9b0be6f3..408d33f6 100644 --- a/Test/UITest/SpecFlowProjectBDD/SpecFlowProjectBDD.csproj +++ b/Test/UITest/SpecFlowProjectBDD/SpecFlowProjectBDD.csproj @@ -42,6 +42,7 @@ + diff --git a/Test/UITest/TestFrameWork/TestDriver/SeleniumDriver.cs b/Test/UITest/TestFrameWork/TestDriver/SeleniumDriver.cs index edf6b2a2..41df24b8 100644 --- a/Test/UITest/TestFrameWork/TestDriver/SeleniumDriver.cs +++ b/Test/UITest/TestFrameWork/TestDriver/SeleniumDriver.cs @@ -36,7 +36,13 @@ public string Url public ReadOnlyCollection WindowHandles { get => Driver.WindowHandles; } - public SeleniumDriver(DRIVERTYPE DriverType) + /// + /// Create a Selenium webdriver for Chrome, Edge, or Firefox. + /// Requires that Nuget driver packages for the correct browser be installed in the solution/projects + /// + /// + /// Enable for headless CICD pipekine operation + public SeleniumDriver(DRIVERTYPE DriverType, bool Headless = false) { var assembly = System.Reflection.Assembly.GetExecutingAssembly(); var assemblyDirectory = assembly.Location.Replace(assembly.ManifestModule.Name.ToString(), string.Empty); @@ -50,14 +56,22 @@ public SeleniumDriver(DRIVERTYPE DriverType) options.AddArgument("--ignore-ssl-errors=yes"); options.AddArgument("--ignore-certificate-errors"); options.AddArgument("--start-maximized"); - //options.AddArgument("--headless"); + if(Headless) + options.AddArgument("--headless"); Driver = new ChromeDriver(assemblyDirectory, options); break; } case DRIVERTYPE.EDGE: { - Driver = new EdgeDriver(); + var options = new EdgeOptions(); + options.SetLoggingPreference(LogType.Driver, LogLevel.All); + options.AddArgument("--ignore-ssl-errors=yes"); + options.AddArgument("--ignore-certificate-errors"); + options.AddArgument("--start-maximized"); + if (Headless) + options.AddArgument("--headless"); + Driver = new EdgeDriver(assemblyDirectory, options); break; } case DRIVERTYPE.FIREFOX: diff --git a/Test/UITest/TestFrameWork/TestFrameWork.csproj b/Test/UITest/TestFrameWork/TestFrameWork.csproj index 43f51b94..91d0707d 100644 --- a/Test/UITest/TestFrameWork/TestFrameWork.csproj +++ b/Test/UITest/TestFrameWork/TestFrameWork.csproj @@ -10,6 +10,7 @@ +