Commit c3b271a
test: add file download E2E tests with local HTML fixtures (#28634)
## **Description**
Migrates the two file download E2E tests from the quarantined
`browser-tests.failing.ts` into a new `browser-download.spec.ts` file.
Replaces live external URL navigation (`tyschenko.github.io`) with local
HTML fixtures served by DappServer, eliminating external network
dependencies and improving test reliability.
Part of the effort to increase API mocking coverage for E2E tests
([MMQA-1368](https://consensyssoftware.atlassian.net/browse/MMQA-1368)).
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
[MMQA-1705](https://consensyssoftware.atlassian.net/browse/MMQA-1705)
## **Manual testing steps**
```gherkin
Feature: Browser File Download
Scenario: user downloads a blob file from a local fixture page
Given the app is launched and user is logged in
And the browser view is open
When user navigates to the local blob download fixture page
And user taps the Download button
And user confirms the download in the tapjacking dialog
Then the download success state is displayed
Scenario: user downloads a base64 file from a local fixture page
Given the app is launched and user is logged in
And the browser view is open
When user navigates to the local base64 download fixture page
And user taps the Download button
And user confirms the download in the tapjacking dialog
Then the download success state is displayed
```
## **Screenshots/Recordings**
### **Before**
N/A — tests were quarantined in `browser-tests.failing.ts` due to
reliance on external URLs.
### **After**
Both tests passing locally on iOS simulator:
```
PASS tests/smoke/wallet/browser/browser-download.spec.ts (222.23 s)
SmokeWalletPlatform: Browser File Download
✓ downloads a blob file (121368 ms)
✓ downloads a base64 file (92885 ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
```
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
[MMQA-1368]:
https://consensyssoftware.atlassian.net/browse/MMQA-1368?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[MMQA-1705]:
https://consensyssoftware.atlassian.net/browse/MMQA-1705?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk because changes are limited to E2E smoke tests and static
HTML/text fixtures, with no production code paths affected.
>
> **Overview**
> Adds a new smoke spec `browser-download.spec.ts` that exercises in-app
browser file downloads for both *blob* and *base64 data URL* flows.
>
> Replaces reliance on external download pages by introducing local
DappServer-served fixtures (`tests/fixtures/download/*`) that fetch a
bundled `File.txt` and trigger downloads via `URL.createObjectURL` or
`FileReader.readAsDataURL`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9ca245f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 49357e1 commit c3b271a
4 files changed
Lines changed: 122 additions & 0 deletions
File tree
- tests
- fixtures/download
- smoke/wallet/browser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments