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

Cannot run capybara tests locally #121

Open
LinqLover opened this issue Jan 15, 2021 · 6 comments
Open

Cannot run capybara tests locally #121

LinqLover opened this issue Jan 15, 2021 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@LinqLover
Copy link
Contributor

$ bundle exec rspec spec/features/navbar_spec.rb 
Capybara starting Puma...
* Version 5.0.4 , codename: Spoony Bard
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:27402
FF[...]

Failures:

  1) Navbar profile dropdown is not expanded by default
     Failure/Error: visit root_path
     
     Selenium::WebDriver::Error::UnknownError:
       Process unexpectedly closed with status 0
     # ./spec/features/navbar_spec.rb:8:in `block (2 levels) in <top (required)>'

  2) Navbar profile dropdown expands after being clicked on
     Failure/Error: visit root_path
     
     Selenium::WebDriver::Error::UnknownError:
       Process unexpectedly closed with status 0
     # ./spec/features/navbar_spec.rb:8:in `block (2 levels) in <top (required)>'

  [...]

Finished in 31.48 seconds (files took 4.59 seconds to load)
7 examples, 7 failures

Failed examples:

rspec ./spec/features/navbar_spec.rb:12 # Navbar profile dropdown is not expanded by default
rspec ./spec/features/navbar_spec.rb:17 # Navbar profile dropdown expands after being clicked on
[...]

Coverage report generated for RSpec to /path/to/connections-portal/coverage. 23 / 201 LOC (11.44%) covered.
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected

Changing $DISPLAY to :5 doesn't help either. I'm in a headless WSL environment which was not a problem earlier ...

@LinqLover LinqLover added bug Something isn't working help wanted Extra attention is needed labels Jan 15, 2021
@felixauringer
Copy link
Contributor

I'm in a headless WSL environment which was not a problem earlier ...

We now use javascript in our project and therefore had to include a headless Browser in our tests which apparently does not work well with WSL

@felixauringer
Copy link
Contributor

@LinqLover I don't want to spam Discord so I reply here:
Vagrant is a manager for virtual machines that uses VirtualBox in the Background. The tests with a headless firefox work without problems in a VM created by our Vagrantfile. I'm not sure if Vagrant works good with Windows but it's worth a try because the setup is really easy. Nevertheless I would recommend using Windows for developing ;)

@LinqLover
Copy link
Contributor Author

Thanks for the pointer. I will try that out when I need it the next time ... Unfortunately, installing dev stuff directly in Windows is not that easy as installing it in Linux/WSL, and Vagrant sounds a quite heavy (i.e. resources-extensive) tool ... :-)

@felixauringer
Copy link
Contributor

I do not think that headless VirtualBox VM are really resource-extensive:
image
2% of my RAM are aproximately 640MB and there is only real CPU load when the server responds to a request / runs a test. That's definitely less than RubyMine 😅
But I think you mentioned the reason why Linux is better for developing than Windows ;)

@LinqLover
Copy link
Contributor Author

Well, 640 MB is a lot of RAM - a VS Code window only consumes half as much space. But that's probably out of topic. :-)

So will we leave this ticket open until the installation instructions in the README.md are again correctly (which do not mention the setup of any x-server solution ATM)?

@felixauringer
Copy link
Contributor

So will we leave this ticket open until the installation instructions in the README.md are again correctly (which do not mention the setup of any x-server solution ATM)?

The setup just assumes that Linux is used because it is most common but feel free to add any Windows specific requirements after you figured them out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants