Class: Browsenator::Local::Firefox

Inherits:
Object
  • Object
show all
Includes:
WindowSize
Defined in:
lib/browsenator/local/firefox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WindowSize

#height, #width

Constructor Details

#initialize(opts = {}) ⇒ Firefox

Returns a new instance of Firefox.



9
10
11
12
13
# File 'lib/browsenator/local/firefox.rb', line 9

def initialize(opts = {})
  @options = { accept_insecure_certs: true }

  @options[:headless] = true if opts[:headless]
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



21
22
23
# File 'lib/browsenator/local/firefox.rb', line 21

def options
  @options
end

Instance Method Details

#openObject



15
16
17
18
19
# File 'lib/browsenator/local/firefox.rb', line 15

def open
  firefox = Watir::Browser.new :firefox, options
  firefox.window.resize_to(width, height)
  firefox
end