Skip to content

Commit 9d93d9c

Browse files
authored
chore: roll driver to 1.53.0-alpha-2025-05-21 (#3184)
1 parent 3e14417 commit 9d93d9c

22 files changed

+228
-197
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

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.52.0</AssemblyVersion>
44
<PackageVersion>$(AssemblyVersion)</PackageVersion>
5-
<DriverVersion>1.52.0</DriverVersion>
5+
<DriverVersion>1.53.0-alpha-2025-05-21</DriverVersion>
66
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
77
<FileVersion>$(AssemblyVersion)</FileVersion>
88
<NoDefaultExcludes>true</NoDefaultExcludes>

src/Playwright.TestingHarnessTest/package-lock.json

Lines changed: 23 additions & 27 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.52.0",
5+
"@playwright/test": "1.53.0-alpha-2025-05-21",
66
"@types/node": "^22.12.0",
77
"fast-xml-parser": "^4.5.0"
88
}

src/Playwright.Tests/BrowserContextCookiesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ await Context.AddCookiesAsync(
211211
Name = "doggo",
212212
Value = "woofs"
213213
},
214-
]);
214+
]);
215215

216216
void ValidateCookies(IReadOnlyList<BrowserContextCookiesResult> cookies)
217217
{
@@ -230,6 +230,6 @@ void ValidateCookies(IReadOnlyList<BrowserContextCookiesResult> cookies)
230230
ValidateCookies(await Context.CookiesAsync("https://foo.com"));
231231
ValidateCookies(await Context.CookiesAsync(null as string));
232232
ValidateCookies(await Context.CookiesAsync(null as string[]));
233-
ValidateCookies(await Context.CookiesAsync([]));
233+
ValidateCookies(await Context.CookiesAsync(new string[] { }));
234234
}
235235
}

