From c0cda15f3cf5d12c1a9a29760bc2c7d128446b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 30 Apr 2024 01:01:27 +0200 Subject: [PATCH 1/5] Temporarily forcing non-headless mode --- Lombiq.Tests.UI.Samples/UITestBase.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lombiq.Tests.UI.Samples/UITestBase.cs b/Lombiq.Tests.UI.Samples/UITestBase.cs index 3fe59f397..7dbb27f61 100644 --- a/Lombiq.Tests.UI.Samples/UITestBase.cs +++ b/Lombiq.Tests.UI.Samples/UITestBase.cs @@ -53,8 +53,7 @@ protected override Task ExecuteTestAsync( // may want to turn this off so you can see in the browser what's happening. Hence the override of the // default here. Apart from changing the code here, you can use a configuration file or environment // variables, see the docs. - configuration.BrowserConfiguration.Headless = - TestConfigurationManager.GetBoolConfiguration("BrowserConfiguration:Headless", defaultValue: false); + configuration.BrowserConfiguration.Headless = false; // There are event handlers that you can hook into, like // configuration.OrchardCoreConfiguration.BeforeAppStart. But it is just one of many. Check out the From bb31ce00d0bc1132a55bd0a3d923ad4c3837884d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 30 Apr 2024 02:05:41 +0200 Subject: [PATCH 2/5] Removing Chrome sandbox disable --- Lombiq.Tests.UI/Services/WebDriverFactory.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Lombiq.Tests.UI/Services/WebDriverFactory.cs b/Lombiq.Tests.UI/Services/WebDriverFactory.cs index d27325bdc..630fef7cb 100644 --- a/Lombiq.Tests.UI/Services/WebDriverFactory.cs +++ b/Lombiq.Tests.UI/Services/WebDriverFactory.cs @@ -22,17 +22,13 @@ public static Task CreateChromeDriverAsync(BrowserConfiguration co { Task CreateDriverInnerAsync(ChromeDriverService service) { + // Note that no-sandbox should NOT be used, because it causes Chrome processes to remain open, see + // https://github.com/Lombiq/UI-Testing-Toolbox/issues/356. + var chromeConfig = new ChromeConfiguration { Options = new ChromeOptions().SetCommonOptions() }; chromeConfig.Options.SetLoggingPreference(LogType.Browser, LogLevel.Info); - // Disabling the Chrome sandbox can speed things up a bit, so it's recommended when you get a lot of - // timeouts during parallel execution: - // https://stackoverflow.com/questions/22322596/selenium-error-the-http-request-to-the-remote-webdriver-timed-out-after-60-sec - // However, this makes the executing machine vulnerable to browser-based attacks so it should only be used - // with trusted code (like our own). - chromeConfig.Options.AddArgument("no-sandbox"); - // Linux-specific setting, may be necessary for running in containers, see // https://developers.google.com/web/tools/puppeteer/troubleshooting#tips for more information. chromeConfig.Options.AddArgument("disable-dev-shm-usage"); // #spell-check-ignore-line From 4b303109dd88ace9ad026f3e3837c6bb41aca7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 30 Apr 2024 02:14:06 +0200 Subject: [PATCH 3/5] Using the fixed publish-nuget workflow --- .github/workflows/publish-nuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 4b26cfcf9..655acc602 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -7,6 +7,6 @@ on: jobs: publish-nuget: - uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@issue/OSOE-842 secrets: API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }} From e72effad01a88c48197d70f0e858208ec0a078c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 30 Apr 2024 02:52:38 +0200 Subject: [PATCH 4/5] Fixing TestAdminBackgroundTasksAsMonkeyRecursivelyShouldWorkWithAdminUser --- Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs b/Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs index b8b7738ae..363c31c2a 100644 --- a/Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs @@ -101,6 +101,7 @@ public Task TestAdminBackgroundTasksAsMonkeyRecursivelyShouldWorkWithAdminUser() && !logEntry .Message .Contains("An invalid form control with name='LockExpiration' is not focusable.") + && !logEntry.IsNotFoundLogEntry("/favicon.ico") && logEntry.Level != LogLevel.Info) .ShouldBeEmpty()); From 424614194b07e976a1712218ebb2d23253b48aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 30 Apr 2024 03:15:55 +0200 Subject: [PATCH 5/5] Revert "Temporarily forcing non-headless mode" This reverts commit c0cda15f3cf5d12c1a9a29760bc2c7d128446b03. --- Lombiq.Tests.UI.Samples/UITestBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lombiq.Tests.UI.Samples/UITestBase.cs b/Lombiq.Tests.UI.Samples/UITestBase.cs index 7dbb27f61..3fe59f397 100644 --- a/Lombiq.Tests.UI.Samples/UITestBase.cs +++ b/Lombiq.Tests.UI.Samples/UITestBase.cs @@ -53,7 +53,8 @@ protected override Task ExecuteTestAsync( // may want to turn this off so you can see in the browser what's happening. Hence the override of the // default here. Apart from changing the code here, you can use a configuration file or environment // variables, see the docs. - configuration.BrowserConfiguration.Headless = false; + configuration.BrowserConfiguration.Headless = + TestConfigurationManager.GetBoolConfiguration("BrowserConfiguration:Headless", defaultValue: false); // There are event handlers that you can hook into, like // configuration.OrchardCoreConfiguration.BeforeAppStart. But it is just one of many. Check out the