maestro icon indicating copy to clipboard operation
maestro copied to clipboard

[Feature Request] Add onSuccess/onFaill/onFinish callbacks

Open retyui opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Right now there is no ability to run a custom script when test finish

it's will be useful in case integration with third party services

Describe the solution you'd like

we can use a special syntax to solve it

appId: com.example.app
runScript:
  - onFinish: reportStatatus.js # on success|fail
  - onSucess: reportStatatus.js # on fail
  - onFail: reportStatatus.js   # on sucess
---
- runFlow: Login.yaml # <-- Run commands from "Login.yaml"
- tapOn: Profile
- assertVisible: "Name: Test User"

Describe alternatives you've considered

also we can use a config.yaml to define onFail onSuccess section

Additional context

also we need somehow pass an extra information to that script

  • test filename
  • status (success/fail)
  • error (if it is fail)
  • ...

retyui avatar May 12 '23 08:05 retyui

+1 on this. Right now I'm trying to send test results to a test management tool, but having a hard time sending "Failed" results because there's no "onFail" hook or something similar to run the API call before the execution is interrupted.

lucashdoa avatar May 05 '24 13:05 lucashdoa

This is a valid feature request, thanks!

See also: onFlowStart/onFlowComplete callbacks

bartekpacia avatar Aug 15 '24 21:08 bartekpacia