Skip to content

Conversation

kobenguyent
Copy link
Collaborator

This PR fixes session-related issues in the Playwright helper:

Issues Fixed:

  1. Naming Convention: Changed session artifact naming from ${test.title}_${sessionName} to ${sessionName}_${test.title} to prevent file collisions when test titles are truncated
  2. Tracing Errors: Added graceful error handling for "Must start tracing before stopping" errors in session contexts
  3. Main Session Processing: Fixed duplicate main session processing by excluding empty session names

Changes Made:

  • lib/helper/Playwright.js: Updated _failed() and _passed() methods with improved session handling
  • test/helper/Playwright_test.js: Added comprehensive tests covering all fix scenarios

Testing:

  • ✅ All 4 new session tests pass
  • ✅ Validates proper naming convention
  • ✅ Tests error handling for invalid contexts
  • ✅ Ensures main session isn't duplicated

Related to issue: Session/Playwright traces naming convention and error handling improvements.

@kobenguyent kobenguyent merged commit ff63f70 into codeceptjs:3.x Aug 19, 2025
11 of 12 checks passed
@kobenguyent kobenguyent deleted the fix/session-playwright-traces-kobenguyent branch August 19, 2025 10: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.

1 participant