Skip to content

Commit

Permalink
chore: get rid of build warnings (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jan 17, 2024
1 parent a6c75af commit e964457
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Common/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 5 additions & 5 deletions src/Playwright.Tests/BrowserContextRouteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ await context.RouteAsync("**/empty.html", (route) =>
route.ContinueAsync();
});

Action<IRoute> handler4 = (route) =>
void handler4(IRoute route)
{
intercepted.Add(4);
route.ContinueAsync();
};
}
await context.RouteAsync(new Regex("/empty.html"), handler4);

await page.GotoAsync(Server.EmptyPage);
Expand Down Expand Up @@ -125,11 +125,11 @@ await page.RouteAsync("/empty.html", (route) =>
route.ContinueAsync();
});

Action<IRoute> handler2 = (route) =>
void handler2(IRoute route)
{
intercepted.Add(2);
route.ContinueAsync();
};
}
await page.RouteAsync("/empty.html", handler2);

await page.GotoAsync(Server.EmptyPage);
Expand Down Expand Up @@ -363,7 +363,7 @@ public async Task ShouldWorkIfHandlerWithTimesParameterWasRemovedFromAnotherHand
await using var context = await Browser.NewContextAsync();
var page = await context.NewPageAsync();
var intercepted = new List<string>();
async Task handler(IRoute route)
void handler(IRoute route)
{
intercepted.Add("first");
route.ContinueAsync();
Expand Down
6 changes: 3 additions & 3 deletions src/Playwright.Tests/PageRouteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ await Page.RouteAsync("**/empty.html", (route) =>
});


Action<IRoute> handler4 = (route) =>
void handler4(IRoute route)
{
intercepted.Add(4);
route.FallbackAsync();
};
}

await Page.RouteAsync(new Regex("/empty.html"), handler4);
await Page.GotoAsync(Server.EmptyPage);
Expand Down Expand Up @@ -771,7 +771,7 @@ await page.RouteAsync("**/empty.html", (route) =>
public async Task ShouldWorkIfHandlerWithTimesParameterWasRemovedFromAnotherHandler()
{
var intercepted = new List<string>();
async Task handler(IRoute route)
void handler(IRoute route)
{
intercepted.Add("first");
route.ContinueAsync();
Expand Down
3 changes: 2 additions & 1 deletion src/Playwright/Core/Locator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -534,7 +535,7 @@ internal static string GetByRoleSelector(AriaRole role, ByRoleOptions options)
}
if (options.Level != null)
{
props.Add(new List<string> { "level", options.Level.ToString() });
props.Add(new List<string> { "level", options.Level?.ToString(CultureInfo.InvariantCulture) });
}
if (options.Name != null)
{
Expand Down

0 comments on commit e964457

Please sign in to comment.