-
-
Notifications
You must be signed in to change notification settings - Fork 85
Add expectDownload() and expectDownloads() methods
#196
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
base: 4.x
Are you sure you want to change the base?
Conversation
|
Does jest or vitest have an API for this? |
From what I found, neither Jest or Vitest support this out of the box. With Dusk, I used a custom browser instance that configures the download behavior via Chrome DevTools: $devTools = new \Facebook\WebDriver\Chrome\ChromeDevToolsDriver($this->driver);
$devTools->execute('Browser.setDownloadBehavior', [
'behavior' => 'allow',
'downloadPath' => $path,
]);I mostly followed Playwright's approach: https://playwright.dev/docs/api/class-download |
|
can you add docs? |
|
fix tests also. |
|
I'm not sure why it didn't fail in CI on my fork, but I removed the dependency on the |
This PR adds support for capturing and asserting file downloads.
The
Downloadobject supports fluent chaining:You can also access download details directly: