Skip to content

Multi sessions screenshotOnFail not working correctly.  #4623

Closed
@Nozeren

Description

@Nozeren

What are you trying to achieve?

Few months ago I asked if there's a way to save a screenshotAfterFail of a session + the original browser with Webdriver post .
A pr was created but looks like it doesn't work 100% of the time, I can't get all the screenshots like in the PR description.

I made a version of the test created on the PR to test it out.


Scenario('should save screenshot for sessions @session', async ({ I }) => {
  await I.amOnPage('/');
  await I.saveScreenshot('original.png');
  await I.amOnPage('/browsevideos');
  await I.saveScreenshot('main_session.png');
  session('john', async () => {
    await I.amOnPage('/browsevideos');
    await I.see('Fake text'); // Fails here
  });
});

What do you get instead?

I get all the screenshots except the after fail screenshot of the main browser.
image
but appears as artificat on the output
image

Output with ---verbose

 › john - Screenshot is saving to ./output/john_should_save_screenshot_for_sessions_@session.failed.png
 › Screenshot of john session has been saved to ./output/john_should_save_screenshot_for_sessions_@session.failed.png
 › <Error: ENOENT: no such file or directory, open './output/should_save_screenshot_for_sessions_@session.failed.png'>

Details

  • CodeceptJS version: 3.6.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions