Comments (2)
So you're saying that it's not necessary to check if the PID file is accessible, we only need the X11 socket? But then you only need to set ENV['DISPLAY']
for X apps to work, possibly even outside of the Ruby code. Why use headless?
from headless.
The way that we use headless is pretty interesting. We have set it up for Cucumber + WebDriver and its logic is the following:
- On Mac, ignore Xvfb and start up browser normally.
- On Linux desktops, start browser in Xvfb so its window doesn't bother during development.
- On Linux without X11 (Vagrant), start browser using
/etc/init.d/xvfb
running service rather than "headless" gem and allow to view the tests viax11vnc
(which requiresXvfb
to be running before itself). This applies to tests running in 1 process. - On Linux without X11, when tests are being run in parallel processes, start new
Xvfb
instance for each process using "headless" gem.
Point 3
doesn't work for us, since headless cannot connect to run by root Xvfb instance.
The code we use to achieve this:
require 'headless'
displays = ENV['TEST_ENV_NUMBER'].to_i..ENV['TEST_ENV_NUMBER'].to_i + 100
def displays.to_i
self
end
begin
Headless.new(
display: displays,
reuse: true,
destroy_at_exit: false
).start
rescue Headless::Exception
puts 'Xvfb not found on your system, keeping calm'
end
from headless.
Related Issues (20)
- "Cannot establish any listening sockets" error precludes autopick: true
- Dimension problem HOT 1
- audio problem
- Display socket is taken but lock file is missing on mac within sidekiq
- Chrome Webdriver hangup on ruby 2.6 HOT 1
- New release? HOT 2
- cant require file HOT 2
- read_nonblock issue HOT 1
- How could I produce a fragmented mp4? HOT 2
- Display socket is taken but lock file is missing HOT 14
- Run Concurrently (using different ports?) HOT 5
- Question: how do you anticipate headless to work with Docker Selenium HOT 4
- Audio Video recording HOT 1
- Few ideas HOT 1
- import: unable to open X server `localhost:100' @ error/import.c/ImportImageCommand/364. HOT 2
- ffmpeg issue on Mac HOT 5
- Running headless with flash HOT 1
- dimensions not the same as what I've set HOT 1
- how to use on command line
- Using headless in a multithreaded program
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from headless.