Repository navigation
Conversation
…ps (codeceptjs#5820) Step.simplify() dropped the metaStep chain and JSON-serialized object arguments, so reporters in the main process saw within()/page object/ Section steps flat and locators as raw JSON (and secrets unmasked). simplify() now sends the meta step chain and humanized args; a shared deserializeStep() rebuilds MetaStep instances, sharing one instance per worker meta step so reporters can group by identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…codeceptjs#5820) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
The two failing checks also fail without this PR:
Created by AI agent (Claude Code) |
This branch has not been deployed
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.
Fixes #5820
Problem
Under
run-workers, steps reach main-process listeners as plain objects produced byStep.simplify()and rebuilt bydeserializeStep()/deserializeTest().simplify()droppedmetaStepand JSON-serialized object arguments, so reporters saw steps insidewithin(), page objects andSectionas flat, and locators as raw JSON such asI click "{"type":"xpath",...}". Secrets were also sent unmasked, e.g.{"_secret":"123"}.runandrun-multipleare not affected, because their reporters run in the same process as the tests and get the realStepobjects.Changes
lib/step/base.js:simplify()now sends:humanizedArgs, sotoString()in the main process matches the worker,toString()for arguments that have their own, such asLocator,Secretvalues, also one level deep inside plain objects.lib/step/meta.js:MetaStep.simplify()adds a uniqueid,actor,collapsedand itstoString()text. The text is needed for subclasses such aswithin()'s step, which print themselves differently.lib/step/deserialize.js(new): a shareddeserializeStep(), used bylib/workers.jsanddeserializeTest(). It rebuildsMetaStepinstances, and steps that shared one meta step in the worker share one instance again, so reporters can group by object identity. The cache holds only weak references, so it doesn't grow during a run.test/unit/step/deserialize_test.js: 7 new tests.Tests
Sectionandsecret(): underrun-workers, main-process steps now print the same as underrun.npx mocha test/unit --recursive: 979 passing.npx mocha test/runner/run_workers_test.js: 43 passing.run-workers 2 --grep within: 12 passed, 1 skipped.🤖 Generated with Claude Code