class Driver
A locally managed geckodriver process.
Definitions
def initialize(**options)
Initialize a managed Firefox driver process.
Signature
-
parameter
optionsHash Driver configuration options.
Implementation
def initialize(**options)
super(**options)
@process_group = nil
end
def concurrency
Signature
-
returns
Integer Firefox drivers support one session at a time.
Implementation
def concurrency
1
end
def arguments(**options)
Signature
-
returns
Array(String) The arguments to pass to the
geckodriverexecutable.
Implementation
def arguments(**options)
[
options.fetch(:driver_path, "geckodriver"),
"--port", self.port.to_s,
].compact
end
def start
Start the managed Firefox driver process and wait for readiness.
Implementation
def start
@process_group = ProcessGroup.spawn(*arguments(**@options))
super
end
def close
Stop the managed Firefox driver process.
Implementation
def close
if @process_group
@process_group.close
@process_group = nil
end
super
end