Skip to content

chore: roll to 1.53.0-beta-1749131401000#3187

Merged
dgozman merged 3 commits into
microsoft:mainfrom
dgozman:roll-1.53.0-beta-1749131401000
Jun 6, 2025
Merged

chore: roll to 1.53.0-beta-1749131401000#3187
dgozman merged 3 commits into
microsoft:mainfrom
dgozman:roll-1.53.0-beta-1749131401000

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented Jun 5, 2025

References #3149.

@mxschmitt mxschmitt requested a review from Copilot June 5, 2025 14:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR bumps the version to 1.53.0-beta-1749131401000 and refactors internal APIs for improved error messaging and consistency across browser and page handling. Key changes include updates to the video recording and HAR recording options, conversion of API calls to use new error message titles, and renaming of internal flags to better reflect state.

Reviewed Changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Playwright/Core/Page.cs Updated null checks and replaced Context.CloseWasCalled with ClosingOrClosed for clarity.
src/Playwright/Core/Mouse.cs Refactored DblClickAsync to wrap API calls with an explicit title.
src/Playwright/Core/Locator.cs Added title parameters to WithElementAsync calls and adjusted ExpectAsync signatures.
src/Playwright/Core/LocalUtils.cs Removed the call to MarkAsInternalType for internal type management.
src/Playwright/Core/BrowserType.cs Replaced DidLaunchBrowser with ConnectToBrowserType and updated HAR options handling.
src/Playwright/Core/BrowserContext.cs Replaced CloseWasCalled with ClosingOrClosed and refactored HAR recording initialization.
src/Playwright/Core/Browser.cs Updated context creation and browser connection handling to use the new APIs.
Tests and package files Updated expected error message texts and bumped version numbers accordingly.
Files not reviewed (1)
  • src/Playwright.TestingHarnessTest/package-lock.json: Language not supported
Comments suppressed due to low confidence (4)

src/Playwright/Core/AssertionsBase.cs:165

  • Consider providing a fallback or a more descriptive error message for unknown expect expressions to help developers diagnose missing mappings instead of immediately throwing an exception.
throw new PlaywrightException($"Unknown expect expression: {expression}");

src/Playwright/Core/Page.cs:1313

  • Ensure that the change from 'CloseWasCalled' to 'ClosingOrClosed' is consistently applied and documented across both page and context usage for clarity in tracking closure state.
if (CloseWasCalled || Context.ClosingOrClosed)

src/Playwright/Core/BrowserType.cs:154

  • Review the new handling of HAR recording options and the JSON structure being sent to ensure compatibility with existing consumers and that the updated structure meets all expected behaviors.
JsonElement result = await SendMessageToServerAsync<JsonElement>("launchPersistentContext", channelArgs).ConfigureAwait(false);

src/Playwright/Core/LocalUtils.cs:38

  • Confirm that removing the call to MarkAsInternalType does not adversely affect internal type resolution or related reflection‐based operations.
MarkAsInternalType();

Comment thread src/Playwright.Tests/Assertions/LocatorAssertionsTests.cs Outdated
Assert.AreEqual(0, context.Pages.Count);
// Next line should not throw.
await context.CloseAsync();
tmp.Dispose();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to follow-up that tmp.Dispose so it uses await using.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolving so we can act on it afterwards.

"BrowserContext.newPage",
"Frame.goto",
"Frame.setContent",
"BrowserContext.waitForEventInfo",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a strong fan of this waitForEventInfo here, since its internal! It should stay RunAndWaitForPageAsync or something related to that.

Comment thread src/Playwright.Tests/TracingTests.cs
Comment thread src/Playwright.Tests/TracingTests.cs
Comment thread src/Playwright/Core/BrowserContext.cs
Comment thread src/Playwright/Core/BrowserType.cs
Comment thread src/Playwright/Core/BrowserType.cs
Comment thread src/Playwright/Transport/Connection.cs Outdated
public Core.Tracing Tracing { get; set; } = null!;

[JsonPropertyName("options")]
public Options Options { get; set; } = null!;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be great to rename

@dgozman dgozman force-pushed the roll-1.53.0-beta-1749131401000 branch from 32c42c8 to 6260823 Compare June 6, 2025 08:14
@dgozman dgozman requested a review from Skn0tt June 6, 2025 08:15
Comment thread src/Playwright.Tests/PdfTests.cs
@dgozman dgozman merged commit 4c96de7 into microsoft:main Jun 6, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants