Skip to content

Commit 98434d0

Browse files
authored
chore: roll driver to 1.60.0-alpha-2026-03-31 (#3292)
1 parent c457c57 commit 98434d0

21 files changed

Lines changed: 301 additions & 318 deletions

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.58.0</AssemblyVersion>
44
<PackageVersion>$(AssemblyVersion)</PackageVersion>
5-
<DriverVersion>1.59.0-alpha-1774622285000</DriverVersion>
5+
<DriverVersion>1.60.0-alpha-2026-03-31</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.59.0-alpha-1774622285000",
5+
"@playwright/test": "1.60.0-alpha-2026-03-31",
66
"@types/node": "^22.12.0",
77
"fast-xml-parser": "^4.5.0"
88
}

src/Playwright.Tests/ScreencastTests.cs

Lines changed: 64 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -127,48 +127,6 @@ public async Task ShouldExposeVideoPathBlankPage()
127127
Assert.True(new FileInfo(path).Exists);
128128
}
129129

130-
[PlaywrightTest("screencast.spec.ts", "should expose video path blank popup")]
131-
[Ignore("We don't need to test video details")]
132-
public void ShouldExposeVideoPathBlankPopup()
133-
{
134-
}
135-
136-
[PlaywrightTest("screencast.spec.ts", "should capture navigation")]
137-
[Ignore("We don't need to test video details")]
138-
public void ShouldCaptureNavigation()
139-
{
140-
}
141-
142-
[PlaywrightTest("screencast.spec.ts", "should capture css transformation")]
143-
[Ignore("We don't need to test video details")]
144-
public void ShouldCaptureCssTransformation()
145-
{
146-
}
147-
148-
[PlaywrightTest("screencast.spec.ts", "should work for popups")]
149-
[Ignore("We don't need to test video details")]
150-
public void ShouldWorkForPopups()
151-
{
152-
}
153-
154-
[PlaywrightTest("screencast.spec.ts", "should scale frames down to the requested size")]
155-
[Ignore("We don't need to test video details")]
156-
public void ShouldScaleFramesDownToTheRequestedSize()
157-
{
158-
}
159-
160-
[PlaywrightTest("screencast.spec.ts", "should use viewport as default size")]
161-
[Ignore("We don't need to test video details")]
162-
public void ShouldUseViewportAsDefaultSize()
163-
{
164-
}
165-
166-
[PlaywrightTest("screencast.spec.ts", "should be 1280x720 by default")]
167-
[Ignore("We don't need to test video details")]
168-
public void ShouldBe1280x720ByDefault()
169-
{
170-
}
171-
172130
[PlaywrightTest("screencast.spec.ts", "should capture static page in persistent context")]
173131
[Skip(SkipAttribute.Targets.Webkit, SkipAttribute.Targets.Firefox)]
174132
public async Task ShouldCaptureStaticPageInPersistentContext()
@@ -259,4 +217,68 @@ public async Task SaveAsShouldThrowWhenNoVideoFrames()
259217
StringAssert.Contains("Page did not produce any video frames", exception.Message);
260218
await context.CloseAsync();
261219
}
220+
221+
[PlaywrightTest("screencast.spec.ts", "start throws if screencast is already started")]
222+
public async Task StartThrowsIfScreencastIsAlreadyStarted()
223+
{
224+
var context = await Browser.NewContextAsync(new() { ViewportSize = new() { Width = 500, Height = 400 } });
225+
var page = await context.NewPageAsync();
226+
227+
await page.Screencast.StartAsync(new() { OnFrame = _ => Task.CompletedTask });
228+
var exception = await PlaywrightAssert.ThrowsAsync<PlaywrightException>(() =>
229+
page.Screencast.StartAsync(new() { OnFrame = _ => Task.CompletedTask }));
230+
StringAssert.Contains("Screencast is already started", exception.Message);
231+
232+
await page.Screencast.StopAsync();
233+
await context.CloseAsync();
234+
}
235+
236+
[PlaywrightTest("screencast.spec.ts", "start should record video to file")]
237+
public async Task StartShouldRecordVideoToFile()
238+
{
239+
using var tempDirectory = new TempDirectory();
240+
var context = await Browser.NewContextAsync(new()
241+
{
242+
ViewportSize = new() { Width = 500, Height = 400 }
243+
});
244+
var page = await context.NewPageAsync();
245+
246+
var videoPath = Path.Combine(tempDirectory.Path, "video.webm");
247+
await page.Screencast.StartAsync(new() { Path = videoPath });
248+
await page.EvaluateAsync("() => document.body.style.backgroundColor = 'red'");
249+
await Task.Delay(1000);
250+
await page.Screencast.StopAsync();
251+
252+
Assert.True(File.Exists(videoPath));
253+
Assert.Greater(new FileInfo(videoPath).Length, 0);
254+
await context.CloseAsync();
255+
}
256+
257+
[PlaywrightTest("screencast.spec.ts", "start delivers frames via onFrame callback")]
258+
public async Task StartDeliversFramesViaOnFrameCallback()
259+
{
260+
var context = await Browser.NewContextAsync(new() { ViewportSize = new() { Width = 500, Height = 400 } });
261+
var page = await context.NewPageAsync();
262+
263+
var frames = new List<byte[]>();
264+
await page.Screencast.StartAsync(new()
265+
{
266+
OnFrame = async frame =>
267+
{
268+
frames.Add(frame.Data);
269+
}
270+
});
271+
await page.EvaluateAsync("() => document.body.style.backgroundColor = 'red'");
272+
await Task.Delay(1000);
273+
await page.Screencast.StopAsync();
274+
275+
Assert.Greater(frames.Count, 0);
276+
// Each frame must be a valid JPEG (starts with FF D8).
277+
foreach (var frame in frames)
278+
{
279+
Assert.AreEqual(0xFF, frame[0]);
280+
Assert.AreEqual(0xD8, frame[1]);
281+
}
282+
await context.CloseAsync();
283+
}
262284
}

