having playwright trace when using multiple sessions sessions
Hello,
Here is my use case : i'm using 2 sessions using playwright as driver with trace enabled for failed tests, with bdd enabled and allure reporting.
When a test fails, there allure report manage the multiples sessions on steps like console logs but trace folder only contains main/default browser and not the created sessions browser instance.
Would it be possible to enable traces when a session is created, adding session name to zip file would also be nice.
Thank you.
I guess it was implemented by this https://github.com/codeceptjs/CodeceptJS/pull/3505/files#diff-5dc6e0a9028f00d161e530bc3b734e92d0497c131429e67b07e87a9224e4ecdaR2053 and available since https://codecept.io/changelog/#_3-3-7
Hello,
I'm on 3.6.3, the playwright helper does have the same code but it's not saving traces.
i added some console output in the helper in node modules, it does iterate on sessions, and context is not null but no trace file are saved for other sessions. Only main one
I think i tackle the issue root cause , i changed the .context in session usage to context() (for session it's a function, not a property)
and another issue : the naming convention, putting sessionname before testname as it's length is limited to 245 char is save function. When having gherkin with tags it make the same shortenned name, and the default session being written last, it overwrite the "previous" one(s).
test.artifacts[`trace_${sessionName}`] = await saveTraceForContext(
this.sessionPages[sessionName].context(),
`${sessionName}_${test.title}.failed`
)
i would have made a PR but i'm also now getting an error due to playwrigth trace management that i don't know how to prevent:
Error: tracing.stop: Must start tracing before stopping
Found the reason of the error (main session was saved before loop and inside sessions loop).
Made a PR about this use case : #4992
This issue is stale because it has been open for 90 days with no activity.
closed in favor of https://github.com/codeceptjs/CodeceptJS/pull/5073