Module: Capybara::AsyncRunner

Defined in:
lib/capybara/async_runner.rb,
lib/capybara/async_runner/version.rb

Defined Under Namespace

Modules: Commands, Registry, WaitHelper Classes: Command, Configuration, Env, JsBuilder

Constant Summary collapse

FailedToFetchResult =
Class.new(StandardError)
VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.configCapybara::AsyncRunner::Configuration

Returns current gem configuration.



18
19
20
# File 'lib/capybara/async_runner.rb', line 18

def self.config
  @config ||= Configuration.new
end

.run(command_name, data = {}) ⇒ Object

Runs command that has provided command_name and passes provided data

Examples:

class MyCoolCommand < Capybara::AsyncRunner::Command
  self.command_name = 'cool_command'
  self.file_to_run = 'path/to/cool/command'
end

Capybara::AsyncRunner.run(:cool_command)


45
46
47
# File 'lib/capybara/async_runner.rb', line 45

def self.run(command_name, data = {})
  Registry[command_name].new(data).invoke
end

.setup {|Capybara::AsyncRunner::Configuration| ... } ⇒ Object

Yields current configuration

Examples:

Capybara::AsyncRunner.setup do |config|
  config.commands_directory = Rails.root.join('spec/support/async_runner')
end

Yields:



31
32
33
# File 'lib/capybara/async_runner.rb', line 31

def self.setup
  yield config
end