Module: Utilities

Defined in:
lib/utilities/utilities.rb

Class Method Summary collapse

Class Method Details

.browser=(browser) ⇒ Object



9
10
11
12
# File 'lib/utilities/utilities.rb', line 9

def browser=(browser)
  config['browser'] = browser
  overwrite_yaml
end

.browser_options=(*opts) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/utilities/utilities.rb', line 44

def browser_options=(*opts)
  args = opts.flatten
  browser_args = config['browser_arguments']
  browser = args.first&.to_sym
  browser_args[browser] = browser_args[browser] + args[1..] if browser_args.key?(browser)
  overwrite_yaml
end

.delete_browser_optionsObject



52
53
54
55
# File 'lib/utilities/utilities.rb', line 52

def delete_browser_options
  config.delete('browser_options')
  overwrite_yaml
end

.feature_path=(path) ⇒ Object



24
25
26
27
# File 'lib/utilities/utilities.rb', line 24

def feature_path=(path)
  config['feature_path'] = path
  overwrite_yaml
end

.helper_path=(path) ⇒ Object



29
30
31
32
# File 'lib/utilities/utilities.rb', line 29

def helper_path=(path)
  config['helper_path'] = path
  overwrite_yaml
end

.page_path=(path) ⇒ Object



14
15
16
17
# File 'lib/utilities/utilities.rb', line 14

def page_path=(path)
  config['page_path'] = path
  overwrite_yaml
end

.parallel_run(opts = nil, _settings = nil) ⇒ Object



62
63
64
65
# File 'lib/utilities/utilities.rb', line 62

def parallel_run(opts = nil, _settings = nil)
  command = File.directory?('spec') ? 'parallel_rspec spec/' : 'parallel_cucumber features'
  system "#{command} #{opts}"
end

.platform=(platform) ⇒ Object



39
40
41
42
# File 'lib/utilities/utilities.rb', line 39

def platform=(platform)
  config['platform'] = platform
  overwrite_yaml
end

.run(opts = nil) ⇒ Object



57
58
59
60
# File 'lib/utilities/utilities.rb', line 57

def run(opts = nil)
  command = File.directory?('spec') ? 'rspec spec/' : 'cucumber features'
  system "#{command} #{opts}"
end

.spec_path=(path) ⇒ Object



19
20
21
22
# File 'lib/utilities/utilities.rb', line 19

def spec_path=(path)
  config['spec_path'] = path
  overwrite_yaml
end

.url=(url) ⇒ Object



34
35
36
37
# File 'lib/utilities/utilities.rb', line 34

def url=(url)
  config['url'] = url
  overwrite_yaml
end