Skip to content

Commit 6b41bfe

Browse files
authored
chore: roll to 1.53.0-alpha-1744741041000 (#3145)
1 parent 3c12f7c commit 6b41bfe

30 files changed

+439
-84
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
| | Linux | macOS | Windows |
55
| :--- | :---: | :---: | :---: |
6-
| Chromium <!-- GEN:chromium-version -->134.0.6998.35<!-- GEN:stop --> ||||
6+
| Chromium <!-- GEN:chromium-version -->136.0.7103.25<!-- GEN:stop --> ||||
77
| WebKit <!-- GEN:webkit-version -->18.4<!-- GEN:stop --> ||||
8-
| Firefox <!-- GEN:firefox-version -->135.0<!-- GEN:stop --> ||||
8+
| Firefox <!-- GEN:firefox-version -->137.0<!-- GEN:stop --> ||||
99

1010
Playwright for .NET is the official language port of [Playwright](https://playwright.dev), the library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.
1111

src/Common/Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<AssemblyVersion>1.51.0</AssemblyVersion>
44
<PackageVersion>$(AssemblyVersion)</PackageVersion>
5-
<DriverVersion>1.51.1</DriverVersion>
5+
<DriverVersion>1.53.0-alpha-1744741041000</DriverVersion>
66
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
77
<FileVersion>$(AssemblyVersion)</FileVersion>
88
<NoDefaultExcludes>true</NoDefaultExcludes>

src/Playwright.TestingHarnessTest/package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Playwright.TestingHarnessTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "playwright.testingharnesstest",
33
"private": true,
44
"devDependencies": {
5-
"@playwright/test": "1.51.0-beta-1741166263000",
5+
"@playwright/test": "1.53.0-alpha-1744741041000",
66
"@types/node": "^22.12.0",
77
"fast-xml-parser": "^4.5.0"
88
}

src/Playwright.Tests/Assertions/LocatorAssertionsTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,31 @@ public async Task ShouldSupportToHaveClass()
553553
}
554554
}
555555

556+
[PlaywrightTest("playwright-test/playwright.expect.spec.ts", "should support toContainClass")]
557+
public async Task ShouldSupportToContainClass()
558+
{
559+
{
560+
await Page.SetContentAsync("<div class=\"foo bar baz\"></div>");
561+
var locator = Page.Locator("div");
562+
await Expect(locator).ToContainClassAsync("");
563+
await Expect(locator).ToContainClassAsync("bar");
564+
await Expect(locator).ToContainClassAsync("baz bar");
565+
await Expect(locator).ToContainClassAsync(" bar foo ");
566+
await Expect(locator).Not.ToContainClassAsync("baz not-matching");
567+
var exception = await PlaywrightAssert.ThrowsAsync<PlaywrightException>(() => Expect(locator).ToContainClassAsync("does-not-exist", new() { Timeout = 300 }));
568+
StringAssert.Contains("Locator expected to contain class names 'does-not-exist'", exception.Message);
569+
StringAssert.Contains("But was: 'foo bar baz'", exception.Message);
570+
StringAssert.Contains("LocatorAssertions.ToContainClassAsync with timeout 300ms", exception.Message);
571+
}
572+
{
573+
await Page.SetContentAsync("<div class=\"foo\"></div><div class=\"hello bar\"></div><div class=\"baz\"></div>");
574+
var locator = Page.Locator("div");
575+
await Expect(locator).ToContainClassAsync(new string[] { "foo", "hello", "baz" });
576+
await Expect(locator).Not.ToContainClassAsync(new string[] { "not-there", "hello", "baz" });
577+
await Expect(locator).Not.ToContainClassAsync(new string[] { "foo", "hello" });
578+
}
579+
}
580+
556581
[PlaywrightTest("playwright-test/playwright.expect.spec.ts", "should support toHaveCount")]
557582
public async Task ShouldSupportToHaveCount()
558583
{

src/Playwright.Tests/GlobalFetchTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,22 @@ public async Task ShouldNotFollowRedirectsWhenMaxRedirectsIsSetTo0()
408408
await request.DisposeAsync();
409409
}
410410