src/Playwright/API/Generated/IDebugger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public partial interface IDebugger
4444
/// is not paused.
4545
/// </para>
4646
/// </summary>
47-
PausedDetail? PausedDetails { get; }
47+
DebuggerPausedDetails? PausedDetails { get; }
4848

4949
/// <summary>
5050
/// <para>Configures the debugger to pause before the next action is executed.</para>

src/Playwright/API/Generated/IPage.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,8 +1601,6 @@ public partial interface IPage
16011601

16021602
public IMouse Mouse { get; }
16031603

1604-
public IOverlay Overlay { get; }
1605-
16061604
/// <summary>
16071605
/// <para>
16081606
/// Returns the opener for popup pages and <c>null</c> for others. If the opener has
@@ -3034,12 +3032,11 @@ public partial interface IPage
30343032

30353033
/// <summary>
30363034
/// <para>
3037-
/// Video object associated with this page. Can be used to control video recording with
3038-
/// <see cref="IVideo.StartAsync"/> and <see cref="IVideo.StopAsync"/>, or to access
3039-
/// the video file when using the <c>recordVideo</c> context option.
3035+
/// Video object associated with this page. Can be used to access the video file when
3036+
/// using the <c>recordVideo</c> context option.
30403037
/// </para>
30413038
/// </summary>
3042-
IVideo Video { get; }
3039+
IVideo? Video { get; }
30433040

30443041
PageViewportSizeResult? ViewportSize { get; }
30453042

src/Playwright/API/Generated/IOverlay.cs renamed to src/Playwright/API/Generated/IScreencast.cs

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,28 @@
2727

2828
namespace Microsoft.Playwright;
2929

