From fa8de5d03d8936614072fd91ca71abef397a0720 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 17:56:09 +0000 Subject: [PATCH 01/17] WIP #267 - Fail build if missing and add analysis code --- .github/workflows/dotnetCi.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 947f768e..96b137ef 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -130,6 +130,15 @@ jobs: echo "failures=true" >> $GITHUB_OUTPUT fi cd ../.. + - name: Fail the build if no JS coverage info + run: | + if ! [ -f CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/lcov.info ] + then + echo "Failing the build because there's no coverage for JS tests" + echo "Here's the contents of the test results directory, to assist in analysis" + find CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults + exit 1 + fi # Post-test tasks (artifacts, overall status) From df8f61add6cc60fd5927cb184557d06542e71e24 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 19:13:34 +0000 Subject: [PATCH 02/17] Switch to Ubuntu LTS for CI Turns out that the `ubuntu-slim` runner has a hardcoded limit of 15 mins per job. --- .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 96b137ef..6936676c 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -23,7 +23,7 @@ jobs: build_test_and_pack: name: Build, test & package - runs-on: ubuntu-slim + runs-on: ubuntu-24.04 timeout-minutes: 30 env: From b0db314658f5be7c1e3c71288fa25a7ad097efb6 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 19:35:42 +0000 Subject: [PATCH 03/17] WIP #267 - Make Jest test results an artifact --- .github/workflows/dotnetCi.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 6936676c..f4b8cbf1 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -130,15 +130,6 @@ jobs: echo "failures=true" >> $GITHUB_OUTPUT fi cd ../.. - - name: Fail the build if no JS coverage info - run: | - if ! [ -f CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/lcov.info ] - then - echo "Failing the build because there's no coverage for JS tests" - echo "Here's the contents of the test results directory, to assist in analysis" - find CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults - exit 1 - fi # Post-test tasks (artifacts, overall status) @@ -148,11 +139,16 @@ jobs: - name: Gracefully stop Xvfb run: killall Xvfb continue-on-error: true - - name: Upload test results artifacts + - name: Upload .NET test results artifacts uses: actions/upload-artifact@v4 with: name: NUnit test results path: Tests/*.Tests/**/TestResults.xml + - name: Upload JS test results artifacts + uses: actions/upload-artifact@v4 + with: + name: Jest test results + path: CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/**/* - name: Upload Screenplay JSON report artifact uses: actions/upload-artifact@v4 with: From 060e8dfe7aaaa5263c14493f8d6da391fa5a216a Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 19:51:22 +0000 Subject: [PATCH 04/17] WIP #267 - Conditional failure Seems I had the syntax wrong. --- .github/workflows/dotnetCi.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index f4b8cbf1..94a94f6e 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -100,7 +100,7 @@ jobs: /d:sonar.host.url=${{ env.SonarCloudUrl }} /d:sonar.token=${{ env.SonarCloudSecretKey }} /d:${{ env.BranchParam }}=${{ env.BranchName }} ${{ env.PullRequestParam }} - /d:sonar.javascript.lcov.reportPaths=CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/lcov.info + /d:sonar.javascript.lcov.reportPaths=$PWD/CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/lcov.info /s:$PWD/.sonarqube-analysisproperties.xml - name: Build the solution run: dotnet build -c ${{ env.Configuration }} --no-incremental @@ -116,7 +116,7 @@ jobs: coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml" if [ $? -ne 0 ] then - echo "failures=true" >> $GITHUB_OUTPUT + echo "failures=true" >> "$GITHUB_OUTPUT" fi done - name: Run JavaScript tests with coverage @@ -127,7 +127,7 @@ jobs: npm test if [ $? -ne 0 ] then - echo "failures=true" >> $GITHUB_OUTPUT + echo "failures=true" >> "$GITHUB_OUTPUT" fi cd ../.. @@ -169,7 +169,7 @@ jobs: name: Screenplay HTML reports path: Tests/**/ScreenplayReport.html - name: Fail the build if any test failures - if: ${{ steps.dotnet_tests.outputs.failures == 'true' || steps.js_tests.outputs.failures == 'true' }} + if: steps.dotnet_tests.outputs.failures == 'true' || steps.js_tests.outputs.failures == 'true' run: | echo "Failing the build due to test failures" exit 1 From 09c22148c306e85f09d50d98cc019ecfe76808af Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 19:53:59 +0000 Subject: [PATCH 05/17] WIP #267 - Improve feedback --- .github/workflows/dotnetCi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 94a94f6e..6084e50b 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -116,6 +116,7 @@ jobs: coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml" if [ $? -ne 0 ] then + echo "One or more tests have failed; this build should eventually fail" echo "failures=true" >> "$GITHUB_OUTPUT" fi done @@ -127,6 +128,7 @@ jobs: npm test if [ $? -ne 0 ] then + echo "One or more tests have failed; this build should eventually fail" echo "failures=true" >> "$GITHUB_OUTPUT" fi cd ../.. From a7dcf54e623eb4188edca20a5ab456af9d6107d1 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:04:42 +0000 Subject: [PATCH 06/17] Migrate to Chrome setup action --- .github/workflows/dotnetCi.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 6084e50b..20129607 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -39,7 +39,6 @@ jobs: BranchName: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} BranchParam: ${{ github.event_name == 'pull_request' && 'sonar.pullrequest.branch' || 'sonar.branch.name' }} PullRequestParam: ${{ github.event_name == 'pull_request' && format('/d:sonar.pullrequest.key={0}', github.event.number) || '' }} - DISPLAY: :99 steps: - name: Checkout @@ -68,10 +67,8 @@ jobs: with: java-version: 21 distribution: 'zulu' - - name: Install GUI packages so Chrome may run - run: | - sudo apt-get update - sudo apt install -y xorg xvfb gtk2-engines-pixbuf dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable psmisc + - name: Install Google Chrome & dependencies + uses: browser-actions/setup-chrome@v2 # Environment setup pre-build @@ -79,8 +76,6 @@ jobs: run: | mkdir ~/.cache/selenium cp Tools/se-config.toml ~/.cache/selenium - - name: Start an Xvfb display so Chrome may run - run: Xvfb -ac $DISPLAY -screen 0 1280x1024x16 & - name: Restore .NET packages run: dotnet restore - name: Restore Node modules @@ -138,9 +133,6 @@ jobs: - name: Stop SonarScanner run: dotnet sonarscanner end /d:sonar.token=${{ env.SonarCloudSecretKey }} - - name: Gracefully stop Xvfb - run: killall Xvfb - continue-on-error: true - name: Upload .NET test results artifacts uses: actions/upload-artifact@v4 with: From 2805efcf6f4d753c77fc3a1e14432e16c1feb3d1 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:09:38 +0000 Subject: [PATCH 07/17] Attempt to improve error handling --- .github/workflows/dotnetCi.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 20129607..6f51564c 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -109,7 +109,8 @@ jobs: projName=${projNameArray[1]} assemblyPath=$proj/bin/$Configuration/$Tfm/$projName.dll coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml" - if [ $? -ne 0 ] + exitCode=$? + if [ $exitCode -ne 0 ] then echo "One or more tests have failed; this build should eventually fail" echo "failures=true" >> "$GITHUB_OUTPUT" @@ -121,9 +122,10 @@ jobs: run: | cd CSF.Screenplay.JsonToHtmlReport.Template/src npm test - if [ $? -ne 0 ] + exitCode=$? + if [ $exitCode -ne 0 ] then - echo "One or more tests have failed; this build should eventually fail" + echo "One or more tests have failed; this build should eventually fail" echo "failures=true" >> "$GITHUB_OUTPUT" fi cd ../.. From 9875ab3b5037b1a0cfb6970c103712128894b90b Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:14:49 +0000 Subject: [PATCH 08/17] Reinstate Xvfb --- .github/workflows/dotnetCi.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 6f51564c..d5429a5a 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -39,7 +39,8 @@ jobs: BranchName: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }} BranchParam: ${{ github.event_name == 'pull_request' && 'sonar.pullrequest.branch' || 'sonar.branch.name' }} PullRequestParam: ${{ github.event_name == 'pull_request' && format('/d:sonar.pullrequest.key={0}', github.event.number) || '' }} - + DISPLAY: :99 + steps: - name: Checkout uses: actions/checkout@v4 @@ -69,6 +70,8 @@ jobs: distribution: 'zulu' - name: Install Google Chrome & dependencies uses: browser-actions/setup-chrome@v2 + - name: Start an Xvfb display so Chrome may run + run: Xvfb -ac $DISPLAY -screen 0 1280x1024x16 & # Environment setup pre-build @@ -135,6 +138,9 @@ jobs: - name: Stop SonarScanner run: dotnet sonarscanner end /d:sonar.token=${{ env.SonarCloudSecretKey }} + - name: Gracefully stop Xvfb + run: killall Xvfb + continue-on-error: true - name: Upload .NET test results artifacts uses: actions/upload-artifact@v4 with: From 4a999db857c8cb50e7d91ecb391f3375e5455cb5 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:31:55 +0000 Subject: [PATCH 09/17] Custom shells for tests I found out that GitHub actions uses the fast-fail behaviour. So that means that it's not advancing past the first line of script that fails. So, all my failure handling logic is ineffective and not being executed. This should fix that by disabling fast-fail on these two steps. --- .github/workflows/dotnetCi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index d5429a5a..548f38f2 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -104,7 +104,7 @@ jobs: run: dotnet build -c ${{ env.Configuration }} --no-incremental - name: Run .NET tests with coverage id: dotnet_tests - continue-on-error: true + shell: bash {0} run: | for proj in Tests/*.Tests do @@ -121,7 +121,7 @@ jobs: done - name: Run JavaScript tests with coverage id: js_tests - continue-on-error: true + shell: bash {0} run: | cd CSF.Screenplay.JsonToHtmlReport.Template/src npm test From 21dbbb8d97cd54e25882e1a5b6bf421d18ef1703 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:39:23 +0000 Subject: [PATCH 10/17] Oh dear, it doesn't install dependencies by default I had assumed an action named "setup chrome" might actually do everything required to setup chrome by default. Apparently not :-/ --- .github/workflows/dotnetCi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 548f38f2..b805e654 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -70,6 +70,8 @@ jobs: distribution: 'zulu' - name: Install Google Chrome & dependencies uses: browser-actions/setup-chrome@v2 + with: + install-dependencies: true - name: Start an Xvfb display so Chrome may run run: Xvfb -ac $DISPLAY -screen 0 1280x1024x16 & From a26c88c37b0705eae3ef1440a70ee4d35d54e1c7 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 20:51:19 +0000 Subject: [PATCH 11/17] Attempt to fix Chrome usage --- .github/workflows/dotnetCi.yml | 4 ---- Tools/se-config.toml | 1 - 2 files changed, 5 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index b805e654..8ea9cf7b 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -68,10 +68,6 @@ jobs: with: java-version: 21 distribution: 'zulu' - - name: Install Google Chrome & dependencies - uses: browser-actions/setup-chrome@v2 - with: - install-dependencies: true - name: Start an Xvfb display so Chrome may run run: Xvfb -ac $DISPLAY -screen 0 1280x1024x16 & diff --git a/Tools/se-config.toml b/Tools/se-config.toml index 6a3f8c5c..8c787990 100644 --- a/Tools/se-config.toml +++ b/Tools/se-config.toml @@ -8,5 +8,4 @@ # already installed. browser = "chrome" -force-browser-download = true browser-version = "stable" \ No newline at end of file From b17fa5675375b493a206e09393bfe2ee36dc3d5f Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:18:49 +0000 Subject: [PATCH 12/17] Get some verbose logs This might tell me why Chrome dies --- .github/workflows/dotnetCi.yml | 8 +++++++- .../VerboseChromeDriverFactory.cs | 20 +++++++++++++++++++ .../appsettings.json | 4 ++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 8ea9cf7b..ceaa9fc1 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -40,6 +40,7 @@ jobs: BranchParam: ${{ github.event_name == 'pull_request' && 'sonar.pullrequest.branch' || 'sonar.branch.name' }} PullRequestParam: ${{ github.event_name == 'pull_request' && format('/d:sonar.pullrequest.key={0}', github.event.number) || '' }} DISPLAY: :99 + SelectedWebDriverConfig: VerboseChrome steps: - name: Checkout @@ -109,7 +110,7 @@ jobs: projNameArray=(${proj//// }) projName=${projNameArray[1]} assemblyPath=$proj/bin/$Configuration/$Tfm/$projName.dll - coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml" + coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:. --WebDriverFactory::SelectedConfiguration $SelectedWebDriverConfig" -f=opencover -o="TestResults/$projName.opencover.xml" exitCode=$? if [ $exitCode -ne 0 ] then @@ -144,6 +145,11 @@ jobs: with: name: NUnit test results path: Tests/*.Tests/**/TestResults.xml + - name: Upload verbose webdriver log artifacts + uses: actions/upload-artifact@v4 + with: + name: Verbose webdriver logs + path: **/chrome-verbose-log.txt - name: Upload JS test results artifacts uses: actions/upload-artifact@v4 with: diff --git a/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs new file mode 100644 index 00000000..93323cb8 --- /dev/null +++ b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs @@ -0,0 +1,20 @@ +using System; +using CSF.Extensions.WebDriver.Factories; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; + +namespace CSF.Screenplay.Selenium; + +public class VerboseChromeDriverFactory : ICreatesWebDriverFromOptions +{ + public WebDriverAndOptions GetWebDriver(WebDriverCreationOptions options, Action supplementaryConfiguration = null) + { + var chromeOptions = (ChromeOptions) options.OptionsFactory(); + var service = ChromeDriverService.CreateDefaultService(); + service.EnableVerboseLogging = true; + service.LogPath = "chrome-verbose-log.txt"; + var driver = new ChromeDriver(service, chromeOptions); + + return new(driver, chromeOptions); + } +} \ 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 e0e48d58..2e931337 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json +++ b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json @@ -3,6 +3,10 @@ "DriverConfigurations": { "DefaultChrome": { "DriverType": "ChromeDriver" + }, + "VerboseChrome": { + "DriverType": "ChromeDriver", + "DriverFactoryType": "CSF.Screenplay.Selenium.VerboseChromeDriverFactory, CSF.Screenplay.Selenium.Tests" } }, "SelectedConfiguration": "DefaultChrome" From 1b32c82942451f06b78f1d6cd991bca1d367bd78 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:19:28 +0000 Subject: [PATCH 13/17] Fix syntax --- .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 ceaa9fc1..251ae909 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -149,7 +149,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Verbose webdriver logs - path: **/chrome-verbose-log.txt + path: '**/chrome-verbose-log.txt' - name: Upload JS test results artifacts uses: actions/upload-artifact@v4 with: From 0a62d7c53c4aafafd2b03542cc82b04c30274610 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:24:18 +0000 Subject: [PATCH 14/17] Fine, I'll toggle it via the app settings file --- .github/workflows/dotnetCi.yml | 3 +-- Tests/CSF.Screenplay.Selenium.Tests/appsettings.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 251ae909..1613443c 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -40,7 +40,6 @@ jobs: BranchParam: ${{ github.event_name == 'pull_request' && 'sonar.pullrequest.branch' || 'sonar.branch.name' }} PullRequestParam: ${{ github.event_name == 'pull_request' && format('/d:sonar.pullrequest.key={0}', github.event.number) || '' }} DISPLAY: :99 - SelectedWebDriverConfig: VerboseChrome steps: - name: Checkout @@ -110,7 +109,7 @@ jobs: projNameArray=(${proj//// }) projName=${projNameArray[1]} assemblyPath=$proj/bin/$Configuration/$Tfm/$projName.dll - coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:. --WebDriverFactory::SelectedConfiguration $SelectedWebDriverConfig" -f=opencover -o="TestResults/$projName.opencover.xml" + coverlet "$assemblyPath" --target "dotnet" --targetargs "test $proj -c $Configuration --no-build --logger:nunit --test-adapter-path:." -f=opencover -o="TestResults/$projName.opencover.xml" exitCode=$? if [ $exitCode -ne 0 ] then diff --git a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json index 2e931337..63f4be9f 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json +++ b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json @@ -9,6 +9,6 @@ "DriverFactoryType": "CSF.Screenplay.Selenium.VerboseChromeDriverFactory, CSF.Screenplay.Selenium.Tests" } }, - "SelectedConfiguration": "DefaultChrome" + "SelectedConfiguration": "VerboseChrome" } } From 40f5d8d7175d764399dbfaeb4320e8679624ac71 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:31:14 +0000 Subject: [PATCH 15/17] Attempt to fix Chrome execution --- .github/workflows/dotnetCi.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index 1613443c..a37ee791 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -68,6 +68,9 @@ jobs: with: java-version: 21 distribution: 'zulu' + # See https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md + - name: Disable AppArmor restrictions so Chrome may run + run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns - name: Start an Xvfb display so Chrome may run run: Xvfb -ac $DISPLAY -screen 0 1280x1024x16 & From e6e4414bf4c3cb1a4fe5d078d358524072bf6005 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:38:53 +0000 Subject: [PATCH 16/17] Back to non-verbose logging Also add some docco, also exclude duplicate files from docs build. --- .github/workflows/dotnetCi.yml | 2 ++ CSF.Screenplay.Docs/docfx.json | 3 ++- .../VerboseChromeDriverFactory.cs | 10 ++++++++++ Tests/CSF.Screenplay.Selenium.Tests/appsettings.json | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnetCi.yml b/.github/workflows/dotnetCi.yml index a37ee791..0bfb8788 100644 --- a/.github/workflows/dotnetCi.yml +++ b/.github/workflows/dotnetCi.yml @@ -147,6 +147,8 @@ jobs: with: name: NUnit test results path: Tests/*.Tests/**/TestResults.xml + # This step won't produce any artifacts if the verbose factory isn't + # selected via appsettings.json in CSF.Screenplay.Selenium.Tests, but that's OK - name: Upload verbose webdriver log artifacts uses: actions/upload-artifact@v4 with: diff --git a/CSF.Screenplay.Docs/docfx.json b/CSF.Screenplay.Docs/docfx.json index c356164d..0c6b88cf 100644 --- a/CSF.Screenplay.Docs/docfx.json +++ b/CSF.Screenplay.Docs/docfx.json @@ -11,7 +11,8 @@ "**/obj/**", "Tests/**", "Old/**", - "CSF.Screenplay.JsonToHtmlReport.Template/**" + "CSF.Screenplay.JsonToHtmlReport.Template/**", + "CSF.Screenplay.SpecFlow/**" ] } ], diff --git a/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs index 93323cb8..0904de1a 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs @@ -5,6 +5,16 @@ namespace CSF.Screenplay.Selenium; +/// +/// An implementation of which writes verbose logs to a file. +/// +/// +/// +/// This driver factory is unused most of the time, but it's helpful if you're trying to diagnose problems with ChromeDriver, +/// say in a CI build that's been failing. Select this factory by changing the appsettings.json file and you'll get +/// log files. +/// +/// public class VerboseChromeDriverFactory : ICreatesWebDriverFromOptions { public WebDriverAndOptions GetWebDriver(WebDriverCreationOptions options, Action supplementaryConfiguration = null) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json index 63f4be9f..2e931337 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json +++ b/Tests/CSF.Screenplay.Selenium.Tests/appsettings.json @@ -9,6 +9,6 @@ "DriverFactoryType": "CSF.Screenplay.Selenium.VerboseChromeDriverFactory, CSF.Screenplay.Selenium.Tests" } }, - "SelectedConfiguration": "VerboseChrome" + "SelectedConfiguration": "DefaultChrome" } } From 05814754094338de7d6f0f57b8beb1b7dfcf6f8d Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Tue, 20 Jan 2026 21:45:53 +0000 Subject: [PATCH 17/17] Fix tech issue --- .../CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs index 0904de1a..adf5ab3c 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/VerboseChromeDriverFactory.cs @@ -17,7 +17,7 @@ namespace CSF.Screenplay.Selenium; /// public class VerboseChromeDriverFactory : ICreatesWebDriverFromOptions { - public WebDriverAndOptions GetWebDriver(WebDriverCreationOptions options, Action supplementaryConfiguration = null) + public WebDriverAndOptions GetWebDriver(WebDriverCreationOptions options, Action? supplementaryConfiguration = null) { var chromeOptions = (ChromeOptions) options.OptionsFactory(); var service = ChromeDriverService.CreateDefaultService();