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

tests(downloads): add a test for Blob downloads (#1936) #1939

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

rwoll
Copy link
Member

@rwoll rwoll commented Apr 23, 2020

This patch adds test cases for Blob downloads which appear to have
differing behavior on the different browsers.

NB: For each of the browsers, I manually tried going to a page that
looked like the newly added test asset page (download-blob.html)
and performing the steps that the test does. In each of the cases
I ended up with the target file; however, Firefox and Safari both had an
additional prompt. (I'm not sure if that prompt was a default prompt
that should be disabled when running via Playwright or if additional
handling logic is needed.)

For Chrome, this test passes (and manual replication yields a file
download).

For Firefox, this test crashes the browser (but manual replication
yields a file but requires dealing with one extra download prompt in
Firefox).

For Webkit, this test will timeout (but manual replication yields a file
but requires dealing with one extra download prompt in Webkit.)

Test Output:

Failures:
1) [CRASHED] Firefox Download should report download path within page.on('download', …) handler for Blobs (download.spec.js:86:3)

2) [TIMEOUT 10000ms] WebKit Download should report download path within page.on('download', …) handler for Blobs (download.spec.js:86:3)

References: #1936

This patch adds test cases for Blob downloads which appear to have
differing behavior on the different browsers.

NB: For each of the browsers, I manually tried going to a page that
looked like the newly added test asset page (`download-blob.html`)
and performing the steps that the test does. In each of the cases
I ended up with the target file; however, Firefox and Safari both had an
additional prompt. (I'm not sure if that prompt was a default prompt
that should be disabled when running via Playwright or if additional
handling logic is needed.)

For Chrome, this test passes (and manual replication yields a file
download).

For Firefox, this test crashes the browser (but manual replication
yields a file but requires dealing with one extra download prompt in
Firefox).

For Webkit, this test will timeout (but manual replication yields a file
but requires dealing with one extra download prompt in Webkit.)

Test Output:

```
Failures:
1) [CRASHED] Firefox Download should report download path within page.on('download', …) handler for Blobs (download.spec.js:86:3)

2) [TIMEOUT 10000ms] WebKit Download should report download path within page.on('download', …) handler for Blobs (download.spec.js:86:3)
```
@msftclas
Copy link

msftclas commented Apr 23, 2020

CLA assistant check
All CLA requirements met.

test/download.spec.js Outdated Show resolved Hide resolved
Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test!

test/download.spec.js Outdated Show resolved Hide resolved
test/download.spec.js Outdated Show resolved Hide resolved
Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

(looks like you need to sign CLA unless the bot is lagging)

@yury-s yury-s changed the title Add tests for Blob downloads (#1936) tests(downloads): add a test for Blob downloads (#1936) Apr 23, 2020
@rwoll
Copy link
Member Author

rwoll commented Apr 23, 2020

Awesome!

(looks like you need to sign CLA unless the bot is lagging)

@yury-s Bot was good :) I hadn't signed it yet. It's now signed! 🎉

@yury-s yury-s merged commit dc23c56 into microsoft:master Apr 23, 2020
aslushnikov pushed a commit that referenced this pull request Apr 23, 2020
When contributing some test cases, I was a bit confused about if I should use `skip` and `fail`, the difference between the two, and how they interact with CI/CD tests passing or failing: #1939 (comment).

This is my attempt at explaining the difference, but feel free to edit to make it more clear and concise (and correct any inaccuracies).
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.

3 participants