30-
/// <summary>
31-
/// <para>
32-
/// Interface for managing page overlays that display persistent visual indicators on
33-
/// top of the page.
34-
/// </para>
35-
/// </summary>
36-
public partial interface IOverlay
30+
/// <summary><para>Interface for capturing screencast frames from a page.</para></summary>
31+
public partial interface IScreencast
3732
{
33+
/// <summary>
34+
/// <para>
35+
/// Starts the screencast. When <see cref="IScreencast.StartAsync"/> is provided, it
36+
/// saves video recording to the specified file. When <see cref="IScreencast.StartAsync"/>
37+
/// is provided, delivers JPEG-encoded frames to the callback. Both can be used together.
38+
/// </para>
39+
/// <para>**Usage**</para>
40+
/// </summary>
41+
/// <param name="options">Call options</param>
42+
Task<IAsyncDisposable> StartAsync(ScreencastStartOptions? options = default);
43+
44+
/// <summary>
45+
/// <para>
46+
/// Stops the screencast and video recording if active. If a video was being recorded,
47+
/// saves it to the path specified in <see cref="IScreencast.StartAsync"/>.
48+
/// </para>
49+
/// </summary>
50+
Task StopAsync();
51+
3852
/// <summary>
3953
/// <para>
4054
/// Adds an overlay with the given HTML content. The overlay is displayed on top of
@@ -43,7 +57,7 @@ public partial interface IOverlay
4357
/// </summary>
4458
/// <param name="html">HTML content for the overlay.</param>
4559
/// <param name="options">Call options</param>
46-
Task<IAsyncDisposable> ShowAsync(string html, OverlayShowOptions? options = default);
60+
Task<IAsyncDisposable> ShowOverlayAsync(string html, ScreencastShowOverlayOptions? options = default);
4761

4862
/// <summary>
4963
/// <para>
@@ -54,9 +68,11 @@ public partial interface IOverlay
5468
/// </summary>
5569
/// <param name="title">Title text displayed prominently in the overlay.</param>
5670
/// <param name="options">Call options</param>
57-
Task ChapterAsync(string title, OverlayChapterOptions? options = default);
71+
Task ShowChapterAsync(string title, ScreencastShowChapterOptions? options = default);
72+
73+
/// <summary><para>Shows overlays.</para></summary>
74+
Task ShowOverlaysAsync();
5875

59-
/// <summary><para>Sets visibility of all overlays without removing them.</para></summary>
60-
/// <param name="visible">Whether overlays should be visible.</param>
61-
Task SetVisibleAsync(bool visible);
76+
/// <summary><para>Hides overlays without removing them.</para></summary>
77+
Task HideOverlaysAsync();
6278
}

src/Playwright/API/Generated/IVideo.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* SOFTWARE.
2323
*/
2424

25-
using System;
2625
using System.Threading.Tasks;
2726

2827
namespace Microsoft.Playwright;
@@ -33,16 +32,6 @@ namespace Microsoft.Playwright;
3332
/// a video object associated with it.
3433
/// </para>
3534
/// <code>Console.WriteLine(await page.Video.GetPathAsync());</code>
36-
/// <para>
37-
/// Alternatively, you can use <see cref="IVideo.StartAsync"/> and <see cref="IVideo.StopAsync"/>
38-
/// to record video manually. This approach is mutually exclusive with the <c>recordVideo</c>
39-
/// option.
40-
/// </para>
41-
/// <code>
42-
/// await page.Video.StartAsync(new() { Path = "video.webm" });<br/>
43-
/// // ... perform actions ...<br/>
44-
/// await page.Video.StopAsync();
45-
/// </code>
4635
/// </summary>
4736
public partial interface IVideo
4837
{
@@ -67,22 +56,4 @@ public partial interface IVideo
6756
/// </summary>
6857
/// <param name="path">Path where the video should be saved.</param>
6958
Task SaveAsAsync(string path);
70-
71-
/// <summary>
72-
/// <para>
73-
/// Starts video recording. This method is mutually exclusive with the <c>recordVideo</c>
74-
/// context option.
75-
/// </para>
76-
/// <para>**Usage**</para>
77-
/// <code>
78-
/// await page.Video.StartAsync(new() { Path = "video.webm" });<br/>
79-
/// // ... perform actions ...<br/>
80-
/// await page.Video.StopAsync();
81-
/// </code>
82-
/// </summary>
83-
/// <param name="options">Call options</param>
84-
Task<IAsyncDisposable> StartAsync(VideoStartOptions? options = default);
85-
86-
/// <summary><para>Stops video recording started with <see cref="IVideo.StartAsync"/>.</para></summary>
87-
Task StopAsync();
8859
}

src/Playwright/API/Generated/Options/OverlayChapterOptions.cs renamed to src/Playwright/API/Generated/Options/ScreencastShowChapterOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
namespace Microsoft.Playwright;
2828

29-
public class OverlayChapterOptions
29+
public class ScreencastShowChapterOptions
3030
{
31-
public OverlayChapterOptions() { }
31+
public ScreencastShowChapterOptions() { }
3232

33-
public OverlayChapterOptions(OverlayChapterOptions clone)
33+
public ScreencastShowChapterOptions(ScreencastShowChapterOptions clone)
3434
{
3535
if (clone == null)
3636
{

0 commit comments

Comments
 (0)