Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Switch Meteor's headless browser tests from PhantomJS to Headless Chrome #9814
Per 254, this is an attempt to replace PhantomJS with Headless Chrome.
I evaluated a few different solutions notably:
Ultimately, Puppeteer felt the best fit as it maintained by the Chrome team and it
There are some outstanding to dos, but before I proceed thought I would seek some feedback given Im not 100% familiar with Meteor homegrown test runner.
Outstanding To Dos:
This looks like a great direction. Thanks for taking the time to work on this!
The one thing we concretely rely on Phantom for, particularly as of Meteor 1.6.2 (soon to be 1.7!), is that it falls into the category of a "legacy browser" (that is to say, it lacks many "modern" browser features like
Do you think we could keep
Overall, this PR would be best paired with the work I did in #9364, but try to get over the obstacle I encountered in #9364 (comment). If we got that working, then we could almost confidently remove Phantom, though it might still be worth keeping around for someone wanting to test "legacy browser" features without relying on an "online" service like BrowserStack.
Thanks again for diving into this! (Happy to help more.)
Thanks @abernix, I have reverted the change and you can now pass --phantom to run test in the legacy browser. I have also updated the test-in-console runner to use puppeteer instead, note I had to bump the node version in Travis given puppeteer relies on at least version 6.4.0. I have pinned it at the current supported version for Meteor.
There is a single failure with a Blaze test on TravisCI, I dont have a-lot of familiarity here so I will need to unpack that to see if its valid...
@toinevk Thanks for looking into this.
When I run
Which indicates that the error is happening when Puppeteer is running tests via the Chrome Inspector Protocol against its version of Chrome, which uses Chrome 67 (the so-called "Dev" Channel). (See chart of channel status here: https://googlechromelabs.github.io/current-versions/)
Then, instead of running the
So basically, I think something may be changing/has changed in Chrome. If you're not experiencing the failure locally, I would try making sure that you've updated your Git submodules for Blaze locally, by running:
(You can check if you were on the wrong commit by going into
changed the title from
[WIP] Switch Meteor's headless browser tests from PhantomJS to Headless Chrome
Switch Meteor's headless browser tests from PhantomJS to Headless Chrome
Jun 6, 2018
It looks like we've solved the failing test, but another (likely legitimate?) failure seems to be occurring, as seen in the TravisCI test run:
added a commit
this pull request
Jul 11, 2018
I thought we were pretty much ready to merge, but I re-enabled the
@abernix It took a little while to isolate the issue, but in both instances it was the design of test which didn't account for multiple runs over the same instance of the test application. Given going forward the default locally will be one run and for CircleCI it will be 2, should we document this difference somewhere?