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

Add integration tests for extension functionality (get Puppeteer to intercept web worker requests) #12194

Closed
felixfbecker opened this issue Jul 15, 2020 · 3 comments · Fixed by #12195
Assignees
Labels
estimate/2d planned/3.19 testing Issues that deal with unit tests, integration tests and the testing infrastructure.
Milestone

Comments

@felixfbecker
Copy link
Contributor

Extensions are one of our most important features to test. The way we would test this is by serving a mock extension that registers very simple providers.

Unfortunately Puppeteer currently has a severe limitation: It can't intercept requests triggered from web workers, if request interception is on for their parent page they will just hang. This means extensions can't be easily loaded in integration tests. Neither importScripts() (which we use to load extension bundles) nor fetch() requests can be intercepted.

Issues in Puppeteer:

It seems there is a possible workaround by using the CDP through Puppeteer directly: puppeteer/puppeteer#2781 (comment)

This would be crucial to solve for an extensive integration test suite.

@felixfbecker felixfbecker added team/web testing Issues that deal with unit tests, integration tests and the testing infrastructure. labels Jul 15, 2020
@felixfbecker felixfbecker added this to the 3.20 milestone Aug 24, 2020
@lguychard lguychard self-assigned this Aug 31, 2020
@lguychard lguychard removed their assignment Sep 2, 2020
@marekweb marekweb self-assigned this Sep 3, 2020
@davejrt
Copy link
Contributor

davejrt commented Sep 14, 2020

Dear all,

This is your release captain speaking. 🚂🚂🚂

Branch cut for the 3.20 release is scheduled for tomorrow.

Is this issue / PR going to make it in time? Please change the milestone accordingly.
When in doubt, reach out!

Thank you

@marekweb
Copy link
Contributor

I identified these issues with the WIP adapter:

  • The request patterns don't intercept all requests properly, and I'm not sure they're intercept responses at all. This may explain why it's not working with Polly.
  • Error when capturing the body of some responses. I think this is caused specifically by redirect responses, because they get paused in a different way (at a different stage?) than other requests.
  • Error when page gets closed while we're still intercepting. This error may be safely ignored, but it's better if we ignore it explicitly.

Next steps:

I started writing a modified WIP that uses the CDP protocol directly instead of using the puppeteer interceptor library. With this approach I think I can solve all of the issue above. I'll push my work to this PR.

@marekweb
Copy link
Contributor

The last comment above was specific to #13870. I posted a further update on that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate/2d planned/3.19 testing Issues that deal with unit tests, integration tests and the testing infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants