Running feature specs with Capybara and Chrome headless
drivy.engineering
Running feature specs with Capybara and Chrome headless
1–10 of 35 posts
Re: Running feature specs with Capybara and Chrome headless
#2Did you do a comparison of memory against phantomJS?
Re: Running feature specs with Capybara and Chrome headless
#3Re: Running feature specs with Capybara and Chrome headless
#4"It is also supposed to improve memory usage and stability" Did you do a comparison of memory against phantomJS?
> I think people will switch to it, eventually. Chrome is faster and more stable than PhantomJS. And it doesn't eat memory like crazy.
[0] https://groups.google.com/forum/#!msg/phantomjs/9aI5d-LDuNE/...
Re: Running feature specs with Capybara and Chrome headless
#5One thing I learned and wanted to warn about here is that Chrome headless currently doesn't support file downloads [1].
PhantomJS won't work either (unless you use a custom build) [2].
I also tried with capybara-webkit, but no luck either [3].
The only driver which ultimately allowed me to download files at this point was Selenium + Firefox (with some tweaking on profile options browser.download.dir, browser.download.folderList = 2, browser.helperApps.neverAsk.saveToDisk set to the MIME type of files to be downloaded).
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=696481
[2] https://github.com/ariya/phantomjs/issues/10052
[3] https://github.com/thoughtbot/capybara-webkit/issues/691
Re: Running feature specs with Capybara and Chrome headless
#6The short version of what's wrong: chrome headless does not support extensions. The chromedriver used by selenium works via starting chrome with an automation extension that gives it certain needed functionality. So things like setting the window size, taking screenshots, and a few other important features just cause chromedriver to crash or hang.
There's bugs filed and some clever googlers are trying to fix it all- but it's not ready for our purposes yet. I don't want to rewrite dozens of tests that work with phantomjs to get around chrome's bugs.
Re: Running feature specs with Capybara and Chrome headless
#7So I opened it headless and there's this REPL, nice I can do JS directly into the website. Now how do I automate this.
This leads me into all sorts of things that doesn't seem related at all (I is, but still). Selenium stuff, automation setups, drivers, language bindings, chrome-api-stuff and no end in sight.
All I want is something like "chrome -headless -js script-flow.file http://URL"
Am I to overwhelmed or is there no simple way without buttloads of 3rd party tools and setups required?
Re: Running feature specs with Capybara and Chrome headless
#8"It is also supposed to improve memory usage and stability" Did you do a comparison of memory against phantomJS?
Re: Running feature specs with Capybara and Chrome headless
#9Chrome headless migration has been my bane for the last two weeks. It's almost ready, but not yet. The short version of what's wrong: chrome headless does not support extensions. The chromedriver used by selenium works via starting chrome with an automation extension that gives it certain needed functionality. So things like setting the window size, taking screenshots, and a few other important features just cause ch…
Re: Running feature specs with Capybara and Chrome headless
#10Kind of off topic, but. Is running automation as complicated as this? I recently wanted to log in to a website, click some page and download a .csv file. I saw that chrome can be run headless, nice. So I opened it headless and there's this REPL, nice I can do JS directly into the website. Now how do I automate this. This leads me into all sorts of things that doesn't seem related at all (I is, but still). Selenium st…
But, you have bunch of things that abstract that for you, so you don't have to implement things hitting that API manually. Anyways, here is a handy document from Mozilla on the protocol too: http://searchfox.org/mozilla-central/source/devtools/docs/ba...