Class: HelpersGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/generators/helper_generator.rb

Instance Method Summary collapse

Methods inherited from Generator

source_paths

Instance Method Details

#generate_allure_helper ⇒ Object



10
11
12
13
14
# File 'lib/generators/helper_generator.rb', line 10

def generate_allure_helper
  return if @_initializer.first.last

  template('helpers/allure_helper.tt', "#{name}/helpers/allure_helper.rb")
end

#generate_appium_helper ⇒ Object



38
39
40
41
42
# File 'lib/generators/helper_generator.rb', line 38

def generate_appium_helper
  return unless @_initializer.first.include?('cross_platform')

  template('helpers/appium_helper.tt', "#{name}/helpers/appium_helper.rb")
end

#generate_browser_helper ⇒ Object



16
17
18
# File 'lib/generators/helper_generator.rb', line 16

def generate_browser_helper
  template('helpers/browser_helper.tt', "#{name}/helpers/browser_helper.rb") if @_initializer.first.include?('watir')
end

#generate_driver_helper ⇒ Object



32
33
34
35
36
# File 'lib/generators/helper_generator.rb', line 32

def generate_driver_helper
  return if @_initializer.first.include?('watir')

  template('helpers/driver_helper.tt', "#{name}/helpers/driver_helper.rb")
end

#generate_raider_helper ⇒ Object



6
7
8
# File 'lib/generators/helper_generator.rb', line 6

def generate_raider_helper
  template('helpers/raider_helper.tt', "#{name}/helpers/raider.rb")
end

#generate_selenium_helper ⇒ Object



26
27
28
29
30
# File 'lib/generators/helper_generator.rb', line 26

def generate_selenium_helper
  return unless @_initializer.first.include?('selenium')

  template('helpers/selenium_helper.tt', "#{name}/helpers/selenium_helper.rb")
end

#generate_spec_helper ⇒ Object



20
21
22
23
24
# File 'lib/generators/helper_generator.rb', line 20

def generate_spec_helper
  return if @_initializer.first.last

  template('helpers/spec_helper.tt', "#{name}/helpers/spec_helper.rb") if @_initializer.first.include?('rspec')
end

#generate_visual_helper ⇒ Object



44
45
46
47
48
# File 'lib/generators/helper_generator.rb', line 44

def generate_visual_helper
  return unless @_initializer.first.last

  template('helpers/visual_helper.tt', "#{name}/helpers/visual_helper.rb")
end

#generate_visual_spec_helper ⇒ Object



50
51
52
53
54
# File 'lib/generators/helper_generator.rb', line 50

def generate_visual_spec_helper
  return unless @_initializer.first.last

  template('helpers/visual_spec_helper.tt', "#{name}/helpers/spec_helper.rb")
end