diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index f44f8d96..821e2a6a 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -41,7 +41,7 @@ jobs: PullRequestParam: ${{ github.event_name == 'pull_request' && format('/d:sonar.pullrequest.key={0}', github.event.number) || '' }} DISPLAY: :99 # Change selected factory to VerboseChrome to debug Chrome-related issues - WebDriverFactory__SelectedConfiguration: DefaultChrome + WebDriverFactory__SelectedConfiguration: VerboseChrome steps: - name: Checkout diff --git a/Tests/CSF.Screenplay.Selenium.Tests/CiChromeOptionsCustomizer.cs b/Tests/CSF.Screenplay.Selenium.Tests/CiChromeOptionsCustomizer.cs new file mode 100644 index 00000000..4759cd36 --- /dev/null +++ b/Tests/CSF.Screenplay.Selenium.Tests/CiChromeOptionsCustomizer.cs @@ -0,0 +1,12 @@ +using CSF.Extensions.WebDriver.Factories; +using OpenQA.Selenium.Chrome; + +namespace CSF.Screenplay.Selenium; + +public class CiChromeOptionsCustomizer : ICustomizesOptions +{ + public void CustomizeOptions(ChromeOptions options) + { + options.AddArguments("--disable-dev-shm-usage", "--headless", "--no-sandbox", "--window-size=1280,1024"); + } +} \ No newline at end of file diff --git a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json index 05665cd4..09804c0a 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json +++ b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json @@ -8,6 +8,10 @@ "DriverType": "ChromeDriver", "DriverFactoryType": "CSF.Screenplay.Selenium.VerboseChromeDriverFactory, CSF.Screenplay.Selenium.Tests" }, + "CiHeadlessChrome": { + "DriverType": "ChromeDriver", + "OptionsCustomizerType ": "CSF.Screenplay.Selenium.CiChromeOptionsCustomizer, CSF.Screenplay.Selenium.Tests" + }, "BrowserStack": { "DriverType": "RemoteWebDriver", "DriverFactoryType": "CSF.Screenplay.Selenium.BrowserStack.BrowserStackDriverFactory, CSF.Screenplay.Selenium.Tests"