Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Fix Implemented

Fixed the issue where steps are not printed in logs when running --verbose or --debug and the I actor method is called indirectly (e.g., in custom steps or page objects) without calling any child I steps.

Changes Made

  • Investigate the MetaStep.run() method in lib/step/meta.js
  • Emit event.step.started for MetaStep when it has no child steps
  • Ensure proper event.step.finished emission for MetaStep
  • Test the fix with custom steps that don't call I
  • Run existing acceptance tests to ensure no regression
  • Add unit tests for the fix
  • Code review
  • Security scan with CodeQL

Technical Details

Root Cause: MetaStep.run() method never emitted step events for itself. It only registered a listener to attach itself to child steps. If no child steps were called, the MetaStep was never printed.

Solution:

  • Track whether any child steps are registered during MetaStep execution using a hasChildSteps flag
  • Only emit event.step.started and event.step.finished events if no child steps were registered
  • This avoids duplicate printing when MetaSteps have children (existing logic handles those)
  • Works correctly for both sync and async MetaSteps

Test Results:

  • ✅ MetaStep without child steps: Now prints correctly
  • ✅ MetaStep with child steps: No duplication
  • ✅ Page Objects calling I: Works correctly
  • ✅ Existing tests: No regression
  • ✅ Added 6 new unit tests: All passing
Original prompt

Investigate and fix the issue that steps are not printed out in logs when running either --verbose or --debug when we have I actor is called not directly in Scenario test file.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI requested a review from kobenguyent November 17, 2025 11:11
@kobenguyent kobenguyent marked this pull request as ready for review November 17, 2025 11:44
@kobenguyent kobenguyent merged commit 75bf99e into 4.x Nov 17, 2025
10 checks passed
@kobenguyent kobenguyent deleted the copilot/fix-logging-steps-issue branch November 17, 2025 12:15
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.

2 participants