You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario that my application directly triggers some graphql query requests when opening the page. I would like to intercept these requests with laika, but I can't find a way to get access to the laika window property before the requests are triggered. I'm using playwright for my e2e/ui tests.
The problem is now that by the time I have the laika object and can call laika.intercept, the requests is already completed and I don't receive the mocked data.
The only way I found to intercept these initial queries is to intercept them inside the onLaikaReady callback funtion:
But this approach moves the interception logic into the actual application and I can't override this mock results from within the test file. Is there a way to set the onLaikaReady callback from within the tests?
Thanks!
The text was updated successfully, but these errors were encountered:
Hey,
I have a scenario that my application directly triggers some graphql query requests when opening the page. I would like to intercept these requests with laika, but I can't find a way to get access to the laika window property before the requests are triggered. I'm using playwright for my e2e/ui tests.
My test has the following structure
The problem is now that by the time I have the
laika
object and can calllaika.intercept
, the requests is already completed and I don't receive the mocked data.The only way I found to intercept these initial queries is to intercept them inside the
onLaikaReady
callback funtion:But this approach moves the interception logic into the actual application and I can't override this mock results from within the test file. Is there a way to set the
onLaikaReady
callback from within the tests?Thanks!
The text was updated successfully, but these errors were encountered: