feat: PER-7348 add waitForReady() call before serialize()#426
Draft
Shivanshu-07 wants to merge 1 commit intomasterfrom
Draft
feat: PER-7348 add waitForReady() call before serialize()#426Shivanshu-07 wants to merge 1 commit intomasterfrom
Shivanshu-07 wants to merge 1 commit intomasterfrom
Conversation
Adds the readiness gate from percy/cli#2184. New WaitForReady() internal helper runs PercyDOM.waitForReady via ExecuteAsyncScript (callback signal) BEFORE the existing PercyDOM.serialize ExecuteScript inside getSerializedDom. Diagnostics are attached to domSnapshot as readiness_diagnostics. Serialize is unchanged. Config precedence: options["readiness"] > cliConfig.snapshot.readiness > empty (CLI applies balanced default). Backward compat via in-browser typeof guard. Disabled preset short-circuits. Graceful on any exception. Tests: two integration-style Facts exercise readiness-enabled and readiness-disabled paths via the public Snapshot API. dotnet build Percy/Percy.csproj → 0 errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the readiness gate from percy/cli#2184 (PER-7348). New
WaitForReady(driver, options)internal helper runsPercyDOM.waitForReadyviaExecuteAsyncScript(callback signal) before the existing serializeExecuteScriptinsidegetSerializedDom. Diagnostics are attached to the snapshot asreadiness_diagnostics. Serialize is unchanged.Contract
options["readiness"]→cliConfig.snapshot.readiness→ empty (CLIbalanceddefault)typeof PercyDOM.waitForReady === 'function'guardTests
Two
[Fact]tests inUnitTests:readiness: { preset: "balanced" }→ snapshot postsreadiness: { preset: "disabled" }→ snapshot postsTest results
dotnet build Percy/Percy.csproj)dotnet test)Related