411+
[PlaywrightTest("global-fetch.spec.ts", "should not follow redirects when maxRedirects is set to 0 in newContext")]
412+
public async Task ShouldNotFollowRedirectsWhenMaxRedirectsIsSetTo0InNewContext()
413+
{
414+
Server.SetRedirect("/a/redirect1", "/b/c/redirect2");
415+
Server.SetRedirect("/b/c/redirect2", "/simple.json");
416+
417+
var request = await Playwright.APIRequest.NewContextAsync(new() { MaxRedirects = 0 });
418+
foreach (var method in new[] { "GET", "PUT", "POST", "OPTIONS", "HEAD", "PATCH" })
419+
{
420+
var response = await request.FetchAsync($"{Server.Prefix}/a/redirect1", new() { Method = method });
421+
Assert.AreEqual("/b/c/redirect2", response.Headers["location"]);
422+
Assert.AreEqual(302, response.Status);
423+
}
424+
await request.DisposeAsync();
425+
}
426+
411427
[PlaywrightTest("global-fetch.spec.ts", "should throw an error when maxRedirects is less than 0")]
412428
public async Task ShouldThrowAnErrorWhenMaxRedirectsIsLessThan0()
413429
{

src/Playwright.Tests/PageAriaSnapshotTests.cs

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,64 @@ await Page.SetContentAsync(@"
9999
await CheckAndMatchSnapshot(Page.Locator("body"), @"
100100
- list:
101101
- listitem:
102-
- link ""link""
102+
- link ""link"":
103+
- /url: about:blank
104+
");
105+
}
106+
107+
[PlaywrightTest("to-match-aria-snapshot.spec.ts", "should detect unexpected children: equal")]
108+
public async Task ShouldDetectUnexpectedChildrenEqual()
109+
{
110+
await Page.SetContentAsync(@"
111+
<ul>
112+
<li>One</li>
113+
<li>Two</li>
114+
<li>Three</li>
115+
</ul>
116+
");
117+
await Expect(Page.Locator("body")).ToMatchAriaSnapshotAsync(@"
118+
- list:
119+
- listitem: ""One""
120+
- listitem: ""Three""
121+
");
122+
var exception = await PlaywrightAssert.ThrowsAsync<PlaywrightException>(() =>
123+
{
124+
return Expect(Page.Locator("body")).ToMatchAriaSnapshotAsync(@"
125+
- list:
126+
- /children: equal
127+
- listitem: ""One""
128+
- listitem: ""Three""
129+
", new() { Timeout = 300 });
130+
});
131+
StringAssert.Contains("LocatorAssertions.ToMatchAriaSnapshotAsync with timeout 300ms", exception.Message);
132+
StringAssert.Contains("- unexpected value", exception.Message);
133+
}
134+
135+
[PlaywrightTest("page-aria-snapshot.spec.ts", "should generate refs")]
136+
public async Task ShouldGenerateRefs()
137+
{
138+
await Page.SetContentAsync(@"
139+
<button>One</button>
140+
<button>Two</button>
141+
<button>Three</button>
142+
");
143+
var snapshot = await Page.Locator("body").AriaSnapshotAsync(new() { Ref = true });
144+
Assert.AreEqual(_unshift(@"
145+
- button ""One"" [ref=s1e3]
146+
- button ""Two"" [ref=s1e4]
147+
- button ""Three"" [ref=s1e5]
148+
"), snapshot);
149+
}
150+
151+
[PlaywrightTest("to-match-aria-snapshot.spec.ts", "should match url")]
152+
public async Task ShouldMatchUrl()
153+
{
154+
await Page.SetContentAsync(@"
155+
<a href='https://example.com'>Link</a>
156+
");
157+
await Expect(Page.Locator("body")).ToMatchAriaSnapshotAsync(@"
158+
- link:
159+
- /url: /.*example.com/
103160
");
104161
}
105162
}

src/Playwright.Tests/PageClockTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ public async Task ShouldPause()
462462
await Page.Clock.InstallAsync(new() { TimeDate = DateTimeOffset.FromUnixTimeMilliseconds(0).UtcDateTime });
463463
await Page.GotoAsync("data:text/html,");
464464
await Page.Clock.PauseAtAsync(DateTimeOffset.FromUnixTimeMilliseconds(1000).UtcDateTime);
465-
await Page.WaitForTimeoutAsync(1000);
466-
await Page.Clock.ResumeAsync();
465+
await Page.WaitForTimeoutAsync(1111);
467466
var now = await Page.EvaluateAsync<long>("Date.now()");
468467
Assert.GreaterOrEqual(now, 0);
469468
Assert.LessOrEqual(now, 1000);

src/Playwright.Tests/PageEvaluateTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ public async Task ShouldTransferNegativeInfinity()
7474
Assert.AreEqual(double.NegativeInfinity, result);
7575
}
7676

77+
[PlaywrightTest("page-evaluate.spec.ts", "should transfer typed arrays")]
78+
public async Task ShouldTransferTypedArrays()
79+
{
80+
Assert.AreEqual(new sbyte[] { 1, 2, 3 }, await Page.EvaluateAsync<sbyte[]>("() => new Int8Array([1, 2, 3])"));
81+
Assert.AreEqual(new byte[] { 1, 2, 3 }, await Page.EvaluateAsync<byte[]>("() => new Uint8Array([1, 2, 3])"));
82+
Assert.AreEqual(new byte[] { 1, 2, 3 }, await Page.EvaluateAsync<byte[]>("() => new Uint8ClampedArray([1, 2, 3])"));
83+
Assert.AreEqual(new short[] { 1, 2, 3 }, await Page.EvaluateAsync<short[]>("() => new Int16Array([1, 2, 3])"));
84+
Assert.AreEqual(new ushort[] { 1, 2, 3 }, await Page.EvaluateAsync<ushort[]>("() => new Uint16Array([1, 2, 3])"));
85+
Assert.AreEqual(new int[] { 1, 2, 3 }, await Page.EvaluateAsync<int[]>("() => new Int32Array([1, 2, 3])"));
86+
Assert.AreEqual(new uint[] { 1, 2, 3 }, await Page.EvaluateAsync<uint[]>("() => new Uint32Array([1, 2, 3])"));
87+
Assert.AreEqual(new float[] { 1.5F, 2.5F, 3.5F }, await Page.EvaluateAsync<float[]>("() => new Float32Array([1.5, 2.5, 3.5])"));
88+
Assert.AreEqual(new double[] { 1.5, 2.5, 3.5 }, await Page.EvaluateAsync<double[]>("() => new Float64Array([1.5, 2.5, 3.5])"));
89+
Assert.AreEqual(new long[] { 1, 2, 3 }, await Page.EvaluateAsync<long[]>("() => new BigInt64Array([1n, 2n, 3n])"));
90+
Assert.AreEqual(new ulong[] { 1, 2, 3 }, await Page.EvaluateAsync<ulong[]>("() => new BigUint64Array([1n, 2n, 3n])"));
91+
}
92+
7793
[PlaywrightTest("page-evaluate.spec.ts", "should transfer bigint")]
7894
public async Task ShouldTransferBigInt()
7995
{

src/Playwright.Tests/PageRouteTests.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ void handler4(IRoute route)
9999
Assert.AreEqual(new[] { 1 }, intercepted.ToArray());
100100
}
101101

102-
[PlaywrightTest("page-route.spec.ts", "should support ? in glob pattern")]
103-
public async Task ShouldSupportInGlobPattern()
102+
[PlaywrightTest("page-route.spec.ts", "should not support ? in glob pattern")]
103+
public async Task ShouldNotSupportQuestionMarkInGlobPattern()
104104
{
105105
Server.SetRoute("/index", context => context.Response.WriteAsync("index-no-hello"));
106106
Server.SetRoute("/index123hello", context => context.Response.WriteAsync("index123hello"));
107107
Server.SetRoute("/index?hello", context => context.Response.WriteAsync("index?hello"));
108+
Server.SetRoute("/index1hello", context => context.Response.WriteAsync("index1hello"));
108109

109110
await Page.RouteAsync("**/index?hello", (route) => route.FulfillAsync(new() { Body = "intercepted any character" }));
110111
await Page.RouteAsync("**/index\\?hello", (route) => route.FulfillAsync(new() { Body = "intercepted question mark" }));
@@ -116,7 +117,7 @@ public async Task ShouldSupportInGlobPattern()
116117
StringAssert.Contains("index-no-hello", await Page.ContentAsync());
117118

118119
await Page.GotoAsync(Server.Prefix + "/index1hello");
119-
StringAssert.Contains("intercepted any character", await Page.ContentAsync());
120+
StringAssert.Contains("index1hello", await Page.ContentAsync());
120121

121122
await Page.GotoAsync(Server.Prefix + "/index123hello");
122123
StringAssert.Contains("index123hello", await Page.ContentAsync());
@@ -642,7 +643,7 @@ await Page.RouteAsync("**/cars*", (route) =>
642643
method: 'POST',
643644
headers: { 'Content-Type': 'application/json' },
644645
mode: 'cors',
645-
body: JSON.stringify({ 'number': 1 })
646+
body: JSON.stringify({ 'number': 1 })
646647
});
647648
return response.json();
648649
}");
@@ -670,7 +671,7 @@ await Page.RouteAsync("**/cars*", (route) =>
670671
method: 'POST',
671672
headers: { 'Content-Type': 'application/json' },
672673
mode: 'cors',
673-
body: JSON.stringify({ 'number': 1 })
674+
body: JSON.stringify({ 'number': 1 })
674675
});
675676
return response.json();
676677
}");
@@ -682,7 +683,7 @@ await Page.RouteAsync("**/cars*", (route) =>
682683
method: 'DELETE',
683684
headers: { 'Content-Type': 'application/json' },
684685
mode: 'cors',
685-
body: JSON.stringify({ 'number': 1 })
686+
body: JSON.stringify({ 'number': 1 })
686687
});
687688
return response.json();
688689
}");

0 commit comments

Comments
 (0)