player-ui / player

Home Page:https://player-ui.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[JVM] Better `toString` representation of Player states

sugarmanz opened this issue · comments

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

Currently, printing out Player states as debug information isn't really useful, ex:

Expected Player to be in completed state with outcome 'doneWithFlow', but was in com.intuit.player.jvm.core.player.state.InProgressState@c556f15

Describe the solution you'd like

It'd be much better if InProgressState.toString() contained state information, ex:

Expected Player to be in completed state with outcome 'doneWithFlow', but was in InProgressState(flow: 'some-flow-id', view: 'some-view-id')

Additional context

This really extends to many of the various NodeWrapper APIs, so it might be prudent to try and solve for the generic case?