Async::WebDriverSourceAsyncWebDriverBridgeChromeDriver

class Driver

A locally managed chromedriver process.

Definitions

def initialize(**options)

Initialize a managed Chrome driver process.

Signature

parameter options Hash

Driver configuration options.

Implementation

def initialize(**options)
	super(**options)
	@process_group = nil
end

def arguments(**options)

Signature

returns Array(String)

The arguments to pass to the chromedriver executable.

Implementation

def arguments(**options)
	[
		options.fetch(:driver_path, "chromedriver"),
		"--port=#{self.port}",
	].compact
end

def start

Start the managed Chrome driver process and wait for readiness.

Implementation

def start
	@process_group = ProcessGroup.spawn(*arguments(**@options))
	
	super
end

def close

Stop the managed Chrome driver process.

Implementation

def close
	if @process_group
		@process_group.close
		@process_group = nil
	end
	
	super
end