Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

debug runBefore code #30

Closed
jonathanadler opened this issue Jan 16, 2020 · 4 comments
Closed

debug runBefore code #30

jonathanadler opened this issue Jan 16, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@jonathanadler
Copy link

Hey,

The runBefore property is really great.
However, sometimes the code in this part can get a bit long and complicated, and I wonder if there's a way to debug it.

Thanks

@danielschwartz85 danielschwartz85 added the enhancement New feature or request label Jan 30, 2020
@danielschwartz85
Copy link
Contributor

danielschwartz85 commented Jan 30, 2020

Hi,
Thanks for raising this and sorry for the late response.

We will consider adding something for debugging this and update, until then I suggest doing the following:

  1. open you're storybook in chrome
  2. select your story
  3. open Dev tools
  4. switch console iframe to "storybook-preview-iframe" (in console frame select) - this is you're story's frame.
  5. run the following :
    either by pasting to console or adding a snippet (sources -> add snippet)
const rootEl = document.getElementById('root')
const story = __STORYBOOK_CLIENT_API__.raw().find(s => s.id === __STORYBOOK_STORY_STORE__.getSelection().storyId)
// now run your runBefore function:
runBefore({rootEl, story})

@jonathanadler
Copy link
Author

Awesome I'll try that, thanks!

@danielschwartz85
Copy link
Contributor

@jonathanadler note that I have edited the original script for a simpler solution ( you can click your story and then run the runBefore function )

@amitzur
Copy link
Member

amitzur commented Feb 20, 2020

This repository is going to be archived and moved into the monorepo of all Applitools SDK's.
For new issues on this SDK, please file them at https://github.com/applitools/eyes.sdk.javascript1

@amitzur amitzur closed this as completed Feb 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants