angular / webdriver-manager

A binary manager for E2E testing
MIT License
224 stars 116 forks source link

Hint in package metadata for installing supported version of puppeteer? #486

Open thw0rted opened 3 years ago

thw0rted commented 3 years ago

I currently depend on webdriver-manager via Protractor. I run e2e tests in CI by using Puppeteer to install a headless Chromium, then point Protractor at the installed binary using require("puppeteer").executablePath(). It's easy and works well.

Today, I updated a bunch of dependencies to their latest versions, including Protractor and Puppeteer. NPM didn't complain, but when I tried to run tests, I got an error along the lines of

E/launcher - session not created: This version of ChromeDriver only supports Chrome version 88 Current browser version is 90.0.4403.0 with binary path PATH/node_modules/puppeteer/.local-chromium/linux-848005/chrome-linux/chrome

Of course this makes sense because the latest Puppeteer (7.0.4) installs Chromium 90 while the latest Protractor (7.0.0) installs webdriver-manager 12.1.8 which seems to support up through Chromium 88. So, I had to roll back to Puppeteer 5.5.0, which installs the matching Chromium.

Each version of Puppeteer installs a specific build of Chromium. So, indirectly, the version of Puppeteer that should be installed is dictated by the version of webdriver-manager that's installed (which is dictated by the version of Protractor). What I'm asking for is a way to get npm to install the correct version of Puppeteer based on my declared Protractor (and, thus, webdriver-manager) dependency. I think this would be a good fit for optionalPeerDependencies, which doesn't actually exist yet, but maybe there's another (supported) way to do it?

thw0rted commented 3 years ago

Since I posted this, my CI build has started installing chromedriver v89. I'm still pinned at Puppeteer 5.5.0, so it's still installing Chromium 88 locally. I don't know what changed to break this, and I'm not sure how to fix it.