Is it possible to navigate to a new url after setting one via url method? #721
Unanswered
patrick-cullen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Vue page rendered with Inertia.js that requires logging into my app to access that I'd like to take a screenshot of. I was hoping I could do something along the following lines:
Browsershot::url(route('login'))->noSandbox()->type('#email', '[email protected]')->type('#password', 'password')->click('#submit')->url(route('routeToScreenshot'), $params)->delay(2000)->waitUntilNetworkIdle()->savePdf('example.pdf');
However, under the hood the url() method is setting the url on the Browsershot instance rather than navigating to that url each time the method is called, so the second call to the url() method overwrites the value of the first, and the screenshot ends up just being of the login page because the user isn't authenticated at that point, rather than the page that I want in my routeToScreenshot route.
I haven't had luck setting cookies or using HTTP auth.
What I'm hoping to find is a way to set the url after already setting it once.
Beta Was this translation helpful? Give feedback.
All reactions