diff mbox series

[28/28] toaster/tests/selenium_helper_base: Dump a screenshot into tmp upon failure

Message ID 20241023095949.3351980-28-richard.purdie@linuxfoundation.org
State New
Headers show
Series [01/28] toaster/test/functional: Move _create_test_new_project to base class as helper | expand

Commit Message

Richard Purdie Oct. 23, 2024, 9:59 a.m. UTC
If we fail to have an element display, dump a screenshot into /tmp since
debugging these issues is painful and a screenshot can help a lot.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/toaster/tests/browser/selenium_helpers_base.py | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/lib/toaster/tests/browser/selenium_helpers_base.py b/lib/toaster/tests/browser/selenium_helpers_base.py
index 6953541ab5..798aa9e448 100644
--- a/lib/toaster/tests/browser/selenium_helpers_base.py
+++ b/lib/toaster/tests/browser/selenium_helpers_base.py
@@ -122,6 +122,7 @@  class Wait(WebDriverWait):
             if time.time() > end_time:
                 break
 
+        self._driver.get_screenshot_as_file("/tmp/toaster-failing-screenshot-%s.png" % int(time.time()))
         raise TimeoutException(message)
 
     def until_not(self, method, message=''):