-
-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Description
In CodeceptJS 3.7.x, using the tryTo
effect inside a session
makes a test hang forever. This works as expected in v3.6.10 with the old global tryTo
plugin.
Simple example:
import { tryTo } from "codeceptjs/effects";
Scenario("[SESSION1]", async ({ I }) => {
await tryTo(() => {
I.say("SESSION1");
});
});
Scenario("[SESSION2]", async ({ I }) => {
await session("SESSION2", () => {
I.say("SESSION2");
});
});
Scenario("[SESSION3]", async ({ I }) => {
await session("SESSION3", async () => {
await tryTo(() => {
I.say("SESSION3");
});
});
});
The third test case "SESSION3" will never end.
As far as I can tell from debugging inside the CodeceptJS source code, the root cause is that both session
and tryTo
want to start a new session via recorder.session.start()
. But inside this function, an existing session is considered to be an error, and the outer session will be reset.
https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/recorder.js#L125
Copilot
Metadata
Metadata
Assignees
Labels
No labels