Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviour of waitForReady and delay #173

Open
pernsteinerc opened this issue Aug 19, 2021 · 1 comment
Open

Behaviour of waitForReady and delay #173

pernsteinerc opened this issue Aug 19, 2021 · 1 comment
Labels
question Further information is requested

Comments

@pernsteinerc
Copy link

pernsteinerc commented Aug 19, 2021

What is the behaviour of creevey if I set the following story parameters:

export default {
  parameters: {
    creevey: {
      waitForReady: true,
      delay: 2000,
    },
  },
}

Will creevey wait for the call of window.__CREEVEY_SET_READY_FOR_CAPTURE__.() and wait then 2000 ms to make the screenshot or will creevey make the screenshot immediately when window.__CREEVEY_SET_READY_FOR_CAPTURE__.() get's called?

@wKich
Copy link
Collaborator

wKich commented Aug 20, 2021

@pernsteinerc hi, the first option, creevey will wait for __CREEVEY_SET_READY_FOR_CAPTURE__ call and then wait 2000 ms. I guess the name or global function is confusing, because of how creevey works. It sends to a browser a request to switch the story or re-mount it and waits for a response. In a browser Creevey waits for when the story will be rendered in that moment story might want to update itself or load something asynchronous, that's where waitForReady plays the role. When the story gets stable, a browser sends a response to Creevey, where it waits for extra 2 seconds before capturing the screenshot.

@wKich wKich added the question Further information is requested label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants