Skip to content

test: add ExpectDownload regression test for mobile emulation context#589

Closed
AbhinavMir wants to merge 1 commit into
playwright-community:mainfrom
AbhinavMir:fix/579-expect-download-mobile-test
Closed

test: add ExpectDownload regression test for mobile emulation context#589
AbhinavMir wants to merge 1 commit into
playwright-community:mainfrom
AbhinavMir:fix/579-expect-download-mobile-test

Conversation

@AbhinavMir
Copy link
Copy Markdown

Summary

Adds a regression test, TestDownloadInMobileContext, that exercises Page.ExpectDownload under an iPad Mini emulation context (IsMobile: true, HasTouch: true). The test confirms that the page-level "download" channel event still fires correctly under mobile emulation and that Download.URL() / Download.SuggestedFilename() return the expected values.

Refs #579.

Notes on #579

I was unable to reproduce a real bug from the report. After investigating, the snippet in the issue clicks <a href="…some.jpg"> against a server that does not send Content-Disposition: attachment and the anchor has no download attribute, so the browser navigates to the resource instead of triggering a download — ExpectDownload then correctly times out. With the same iPad Mini / IsMobile context plus a properly configured download (this PR's test), ExpectDownload resolves as expected.

I'm opening this as a draft so a maintainer can decide whether:

  1. This regression coverage is worth merging on its own, and/or
  2. The issue should be closed with a comment pointing the reporter at the download attribute / Content-Disposition: attachment requirement.

Test plan

  • go test ./tests -run TestDownloadInMobileContext -v — passes
  • go test ./tests -run "TestDownloadBasic|TestDownloadCancel|TestDownloadInMobileContext" -v — all pass
  • go vet ./... clean, gofmt clean

Adds TestDownloadInMobileContext covering the iPad Mini / IsMobile +
HasTouch context to confirm that the page-level "download" channel
event still fires under mobile emulation. Refs playwright-community#579.
@AbhinavMir AbhinavMir closed this May 3, 2026
@AbhinavMir AbhinavMir deleted the fix/579-expect-download-mobile-test branch May 3, 2026 05:28
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