Class: Watir::WatirOptions

Inherits:
UserChoices::Command
  • Object
show all
Includes:
UserChoices
Defined in:
lib/watir-classic/options.rb

Instance Method Summary collapse

Instance Method Details

#add_choices(builder) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/watir-classic/options.rb', line 38

def add_choices builder
  builder.add_choice :browser, 
  :type => Watir::Browser.browser_names, 
  :default => Watir::Browser.default
  builder.add_choice :speed, 
  :type => ['slow', 'fast', 'zippy'], 
  :default => 'fast'
  builder.add_choice :visible,
  :type => :boolean
  builder.add_choice :zero_based_indexing,
  :type => :boolean,
  :default => true
end

#add_sources(builder) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/watir-classic/options.rb', line 31

def add_sources builder
  builder.add_source EnvironmentSource, :with_prefix, 'watir_'
  if Watir.options_file
    builder.add_source YamlConfigFileSource, :from_complete_path, 
      Watir.options_file
  end
end

#executeObject



51
52
53
54
# File 'lib/watir-classic/options.rb', line 51

def execute 
  @user_choices[:speed] = @user_choices[:speed].to_sym
  @user_choices
end