src/Playwright.Tests/PageAriaSnapshotTests.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,6 @@ await Expect(Page.Locator("body")).ToMatchAriaSnapshotAsync(@"
132132
StringAssert.Contains("- unexpected value", exception.Message);
133133
}
134134

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-
151135
[PlaywrightTest("to-match-aria-snapshot.spec.ts", "should match url")]
152136
public async Task ShouldMatchUrl()
153137
{

src/Playwright.Tests/TracingTests.cs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ await Context.Tracing.StartAsync(new()
6666
string[] expectedActionApiNames = new string[] { "BrowserContext.NewPageAsync", "Page.GotoAsync", "Page.SetContentAsync", "Page.ClickAsync", "Mouse.MoveAsync", "Mouse.DblClickAsync", "Keyboard.InsertTextAsync", "Page.WaitForTimeoutAsync", "Page.CloseAsync" };
6767
Assert.AreEqual(expectedActionApiNames, actualActionApiNames);
6868

69-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Page.GotoAsync").Count(), 1);
70-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Page.SetContentAsync").Count(), 1);
71-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Page.ClickAsync").Count(), 1);
72-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Mouse.MoveAsync").Count(), 1);
73-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Mouse.DblClickAsync").Count(), 1);
74-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Keyboard.InsertTextAsync").Count(), 1);
75-
Assert.GreaterOrEqual(events.Where(e => e?.ApiName == "Page.CloseAsync").Count(), 1);
69+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Page.GotoAsync").Count(), 1);
70+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Page.SetContentAsync").Count(), 1);
71+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Page.ClickAsync").Count(), 1);
72+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Mouse.MoveAsync").Count(), 1);
73+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Mouse.DblClickAsync").Count(), 1);
74+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Keyboard.InsertTextAsync").Count(), 1);
75+
Assert.GreaterOrEqual(events.Where(e => e?.Title == "Page.CloseAsync").Count(), 1);
7676

7777
Assert.GreaterOrEqual(events.Where(x => x.Type == "frame-snapshot").Count(), 1);
7878
Assert.GreaterOrEqual(events.Where(x => x.Type == "screencast-frame").Count(), 1);
@@ -101,21 +101,21 @@ public async Task ShouldCollectTwoTraces()
101101
{
102102
var (events, resources) = ParseTrace(trace1Path);
103103
Assert.AreEqual("context-options", events[0].Type);
104-
Assert.GreaterOrEqual(events.Where(x => x?.ApiName == "Page.GotoAsync").Count(), 1);
105-
Assert.GreaterOrEqual(events.Where(x => x?.ApiName == "Page.SetContentAsync").Count(), 1);
106-
Assert.GreaterOrEqual(events.Where(x => x?.ApiName == "Page.ClickAsync").Count(), 1);
107-
Assert.AreEqual(0, events.Where(x => x?.ApiName == "Page.CloseAsync").Count());
108-
Assert.AreEqual(0, events.Where(x => x?.ApiName == "Page.DblClickAsync").Count());
104+
Assert.GreaterOrEqual(events.Where(x => x?.Title == "Page.GotoAsync").Count(), 1);
105+
Assert.GreaterOrEqual(events.Where(x => x?.Title == "Page.SetContentAsync").Count(), 1);
106+
Assert.GreaterOrEqual(events.Where(x => x?.Title == "Page.ClickAsync").Count(), 1);
107+
Assert.AreEqual(0, events.Where(x => x?.Title == "Page.CloseAsync").Count());
108+
Assert.AreEqual(0, events.Where(x => x?.Title == "Page.DblClickAsync").Count());
109109
}
110110

111111
{
112112
var (events, resources) = ParseTrace(trace2Path);
113113
Assert.AreEqual("context-options", events[0].Type);
114-
Assert.AreEqual(0, events.Where(x => x?.ApiName == "Page.GottoAsync").Count());
115-
Assert.AreEqual(0, events.Where(x => x?.ApiName == "Page.SetContentAsync").Count());
116-
Assert.AreEqual(0, events.Where(x => x?.ApiName == "Page.ClickAsync").Count());
117-
Assert.GreaterOrEqual(events.Where(x => x?.ApiName == "Page.CloseAsync").Count(), 1);
118-
Assert.GreaterOrEqual(events.Where(x => x?.ApiName == "Page.DblClickAsync").Count(), 1);
114+
Assert.AreEqual(0, events.Where(x => x?.Title == "Page.GottoAsync").Count());
115+
Assert.AreEqual(0, events.Where(x => x?.Title == "Page.SetContentAsync").Count());
116+
Assert.AreEqual(0, events.Where(x => x?.Title == "Page.ClickAsync").Count());
117+
Assert.GreaterOrEqual(events.Where(x => x?.Title == "Page.CloseAsync").Count(), 1);
118+
Assert.GreaterOrEqual(events.Where(x => x?.Title == "Page.DblClickAsync").Count(), 1);
119119
}
120120

121121
}
@@ -415,6 +415,7 @@ private static (IReadOnlyList<TraceEventEntry> Events, Dictionary<string, byte[]
415415
private class TraceEventEntry
416416
{
417417
public string Type { get; set; }
418+
public string Title { get; set; }
418419
public string ApiName { get; set; }
419420
public TraceEventError Error { get; set; }
420421
public double StartTime { get; set; }
@@ -428,5 +429,5 @@ private class TraceEventError
428429
public string Message { get; set; }
429430
}
430431

431-
string[] GetActions(IReadOnlyList<TraceEventEntry> events) => events.Where(action => action.Type == "action").OrderBy(action => action.StartTime).Select(action => action.ApiName).ToArray();
432+
string[] GetActions(IReadOnlyList<TraceEventEntry> events) => events.Where(action => action.Type == "action").OrderBy(action => action.StartTime).Select(action => action.Title).ToArray();
432433
}

src/Playwright/API/Generated/ILocator.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@ public partial interface ILocator
341341
/// <param name="options">Call options</param>
342342
Task DblClickAsync(LocatorDblClickOptions? options = default);
343343

344+
/// <summary>
345+
/// <para>
346+
/// Describes the locator, description is used in the trace viewer and reports. Returns
347+
/// the locator pointing to the same element.
348+
/// </para>
349+
/// </summary>
350+
/// <param name="description">Locator description.</param>
351+
ILocator Describe(string description);
352+
344353
/// <summary>
345354
/// <para>Programmatically dispatch an event on the matching element.</para>
346355
/// <para>**Usage**</para>
@@ -474,6 +483,11 @@ public partial interface ILocator
474483
/// </para>
475484
/// <para>If <see cref="ILocator.EvaluateAsync"/> throws or rejects, this method throws.</para>
476485
/// <para>**Usage**</para>
486+
/// <para>Passing argument to <see cref="ILocator.EvaluateAsync"/>:</para>
487+
/// <code>
488+
/// var result = await page.GetByTestId("myId").EvaluateAsync&lt;string&gt;("(element, [x, y]) =&gt; element.textContent + ' ' + x * y)", new[] { 7, 8 });<br/>
489+
/// Console.WriteLine(result); // prints "myId text 56"
490+
/// </code>
477491
/// </summary>
478492
/// <param name="expression">
479493
/// JavaScript expression to be evaluated in the browser context. If the expression

src/Playwright/API/Generated/ILocatorAssertions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public partial interface ILocatorAssertions
230230
/// matched against the corresponding class in the array:
231231
/// </para>
232232
/// <code>
233-
/// var locator = Page.Locator("list &gt; .component");<br/>
233+
/// var locator = Page.Locator(".list &gt; .component");<br/>
234234
/// await Expect(locator).ToContainClassAsync(new string[]{"inactive", "active", "inactive"});
235235
/// </code>
236236
/// </summary>
@@ -261,7 +261,7 @@ public partial interface ILocatorAssertions
261261
/// matched against the corresponding class in the array:
262262
/// </para>
263263
/// <code>
264-
/// var locator = Page.Locator("list &gt; .component");<br/>
264+
/// var locator = Page.Locator(".list &gt; .component");<br/>
265265
/// await Expect(locator).ToContainClassAsync(new string[]{"inactive", "active", "inactive"});
266266
/// </code>
267267
/// </summary>
@@ -586,7 +586,7 @@ public partial interface ILocatorAssertions
586586
/// is matched against the corresponding string or regular expression in the array:
587587
/// </para>
588588
/// <code>
589-
/// var locator = Page.Locator("list &gt; .component");<br/>
589+
/// var locator = Page.Locator(".list &gt; .component");<br/>
590590
/// await Expect(locator).ToHaveClassAsync(new string[]{"component", "component selected", "component"});
591591
/// </code>
592592
/// </summary>
@@ -612,7 +612,7 @@ public partial interface ILocatorAssertions
612612
/// is matched against the corresponding string or regular expression in the array:
613613
/// </para>
614614
/// <code>
615-
/// var locator = Page.Locator("list &gt; .component");<br/>
615+
/// var locator = Page.Locator(".list &gt; .component");<br/>
616616
/// await Expect(locator).ToHaveClassAsync(new string[]{"component", "component selected", "component"});
617617
/// </code>
618618
/// </summary>
@@ -638,7 +638,7 @@ public partial interface ILocatorAssertions
638638
/// is matched against the corresponding string or regular expression in the array:
639639
/// </para>
640640
/// <code>
641-
/// var locator = Page.Locator("list &gt; .component");<br/>
641+
/// var locator = Page.Locator(".list &gt; .component");<br/>
642642
/// await Expect(locator).ToHaveClassAsync(new string[]{"component", "component selected", "component"});
643643
/// </code>
644644
/// </summary>
@@ -664,7 +664,7 @@ public partial interface ILocatorAssertions
664664
/// is matched against the corresponding string or regular expression in the array:
665665
/// </para>
666666
/// <code>
667-
/// var locator = Page.Locator("list &gt; .component");<br/>
667+
/// var locator = Page.Locator(".list &gt; .component");<br/>
668668
/// await Expect(locator).ToHaveClassAsync(new string[]{"component", "component selected", "component"});
669669
/// </code>
670670
/// </summary>

src/Playwright/API/Generated/ITracing.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ namespace Microsoft.Playwright;
3333
/// Playwright script runs.
3434
/// </para>
3535
/// <para>
36+
/// You probably want to <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enable
37+
/// tracing in your config file</a> instead of using <c>context.tracing</c>.
38+
/// </para>
39+
/// <para>
40+
/// The <c>context.tracing</c> API captures browser operations and network activity,
41+
/// but it doesn't record test assertions (like <c>expect</c> calls). We recommend <a
42+
/// href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enabling
43+
/// tracing through Playwright Test configuration</a>, which includes those assertions
44+
/// and provides a more complete trace for debugging test failures.
45+
/// </para>
46+
/// <para>
3647
/// Start recording a trace before performing actions. At the end, stop tracing and
3748
/// save it to a file.
3849
/// </para>
@@ -53,10 +64,31 @@ namespace Microsoft.Playwright;
5364
/// });
5465
/// </code>
5566
/// </summary>
67+
/// <remarks>
68+
/// <para>
69+
/// You probably want to <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enable
70+
/// tracing in your config file</a> instead of using <c>context.tracing</c>. The <c>context.tracing</c>
71+
/// API captures browser operations and network activity, but it doesn't record test
72+
/// assertions (like <c>expect</c> calls). We recommend <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enabling
73+
/// tracing through Playwright Test configuration</a>, which includes those assertions
74+
/// and provides a more complete trace for debugging test failures.
75+
/// </para>
76+
/// </remarks>
5677
public partial interface ITracing
5778
{
5879
/// <summary>
5980
/// <para>Start tracing.</para>
81+
/// <para>
82+
/// You probably want to <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enable
83+
/// tracing in your config file</a> instead of using <c>Tracing.start</c>.
84+
/// </para>
85+
/// <para>
86+
/// The <c>context.tracing</c> API captures browser operations and network activity,
87+
/// but it doesn't record test assertions (like <c>expect</c> calls). We recommend <a
88+
/// href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enabling
89+
/// tracing through Playwright Test configuration</a>, which includes those assertions
90+
/// and provides a more complete trace for debugging test failures.
91+
/// </para>
6092
/// <para>**Usage**</para>
6193
/// <code>
6294
/// using var playwright = await Playwright.CreateAsync();<br/>
@@ -75,6 +107,16 @@ public partial interface ITracing
75107
/// });
76108
/// </code>
77109
/// </summary>
110+
/// <remarks>
111+
/// <para>
112+
/// You probably want to <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enable
113+
/// tracing in your config file</a> instead of using <c>Tracing.start</c>. The <c>context.tracing</c>
114+
/// API captures browser operations and network activity, but it doesn't record test
115+
/// assertions (like <c>expect</c> calls). We recommend <a href="https://playwright.dev/docs/api/class-testoptions#test-options-trace">enabling
116+
/// tracing through Playwright Test configuration</a>, which includes those assertions
117+
/// and provides a more complete trace for debugging test failures.
118+
/// </para>
119+
/// </remarks>
78120
/// <param name="options">Call options</param>
79121
Task StartAsync(TracingStartOptions? options = default);
80122

0 commit comments

Comments
 (0)