Sha256: ea63c142f4d6b4973890b93aa220baa357a2709a9e04c3bb2d5280538012e5d4

Contents?: true

Size: 793 Bytes

Versions: 4

Compression:

Stored size: 793 Bytes

Contents

require_relative "configures_test_server"

module CypressRails
  class StartsRailsServer
    def initialize
      @configures_test_server = ConfiguresTestServer.new
    end

    def call(dir:, port:)
      @configures_test_server.call(port: port)

      require "action_dispatch/system_testing/driver"
      require "action_dispatch/system_testing/browser"
      ActionDispatch::SystemTesting::Driver.new(:selenium, {
        using: :headless_chrome,
        screen_size: [1400, 1400],
        options: {},
      }).use

      Capybara.app = Rack::Builder.new do
        map "/" do
          run Rails.application
        end
      end

      require "action_dispatch/system_testing/server"
      ActionDispatch::SystemTesting::Server.new.run

      Capybara.current_session
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cypress-rails-0.0.4 lib/cypress-rails/starts_rails_server.rb
cypress-rails-0.0.3 lib/cypress-rails/starts_rails_server.rb
cypress-rails-0.0.2 lib/cypress-rails/starts_rails_server.rb
cypress-rails-0.0.1 lib/cypress-rails/starts_rails_server.rb