Add integration tests for extension functionality (get Puppeteer to intercept web worker requests)
Created by: felixfbecker
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:
- https://github.com/puppeteer/puppeteer/issues/4208
- https://github.com/puppeteer/puppeteer/issues/2781 (open since Jan 2018)
It seems there is a possible workaround by using the CDP through Puppeteer directly: https://github.com/puppeteer/puppeteer/issues/2781#issuecomment-513045753
This would be crucial to solve for an extensive integration test suite.