Forum Discussion

arunbharath's avatar
arunbharath
Contributor
2 years ago

BitBar - How to fail the entire test run if test cases failed

I'm using Bitbar to run my mobile automation. I can even automation fails session run shows as success. Is there any way that we can fail the test run if any of the rest cases failed? 

3 Replies

  • Hi arunbharath ,

    Today, BitBar shows whether the cloud session succeeded, however, we have on our roadmap to show additional status updates on sessions. Would you be willing to chat about what specifically you'd like to see in the results?

    Best,

    Jaymie Falconi, Product Manager - BitBar

  • hey arunbharath 

    in order to set device session status to failed, you can use POST broker endpoint 

    *BROKER_ADDRESS*/sessions/*ID*, and pass parameter "state = FAILED"  in the body. Endpoint support only  application/x-www-form-urlencoded

    f.i. for eu mobile hub, it looks like this

    POST eu-mobile-hub.bitbar.com/sessions/*id*
    {state = FAILED}

  • mickhence's avatar
    mickhence
    New Contributor

    To fail the entire test run if any test cases fail in BitBar, you can set the "failBuildOnFailedTests" parameter to true in your BitBar configuration. This ensures that if any test case fails, the entire test run is marked as failed.