robottelo icon indicating copy to clipboard operation
robottelo copied to clipboard

ui_session: return airgun session as a context manager

Open pnovotny opened this issue 9 months ago • 9 comments

Problem Statement

If a UI test is using the new session approach via target_sat.ui_session(), the browser window is not closed at the end of the test. Also the screenshot is not taken if the test fails.

Solution

Satellite.ui_session() method needs to return the airgun Session as a context manager, so the __exit__ method is called, which handles screenshot capture and closing the browser window.

pnovotny avatar May 13 '24 16:05 pnovotny