CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

fix : naming convention session / main erasing with long test.title/tags

Open julien-ft-64 opened this issue 5 months ago • 1 comments

Motivation/Description of the PR

  • Description of this PR, which problem it solves Solve issue in some use case where videos and traces of Playwright are not saved correctly when using multiple sessions

fix : naming convention session / main erasing with long test.title/tags
--> file name of traces and video have title limited to 245 char and contains sessions name at end and test status, which in case of gherkin/bdd is not enough, the session name is truncated. Meaning all traces/videos of sessions are written to same file. Changed the naming to have the session before test title, therefore, having always a different file name

fix: context is funtion in session and not property --> in the sessions iteration, the access to context is not a property but a function, it resulted in getting out of saving because no tracing property existed. Added the () to context usage for sessions loop

fix : dual saving main session --> main session is also in the list of sessions, generating a Playwright error as the traces are already savec for the main session, and having 2 times the session saved. Added a check on session name to exclude it from the sessions loop.

  • Resolves #4981

Applicable helpers:

  • [X] Playwright
  • [ ] Puppeteer
  • [ ] WebDriver
  • [ ] REST
  • [ ] FileHelper
  • [ ] Appium
  • [ ] TestCafe

Applicable plugins:

  • [ ] allure
  • [ ] autoDelay
  • [ ] autoLogin
  • [ ] customLocator
  • [ ] pauseOnFail
  • [ ] coverage
  • [ ] retryFailedStep
  • [ ] screenshotOnFail
  • [ ] selenoid
  • [ ] stepByStepReport
  • [ ] stepTimeout
  • [ ] wdio
  • [ ] subtitles

Type of change

  • [ ] :fire: Breaking changes
  • [ ] :rocket: New functionality
  • [X] :bug: Bug fix
  • [ ] 🧹 Chore
  • [ ] :clipboard: Documentation changes/updates
  • [ ] :hotsprings: Hot fix
  • [ ] :hammer: Markdown files fix - not related to source code
  • [ ] :nail_care: Polish code

Checklist:

  • [ ] Tests have been added
  • [ ] Documentation has been added (Run npm run docs)
  • [X] Lint checking (Run npm run lint)
  • [X] Local tests are passed (Run npm test)

julien-ft-64 avatar May 14 '25 10:05 julien-ft-64