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

Does it run on hosted CI e.g. CircleCI, TravisCI? #10

Closed
teohm opened this issue Apr 17, 2019 · 17 comments
Closed

Does it run on hosted CI e.g. CircleCI, TravisCI? #10

teohm opened this issue Apr 17, 2019 · 17 comments

Comments

@teohm
Copy link

teohm commented Apr 17, 2019

Hi, can anyone confirm if this new driver runs properly on hosted CI such as CircleCI, TravisCI etc?

I'm just started to test it on CircleCI, my RSpec test suite just hang and timed out.

RSpec is shutting down and will print the summary report... Interrupt again to force quit.
Too long with no output (exceeded 10m0s)
@twalpole
Copy link
Owner

@teohm This is still in beta so it hasn't been fully tested on different CI setups however there is nothing specifically know that should stop it from working. If you can provide a way to reproduce your issue I'll be happy to look into it.

@baffers
Copy link
Contributor

baffers commented Apr 22, 2019

I'm experiencing this too with CircleCI

@twalpole
Copy link
Owner

@baffers As mentioned in my previous answer -- if someone can provide a simple project that reproduces this behavior I'll be more than happy to take a look and figure out what's going wrong.

@baffers
Copy link
Contributor

baffers commented Apr 22, 2019

I totally understand, as soon as I wrote that comment I was like "they're going to want an example". it's kind of a weird week for me so if @teohm can't provide an example this week, I'll try to get one together next week

@twalpole
Copy link
Owner

@baffers Sounds good -- one quick question, are you using the released gem or the master branch?

@baffers
Copy link
Contributor

baffers commented Apr 22, 2019

@twalpole master. Also, once I passed in headless: false into the driver config my tests started running so I'm guessing there isn't a huge problem with Apparition, just my set up. I'm hitting some little bugs with other random things (eg, send_keys(:return) blows up but send_keys(:enter) works) but nothing that I can't work around.

@twalpole
Copy link
Owner

@baffers Yeah - Looks like there's not currently a key definition for :return - so that would explain that. Please add issues for any other things you come across that don't behave correctly , and I'll get them fixed if possible.

@twalpole
Copy link
Owner

twalpole commented Apr 23, 2019

FYI - there is :enter and :numpad_enter as two different options . - I've also added a :return alias for :enter which notifies the user that :return is deprecated - I assume you came from using capybara_webkit previously since it appears that's the only driver that supported using :return in the first place.

@skyeagle
Copy link
Contributor

@teohm I had the same issue, it turns out these two options helped:

        browser_options: {
          'no-sandbox' => nil,
          'disable-features' => 'VizDisplayCompositor'
        },

the latter one found here

@twalpole
Copy link
Owner

twalpole commented Apr 25, 2019

@skyeagle Thanks for that -- note you should also be able to pass that as

browser_options: [ :no_sandbox, disable_features: 'VizDisplayCompositor']

to reduce the need for all the nils (and strings vs symbols)

@twalpole
Copy link
Owner

If anyone else can confirm whether or not those two options fix the issue for them, I'll go ahead and close this

@baffers
Copy link
Contributor

baffers commented Apr 25, 2019

@twalpole yes it did!

@twalpole
Copy link
Owner

Great! - Closing this then.

@etagwerker
Copy link

@twalpole Just ran into this issue and the attempts listed above did not work for me. 😢

Here are the things I tried:

require 'capybara/apparition'

Capybara.register_driver :apparition do |app|
  Capybara::Apparition::Driver.new(
    app,
    browser_options: {
      'no-sandbox' => nil,
      'disable-features' => 'VizDisplayCompositor'
    }
  )
end

Capybara.javascript_driver = :apparition

That didn't work.

Then I tried:

require 'capybara/apparition'

Capybara.register_driver :apparition do |app|
   Capybara::Apparition::Driver.new(app, browser_options: [ :no_sandbox, disable_features: 'VizDisplayCompositor'])
end

Capybara.javascript_driver = :apparition

I get a timeout from Circle CI with this output:

bundle exec rspec --format progress $TEST_FILES
Requested historical based timing, but they are not present.  Falling back to name based sorting
................................................Capybara starting Puma...
* Version 3.12.1 , codename: Llamas in Pajamas
* Min threads: 0, max threads: 4
* Listening on tcp://127.0.0.1:43099

Is there something I'm doing wrong?

I tried with both apparition v0.4.0 and apparition from master

@baffers
Copy link
Contributor

baffers commented Sep 9, 2019

Hey @etagwerker I'm sure if this will help but this is our config:

Capybara::Apparition::Driver.new(app, {
                                         browser_logger: nil,
                                         headless: true, # TO RUN A BROWSER LOCALLY, CHANGE TO FALSE
                                         browser_options: [ :disable_gpu, :no_sandbox, disable_features: 'VizDisplayCompositor']
                                      }
                                 )  

@kjakub
Copy link

kjakub commented Oct 1, 2019

i was running to the same issue on gitlab/cicd and confirming here that options from @baffers helped. @twalpole I would add link to this issue from main README.md , it took me some time to come here

@kjakub
Copy link

kjakub commented Oct 1, 2019

@twalpole 🥇 for this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants