diff --git a/src/Common/Dependencies.props b/src/Common/Dependencies.props index 61f3c0b57..cdd871f08 100644 --- a/src/Common/Dependencies.props +++ b/src/Common/Dependencies.props @@ -18,7 +18,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Playwright.Tests/BrowserContextRouteTests.cs b/src/Playwright.Tests/BrowserContextRouteTests.cs index d4df032bd..bb83b8620 100644 --- a/src/Playwright.Tests/BrowserContextRouteTests.cs +++ b/src/Playwright.Tests/BrowserContextRouteTests.cs @@ -88,11 +88,11 @@ await context.RouteAsync("**/empty.html", (route) => route.ContinueAsync(); }); - Action handler4 = (route) => + void handler4(IRoute route) { intercepted.Add(4); route.ContinueAsync(); - }; + } await context.RouteAsync(new Regex("/empty.html"), handler4); await page.GotoAsync(Server.EmptyPage); @@ -125,11 +125,11 @@ await page.RouteAsync("/empty.html", (route) => route.ContinueAsync(); }); - Action handler2 = (route) => + void handler2(IRoute route) { intercepted.Add(2); route.ContinueAsync(); - }; + } await page.RouteAsync("/empty.html", handler2); await page.GotoAsync(Server.EmptyPage); @@ -363,7 +363,7 @@ public async Task ShouldWorkIfHandlerWithTimesParameterWasRemovedFromAnotherHand await using var context = await Browser.NewContextAsync(); var page = await context.NewPageAsync(); var intercepted = new List(); - async Task handler(IRoute route) + void handler(IRoute route) { intercepted.Add("first"); route.ContinueAsync(); diff --git a/src/Playwright.Tests/PageRouteTests.cs b/src/Playwright.Tests/PageRouteTests.cs index 93f654293..f1ca094b9 100644 --- a/src/Playwright.Tests/PageRouteTests.cs +++ b/src/Playwright.Tests/PageRouteTests.cs @@ -81,11 +81,11 @@ await Page.RouteAsync("**/empty.html", (route) => }); - Action handler4 = (route) => + void handler4(IRoute route) { intercepted.Add(4); route.FallbackAsync(); - }; + } await Page.RouteAsync(new Regex("/empty.html"), handler4); await Page.GotoAsync(Server.EmptyPage); @@ -771,7 +771,7 @@ await page.RouteAsync("**/empty.html", (route) => public async Task ShouldWorkIfHandlerWithTimesParameterWasRemovedFromAnotherHandler() { var intercepted = new List(); - async Task handler(IRoute route) + void handler(IRoute route) { intercepted.Add("first"); route.ContinueAsync(); diff --git a/src/Playwright/Core/Locator.cs b/src/Playwright/Core/Locator.cs index 77ebef089..a1c2f427d 100644 --- a/src/Playwright/Core/Locator.cs +++ b/src/Playwright/Core/Locator.cs @@ -26,6 +26,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.Linq; using System.Text.Encodings.Web; using System.Text.Json; @@ -534,7 +535,7 @@ internal static string GetByRoleSelector(AriaRole role, ByRoleOptions options) } if (options.Level != null) { - props.Add(new List { "level", options.Level.ToString() }); + props.Add(new List { "level", options.Level?.ToString(CultureInfo.InvariantCulture) }); } if (options.Name != null) {