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

Fix using screenshot step with response cache #1

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

otsch
Copy link
Member

@otsch otsch commented Feb 16, 2024

Change the output of the Screenshot step, from an array ['response' => RespondedRequest, 'screenshotPath' => string] to a RespondedRequestWithScreenshot object, that has a screenshotPath property. The problem with the previous solution was: when using the response cache, the step failed, because it gets a cached response from the loader that was not actually loaded in the headless browser. When the step afterwards tries to take a screenshot from the page that is still open in the browser, it just fails because there is no open page. Now, with the new RespondedRequestWithScreenshot object, the screenshotPath is also saved in the cached response.

Change the output of the `Screenshot` step, from an array `['response'
=> RespondedRequest, 'screenshotPath' => string]` to a
`RespondedRequestWithScreenshot` object, that has a `screenshotPath`
property. The problem with the previous solution was: when using the
response cache, the step failed, because it gets a cached response from
the loader that was not actually loaded in the headless browser. When
the step afterwards tries to take a screenshot from the page that is
still open in the browser, it just fails because there is no open page.
Now, with the new `RespondedRequestWithScreenshot` object, the
`screenshotPath` is also saved in the cached response.
@otsch otsch merged commit 02e47d1 into main Feb 17, 2024
5 checks passed
@otsch otsch deleted the feature/screenshot-step-with-cache branch February 17, 2024 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant