lucky_flow icon indicating copy to clipboard operation
lucky_flow copied to clipboard

Add a fancy debug page

Open paulcsmith opened this issue 6 years ago • 0 comments

Rough idea:

  • Save html page for each spec to tmp/lucky_flow/debug_pages/. Example: tmp/lucky_flow/debug_pages/signs-a-user-in-spec.html
  • Show what interactions happened (Ran click "@heading", Ran fill UserForm, etc.) on a pane to the left
  • Clicking what happened in the left plane (click "@heading") shows screenshot of the page on the right
  • Would love to also include styles and images, but since the server stops after spec ends it could be really hard
    • Maybe copy assets and rewrite the asset URLs the page? Probably too much for v1
  • Also allow frameworks to extend the page and show other debug info
    • What page was rendered
    • What action rendered it
    • What assigns were passed to it
      • forms - so you can see forms
      • context
      • headers, etc.
      • session
    • Allow customizing objects TheObjext#lucky_flow_inspect
      • So for forms you might show how if there are errors in an easily digestible way * Or queries might show the SQL that it had and the results

Examples of left pane

  • Click “@heading” with text “adds”
  • Fill UserForm
  • Should have “@heading” with text “adds”

Example of right pane

Click "@heading" with text "adds"

Details

  • On page Users::IndexPage
    • Data:
    • Users: <UserQuery#lucky_flow_inspect> which would print the SQL that was run, number of results, etc.
  • Rendered by Users::Index
  • Params
  • Headers

paulcsmith avatar Jul 02 '18 14:07 paulcsmith