Giter Club home page Giter Club logo

Comments (7)

tomykaira avatar tomykaira commented on May 24, 2024

I use headless in a rails project, only in CI environment.

I'm using this rake task to start/stop the server.

# lib/tasks/headless.rake
require 'headless'

namespace :headless do
  desc 'Start headless with destroy_at_exit: false on default port'
  task :start do
    Headless.new(destroy_at_exit: false).start
  end

  desc 'Stop headless'
  task :stop do
    Headless.new(reuse: true).destroy
  end
end

In spec_helper.rb

if ci?
  require 'headless'
  headless = Headless.new(reuse: true, destroy_at_exit: false)
  puts "Running in Headless mode. Display :#{headless.display}"
end

from headless.

pusewicz avatar pusewicz commented on May 24, 2024

What if I am running 4 processes in parallel?

On 20 May 2013, at 15:26, tomykaira [email protected] wrote:

I use headless in a rails project, only in CI environment.

I'm using this rake task to start/stop the server.

lib/tasks/headless.rake

require 'headless'

namespace :headless do
desc 'Start headless with destroy_at_exit: false on default port'
task :start do
Headless.new(destroy_at_exit: false).start
end

desc 'Stop headless'
task :stop do
Headless.new(reuse: true).destroy
end
end
In spec_helper.rb

if ci?
require 'headless'
headless = Headless.new(reuse: true, destroy_at_exit: false)
puts "Running in Headless mode. Display :#{headless.display}"
end

Reply to this email directly or view it on GitHub.

from headless.

tomykaira avatar tomykaira commented on May 24, 2024

In my environment, 8 processes can run in parallel.

  • rake headless:start when you start coding
  • rake parallel:spec as usually, any times
  • rake parallel:stop when you leave work

Please try it.

from headless.

rosskevin avatar rosskevin commented on May 24, 2024

@pusewicz - here's a complete example that seems to work well: https://gist.github.com/rosskevin/5937888

from headless.

pusewicz avatar pusewicz commented on May 24, 2024

@rosskevin Great, thanks. I'll have a look.

from headless.

yuri-karpovich avatar yuri-karpovich commented on May 24, 2024

I don't use CI but I have single script that gets data from CSV I checks it on UI with Watir web-driver and Headless. Can I run Watir code in parallel?

from headless.

leonid-shevtsov avatar leonid-shevtsov commented on May 24, 2024

@yuri-karpovich a single virtual display can maintain as many applications as necessary as long as you don't do any screenshots or video recording - that would get you just the topmost window.

from headless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.