diff --git a/.github/uitest/action.yml b/.github/uitest/action.yml index e91ba80cc3..bbd0d05023 100644 --- a/.github/uitest/action.yml +++ b/.github/uitest/action.yml @@ -8,7 +8,7 @@ inputs: required: false build-configuration: default: Debug - description: which --configuration to pass to dotnet build / dotnet run + description: which --configuration to pass to dotnet build / dotnet run required: false runtime-environment: default: Development @@ -25,6 +25,7 @@ inputs: runs: using: composite steps: + # run the appropriate uitest script - if: ${{ runner.os != 'Windows' }} name: uitest.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1ec15d3ef..bf750ca4a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -139,7 +139,7 @@ jobs: name: webforms-adapters-tests title: WebForms Adapter Tests github-token: ${{ secrets.GITHUB_TOKEN }} - target-framework: net472 + target-framework: net472 js-tests: runs-on: ubuntu-latest diff --git a/src/Analyzers/Analyzers.Tests/DotVVM.Analyzers.Tests.csproj b/src/Analyzers/Analyzers.Tests/DotVVM.Analyzers.Tests.csproj index 56656ef0f0..18e58be589 100644 --- a/src/Analyzers/Analyzers.Tests/DotVVM.Analyzers.Tests.csproj +++ b/src/Analyzers/Analyzers.Tests/DotVVM.Analyzers.Tests.csproj @@ -16,7 +16,7 @@ - + all diff --git a/src/Api/Swashbuckle.AspNetCore.Tests/DotVVM.Framework.Api.Swashbuckle.AspNetCore.Tests.csproj b/src/Api/Swashbuckle.AspNetCore.Tests/DotVVM.Framework.Api.Swashbuckle.AspNetCore.Tests.csproj index 66fc0abfe7..c1057cb57f 100644 --- a/src/Api/Swashbuckle.AspNetCore.Tests/DotVVM.Framework.Api.Swashbuckle.AspNetCore.Tests.csproj +++ b/src/Api/Swashbuckle.AspNetCore.Tests/DotVVM.Framework.Api.Swashbuckle.AspNetCore.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Framework/Testing.SeleniumHelpers/DotVVM.Framework.Testing.SeleniumHelpers.csproj b/src/Framework/Testing.SeleniumHelpers/DotVVM.Framework.Testing.SeleniumHelpers.csproj index e064bfffb9..f3ac4705a4 100644 --- a/src/Framework/Testing.SeleniumHelpers/DotVVM.Framework.Testing.SeleniumHelpers.csproj +++ b/src/Framework/Testing.SeleniumHelpers/DotVVM.Framework.Testing.SeleniumHelpers.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/src/Samples/Api.Owin/Properties/launchSettings.json b/src/Samples/Api.Owin/Properties/launchSettings.json index 8d33da700a..16f8b584bd 100644 --- a/src/Samples/Api.Owin/Properties/launchSettings.json +++ b/src/Samples/Api.Owin/Properties/launchSettings.json @@ -3,10 +3,11 @@ "DotVVM.Samples.BasicSamples.Api.Owin": { "commandName": "Project", "launchBrowser": true, + "launchUrl": "http://localhost:61453", + "applicationUrl": "http://localhost:61453", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:61453" + } } } } diff --git a/src/Samples/AspNetCore/Properties/launchSettings.json b/src/Samples/AspNetCore/Properties/launchSettings.json index 70ca5a293a..456a553df2 100644 --- a/src/Samples/AspNetCore/Properties/launchSettings.json +++ b/src/Samples/AspNetCore/Properties/launchSettings.json @@ -4,6 +4,7 @@ "commandName": "Project", "launchBrowser": true, "launchUrl": "http://localhost:16019", + "applicationUrl": "http://localhost:16019", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Samples/AspNetCoreLatest/Properties/launchSettings.json b/src/Samples/AspNetCoreLatest/Properties/launchSettings.json index 70ca5a293a..456a553df2 100644 --- a/src/Samples/AspNetCoreLatest/Properties/launchSettings.json +++ b/src/Samples/AspNetCoreLatest/Properties/launchSettings.json @@ -4,6 +4,7 @@ "commandName": "Project", "launchBrowser": true, "launchUrl": "http://localhost:16019", + "applicationUrl": "http://localhost:16019", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Samples/Owin/Properties/launchSettings.json b/src/Samples/Owin/Properties/launchSettings.json index 15d9c829a0..00ab196b05 100644 --- a/src/Samples/Owin/Properties/launchSettings.json +++ b/src/Samples/Owin/Properties/launchSettings.json @@ -3,10 +3,11 @@ "DotVVM.Samples.BasicSamples.Owin": { "commandName": "Project", "launchBrowser": true, + "launchUrl": "http://localhost:5407", + "applicationUrl": "http://localhost:5407", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:5407" + } } } } diff --git a/src/Samples/Tests/Tests/Complex/SPAErrorReportingTests.cs b/src/Samples/Tests/Tests/Complex/SPAErrorReportingTests.cs index c780a6b61f..db5b0ea1e0 100644 --- a/src/Samples/Tests/Tests/Complex/SPAErrorReportingTests.cs +++ b/src/Samples/Tests/Tests/Complex/SPAErrorReportingTests.cs @@ -4,6 +4,7 @@ using DotVVM.Samples.Tests.Base; using DotVVM.Testing.Abstractions; using OpenQA.Selenium.Chrome; +using OpenQA.Selenium.Chromium; using Riganti.Selenium.Core; using Riganti.Selenium.Core.Abstractions.Attributes; using Riganti.Selenium.DotVVM; @@ -31,7 +32,7 @@ public void Complex_SPAErrorReporting_NavigationAndPostbacks() void SetOfflineMode(bool offline) { - ((ChromeDriver)browser.Driver).NetworkConditions = new ChromeNetworkConditions() { + ((ChromeDriver)browser.Driver).NetworkConditions = new ChromiumNetworkConditions() { IsOffline = offline, Latency = TimeSpan.FromMilliseconds(5), DownloadThroughput = 500 * 1024, diff --git a/src/Samples/Tests/Tests/DotVVM.Samples.Tests.csproj b/src/Samples/Tests/Tests/DotVVM.Samples.Tests.csproj index 1e4167c204..f1ad133eaa 100644 --- a/src/Samples/Tests/Tests/DotVVM.Samples.Tests.csproj +++ b/src/Samples/Tests/Tests/DotVVM.Samples.Tests.csproj @@ -3,24 +3,33 @@ net6.0 false + + + - + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + + + + + diff --git a/src/Samples/Tests/Tests/Feature/ActionFilterErrorHandlingTest.cs b/src/Samples/Tests/Tests/Feature/ActionFilterErrorHandlingTest.cs index 9c32e040f6..d0029146a0 100644 --- a/src/Samples/Tests/Tests/Feature/ActionFilterErrorHandlingTest.cs +++ b/src/Samples/Tests/Tests/Feature/ActionFilterErrorHandlingTest.cs @@ -48,13 +48,13 @@ public void Feature_ActionFilterErrorHandling_ActionFilterRedirect() // try the first button browser.NavigateToUrl(SamplesRouteUrls.FeatureSamples_ActionFilterErrorHandling_ActionFilterRedirect); AssertUI.Url(browser, u => !u.Contains("?redirected=true")); - browser.ElementAt("input", 0).Click(); + browser.ElementAt("input", 0).Click().Wait(1000); AssertUI.Url(browser, u => u.Contains("?redirected=true")); // try the second button browser.NavigateToUrl(SamplesRouteUrls.FeatureSamples_ActionFilterErrorHandling_ActionFilterRedirect); AssertUI.Url(browser, u => !u.Contains("?redirected=true")); - browser.ElementAt("input", 1).Click(); + browser.ElementAt("input", 1).Click().Wait(1000); AssertUI.Url(browser, u => u.Contains("?redirected=true")); }); } diff --git a/src/Samples/Tests/Tests/Feature/PostbackConcurrencyTests.cs b/src/Samples/Tests/Tests/Feature/PostbackConcurrencyTests.cs index f6471963a0..16a7a559a5 100644 --- a/src/Samples/Tests/Tests/Feature/PostbackConcurrencyTests.cs +++ b/src/Samples/Tests/Tests/Feature/PostbackConcurrencyTests.cs @@ -1,6 +1,7 @@ using System.Threading; using DotVVM.Samples.Tests.Base; using DotVVM.Testing.Abstractions; +using OpenQA.Selenium; using Riganti.Selenium.Core; using Riganti.Selenium.Core.Abstractions.Attributes; using Riganti.Selenium.DotVVM; @@ -256,11 +257,27 @@ public void Feature_PostbackConcurrency_RedirectPostbackQueueSpa_PostbackFromPre browser.ElementAt("input[type=button]", 0).Click(); browser.ElementAt("input[type=button]", 2).Click(); + var attempt = 0; while (!browser.CurrentUrl.Contains("?time")) { + attempt++; + if (attempt > 50) + { + Assert.Fail("The redirect didn't happen."); + } + Thread.Sleep(100); - AssertUI.TextNotEquals(browser.Single(".result"), "1"); + try + { + AssertUI.TextNotEquals(browser.Single(".result"), "1", waitForOptions: WaitForOptions.Disabled); + } + catch (StaleElementReferenceException) + { + // ignore + break; + } } + AssertUI.Url(browser, u => u.Contains("?time")); for (int i = 0; i < 8; i++) { diff --git a/src/Samples/Tests/Tests/seleniumconfig.json b/src/Samples/Tests/Tests/seleniumconfig.json index 7a5fb817d1..40aa02796b 100644 --- a/src/Samples/Tests/Tests/seleniumconfig.json +++ b/src/Samples/Tests/Tests/seleniumconfig.json @@ -1,8 +1,6 @@ { "factories": { - "chrome:fast": { - "capabilities": [ "--headless" ] - } + "firefox:fast": {} }, "baseUrls": [ "http://localhost:16019/" diff --git a/src/Tests/DotVVM.Framework.Tests.csproj b/src/Tests/DotVVM.Framework.Tests.csproj index 8e36855372..3194a2cba2 100644 --- a/src/Tests/DotVVM.Framework.Tests.csproj +++ b/src/Tests/DotVVM.Framework.Tests.csproj @@ -47,12 +47,12 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/src/Tracing/MiniProfiler.Tests/DotVVM.Tracing.MiniProfiler.Tests.csproj b/src/Tracing/MiniProfiler.Tests/DotVVM.Tracing.MiniProfiler.Tests.csproj index 94cad63099..fe966fab42 100644 --- a/src/Tracing/MiniProfiler.Tests/DotVVM.Tracing.MiniProfiler.Tests.csproj +++ b/src/Tracing/MiniProfiler.Tests/DotVVM.Tracing.MiniProfiler.Tests.csproj @@ -4,7 +4,7 @@ false - +