maestro icon indicating copy to clipboard operation
maestro copied to clipboard

upon test failure having hierarchy & screenshot in html log file would be of great help

Open M-heiba opened this issue 1 year ago • 1 comments

While using Maestro to develop test cases or to debug failed ones, it would be very nice if we can have some artifacts that help to track out what has been wrong causing the test to fail. It would be of great help to have some sort of report or log file including the following :

  1. file layout would be something as the console output referring to the failed test step
  2. dumping the screen hierarchy XML.
  3. A screenshot of the device under test at the time of failure.
  4. Stacktrace or more detailed error messages

This would help identify the reason for failure, if it is a bug or a test script, to update easily and improve the development speed of test scripts.

I was trying to use Maestro as a POC and I ended up with the following screenshot of my console : Untitled

As it is described, the test was failing the first time with the text on the screen of the device I have in my hand, yet I could not debug the reason for the failure. In the second run, I used the whole element text ( not the partial text as the first time ), and yet it failed with no way to know the exact reason for failure ( text was displayed on the screen clearly before failure ) In the third run, I used a different text of a different element, and yet it failed with no way to identify what was the reason for the failure.

This will also help in unattended runs to be able to identify the failed cases easily.

M-heiba avatar Sep 27 '22 22:09 M-heiba

This is really good feedback @M-heiba and improved debuggability is definitely on the radar. Stay tuned!

Leland-Takamine avatar Sep 27 '22 22:09 Leland-Takamine

Any news on this?

Waltari10 avatar Feb 25 '23 20:02 Waltari10

Any updates on this? This would really help in debugging test case failures..

kunalverma25 avatar Mar 23 '23 16:03 kunalverma25

Hi everyone! @ArthurSav is working on better debug output here so stay tuned for this: https://github.com/mobile-dev-inc/maestro/pull/988

axelniklasson avatar May 03 '23 13:05 axelniklasson

This is available in latest release of maestro: https://maestro.mobile.dev/troubleshooting/debug-output

amanjeetsingh150 avatar Aug 10 '23 11:08 amanjeetsingh150

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!

github-actions[bot] avatar Jul 11 '24 11:07 github-actions[bot]