Skip to content

Conversation

@alpaca-tc
Copy link

This method returns the names of all currently active sessions that have been used with using_session. Its primary purpose is to call save_screenshot for multiple sessions when a test fails.

Previously, it was difficult to retrieve session names during tests. With this addition, developers can now easily obtain all session names and save screenshots for each active session, enhancing debugging capabilities in multi-session test scenarios.

Additional Information

For example, in Rails, the take_failed_screenshot method captures a screenshot when a test fails. https://github.com/rails/rails/blob/e6429269fd5a8a7d728557f4e7d7f82c0ad1478c/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L53-L58

Currently, this method only captures screenshots from the default session. However, when using multiple sessions with using_session, I would like to save screenshots for each active session. In Capybara’s current implementation, tracking the session names created with using_session is difficult, and the only workaround has been to override the method to achieve this functionality.

This method returns the names of all currently active sessions that have been used with `using_session`.
Its primary purpose is to call `save_screenshot` for multiple sessions when a test fails.

Previously, it was difficult to retrieve session names during tests. With this addition, developers
can now easily obtain all session names and save screenshots for each active session, enhancing
debugging capabilities in multi-session test scenarios.
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