Class: Generator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/generators/generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_pathsObject



12
13
14
15
16
# File 'lib/generators/generator.rb', line 12

def self.source_paths
  base_path = File.dirname(__FILE__)
  %W[#{base_path}/automation/templates #{base_path}/cucumber/templates
     #{base_path}/rspec/templates #{base_path}/templates #{base_path}/actions/templates ]
end

Instance Method Details

#android?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/generators/generator.rb', line 43

def android?
  args.include?('android')
end

#argsObject



18
19
20
# File 'lib/generators/generator.rb', line 18

def args
  initializer.first
end

#axe?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/generators/generator.rb', line 67

def axe?
  args.include?('axe')
end

#cross_platform?Boolean

The framework is cross platform when it supports Android and iOS

Returns:

  • (Boolean)


27
28
29
# File 'lib/generators/generator.rb', line 27

def cross_platform?
  args.include?('cross_platform')
end

#cucumber?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/generators/generator.rb', line 22

def cucumber?
  args.include?('cucumber')
end

#ios?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/generators/generator.rb', line 39

def ios?
  args.include?('ios')
end

#mobile?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/generators/generator.rb', line 31

def mobile?
  (args & %w[android ios cross_platform]).count.positive?
end

#rspec?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/generators/generator.rb', line 47

def rspec?
  args.include?('rspec')
end

#selenium?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/generators/generator.rb', line 51

def selenium?
  args.include?('selenium')
end

#selenium_based?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/generators/generator.rb', line 71

def selenium_based?
  (args & %w[selenium axe applitools]).count.positive?
end

#single_platform?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/generators/generator.rb', line 35

def single_platform?
  (args & %w[android ios]).count.positive?
end

#visual?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/generators/generator.rb', line 55

def visual?
  args.include?('applitools')
end

#watir?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/generators/generator.rb', line 59

def watir?
  args.include?('watir')
end

#web?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/generators/generator.rb', line 63

def web?
  (args & (%w[selenium watir axe applitools])).count.positive?
end