From 3c6e16abaf5986f53930ea52f655de6fbb3ba3a9 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Thu, 19 Mar 2026 13:08:53 +0000 Subject: [PATCH 1/2] WIP #331 - Add some suggested options This is intended to prevent Chrome from failing to start on CI builds. I'm fine when running interactively, so I'm not changing the default config, rather introducing a new one. --- .github/workflows/dotnetCi.yml | 2 +- .../CiChromeOptionsCustomizer.cs | 12 ++++++++++++ Tests/CSF.Screenplay.Selenium.Tests/appsettings.json | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Tests/CSF.Screenplay.Selenium.Tests/CiChromeOptionsCustomizer.cs diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index f44f8d96..cfeb6f5a 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: CiHeadlessChrome 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" From e69211c56f04fefcb73d9cf6f476261ddba7651c Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Fri, 20 Mar 2026 20:07:41 +0000 Subject: [PATCH 2/2] Switch on verbose logging for #331 --- .github/workflows/dotnetCi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index cfeb6f5a..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: CiHeadlessChrome + WebDriverFactory__SelectedConfiguration: VerboseChrome steps: - name: Checkout