howitzer 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +27 -18
  3. data/.travis.yml +4 -3
  4. data/CHANGELOG.md +15 -1
  5. data/README.md +6 -3
  6. data/Rakefile +1 -1
  7. data/features/cli_new.feature +12 -8
  8. data/features/cli_update.feature +14 -9
  9. data/features/step_definitions/common_steps.rb +3 -3
  10. data/generators/base_generator.rb +1 -1
  11. data/generators/config/config_generator.rb +2 -1
  12. data/generators/config/templates/boot.rb +1 -1
  13. data/generators/config/templates/capybara.rb +2 -1
  14. data/generators/config/templates/default.yml +22 -4
  15. data/generators/config/templates/drivers/appium.rb +25 -0
  16. data/generators/config/templates/drivers/headless_firefox.rb +23 -0
  17. data/generators/cucumber/templates/cuke_sniffer.rake +2 -2
  18. data/generators/cucumber/templates/env.rb +8 -0
  19. data/generators/prerequisites/templates/factory_bot.rb +1 -0
  20. data/generators/root/root_generator.rb +1 -1
  21. data/generators/root/templates/{.rubocop.yml → .rubocop.yml.erb} +34 -13
  22. data/generators/root/templates/Gemfile.erb +4 -0
  23. data/generators/rspec/templates/spec_helper.rb +1 -0
  24. data/generators/turnip/templates/spec_helper.rb +1 -0
  25. data/howitzer.gemspec +3 -3
  26. data/lib/howitzer.rb +40 -0
  27. data/lib/howitzer/cache.rb +19 -18
  28. data/lib/howitzer/capybara_helpers.rb +13 -5
  29. data/lib/howitzer/email.rb +1 -0
  30. data/lib/howitzer/mail_adapters/gmail.rb +3 -0
  31. data/lib/howitzer/mail_adapters/mailgun.rb +2 -0
  32. data/lib/howitzer/mail_adapters/mailtrap.rb +3 -0
  33. data/lib/howitzer/mailgun_api/connector.rb +1 -0
  34. data/lib/howitzer/meta.rb +11 -0
  35. data/lib/howitzer/meta/actions.rb +38 -0
  36. data/lib/howitzer/meta/element.rb +38 -0
  37. data/lib/howitzer/meta/entry.rb +62 -0
  38. data/lib/howitzer/meta/iframe.rb +41 -0
  39. data/lib/howitzer/meta/section.rb +30 -0
  40. data/lib/howitzer/version.rb +1 -1
  41. data/lib/howitzer/web/capybara_context_holder.rb +1 -0
  42. data/lib/howitzer/web/capybara_methods_proxy.rb +4 -1
  43. data/lib/howitzer/web/element_dsl.rb +1 -0
  44. data/lib/howitzer/web/iframe_dsl.rb +2 -0
  45. data/lib/howitzer/web/page.rb +10 -0
  46. data/lib/howitzer/web/page_dsl.rb +3 -0
  47. data/lib/howitzer/web/page_validator.rb +2 -0
  48. data/lib/howitzer/web/section.rb +8 -0
  49. data/lib/howitzer/web/section_dsl.rb +1 -0
  50. data/spec/support/shared_examples/capybara_context_holder.rb +1 -1
  51. data/spec/support/shared_examples/meta_highlight_xpath.rb +41 -0
  52. data/spec/unit/generators/config_generator_spec.rb +4 -2
  53. data/spec/unit/generators/root_generator_spec.rb +32 -21
  54. data/spec/unit/generators/templates/cucumber_spec.rb +97 -0
  55. data/spec/unit/generators/templates/rspec_spec.rb +88 -0
  56. data/spec/unit/generators/templates/turnip_spec.rb +98 -0
  57. data/spec/unit/lib/capybara_helpers_spec.rb +37 -4
  58. data/spec/unit/lib/howitzer_spec.rb +23 -0
  59. data/spec/unit/lib/meta/element_spec.rb +59 -0
  60. data/spec/unit/lib/meta/entry_spec.rb +77 -0
  61. data/spec/unit/lib/meta/iframe_spec.rb +66 -0
  62. data/spec/unit/lib/meta/section_spec.rb +43 -0
  63. data/spec/unit/lib/utils/string_extensions_spec.rb +1 -1
  64. data/spec/unit/lib/web/element_dsl_spec.rb +10 -1
  65. data/spec/unit/lib/web/page_spec.rb +7 -0
  66. data/spec/unit/lib/web/section_spec.rb +7 -0
  67. metadata +31 -15
  68. data/generators/config/templates/drivers/phantomjs.rb +0 -19
@@ -20,10 +20,11 @@ RSpec.describe 'Generators' do
20
20
  { name: '/config/custom.yml', is_directory: false, size: template_file_size('config', 'custom.yml') },
21
21
  { name: '/config/default.yml', is_directory: false, size: template_file_size('config', 'default.yml') },
22
22
  { name: '/config/drivers', is_directory: true },
23
+ { name: '/config/drivers/appium.rb', is_directory: false, size: 723 },
23
24
  { name: '/config/drivers/browserstack.rb', is_directory: false, size: 1018 },
24
25
  { name: '/config/drivers/crossbrowsertesting.rb', is_directory: false, size: 1237 },
25
26
  { name: '/config/drivers/headless_chrome.rb', is_directory: false, size: 649 },
26
- { name: '/config/drivers/phantomjs.rb', is_directory: false, size: 589 },
27
+ { name: '/config/drivers/headless_firefox.rb', is_directory: false, size: 1059 },
27
28
  { name: '/config/drivers/poltergeist.rb', is_directory: false, size: 362 },
28
29
  { name: '/config/drivers/sauce.rb', is_directory: false, size: 968 },
29
30
  { name: '/config/drivers/selenium.rb', is_directory: false, size: 1097 },
@@ -41,10 +42,11 @@ RSpec.describe 'Generators' do
41
42
  #{ColorizedString.new('Added').light_green} 'config/custom.yml' file
42
43
  #{ColorizedString.new('Added').light_green} 'config/capybara.rb' file
43
44
  #{ColorizedString.new('Added').light_green} 'config/default.yml' file
45
+ #{ColorizedString.new('Added').light_green} 'config/drivers/appium.rb' file
44
46
  #{ColorizedString.new('Added').light_green} 'config/drivers/browserstack.rb' file
45
47
  #{ColorizedString.new('Added').light_green} 'config/drivers/crossbrowsertesting.rb' file
46
48
  #{ColorizedString.new('Added').light_green} 'config/drivers/headless_chrome.rb' file
47
- #{ColorizedString.new('Added').light_green} 'config/drivers/phantomjs.rb' file
49
+ #{ColorizedString.new('Added').light_green} 'config/drivers/headless_firefox.rb' file
48
50
  #{ColorizedString.new('Added').light_green} 'config/drivers/poltergeist.rb' file
49
51
  #{ColorizedString.new('Added').light_green} 'config/drivers/sauce.rb' file
50
52
  #{ColorizedString.new('Added').light_green} 'config/drivers/selenium.rb' file
@@ -15,59 +15,70 @@ RSpec.describe 'Generators' do
15
15
  let(:expected_result) do
16
16
  [
17
17
  { name: '/.gitignore', is_directory: false, size: 196 },
18
- { name: '/.rubocop.yml', is_directory: false, size: 633 },
19
- { name: '/Gemfile', is_directory: false, size: 624 },
18
+ { name: '/.rubocop.yml', is_directory: false, size: 616 },
19
+ { name: '/Gemfile', is_directory: false, size: 811 },
20
20
  { name: '/Rakefile', is_directory: false, size: template_file_size('root', 'Rakefile') }
21
21
  ]
22
22
  end
23
23
  let(:options) { {} }
24
+
24
25
  it { is_expected.to eql(expected_result) }
26
+
25
27
  describe 'output' do
26
28
  subject { output.string }
29
+
27
30
  context 'when options is empty' do
28
31
  let(:expected_output) do
32
+ added_text = ColorizedString.new('Added').light_green
29
33
  "#{ColorizedString.new(' * Root files generation ...').light_cyan}
30
- #{ColorizedString.new('Added').light_green} '.gitignore' file
31
- #{ColorizedString.new('Added').light_green} '.rubocop.yml' file
32
- #{ColorizedString.new('Added').light_green} 'Rakefile' file
33
- #{ColorizedString.new('Added').light_green} template 'Gemfile.erb' with params '{}' to destination 'Gemfile'\n"
34
+ #{added_text} '.gitignore' file
35
+ #{added_text} 'Rakefile' file
36
+ #{added_text} template '.rubocop.yml.erb' with params '{}' to destination '.rubocop.yml'
37
+ #{added_text} template 'Gemfile.erb' with params '{}' to destination 'Gemfile'\n"
34
38
  end
39
+
35
40
  it { is_expected.to eql(expected_output) }
36
41
  end
42
+
37
43
  context 'when options is rspec => true' do
38
44
  let(:expected_output) do
45
+ added_text = ColorizedString.new('Added').light_green
39
46
  "#{ColorizedString.new(' * Root files generation ...').light_cyan}
40
- #{ColorizedString.new('Added').light_green} '.gitignore' file
41
- #{ColorizedString.new('Added').light_green} '.rubocop.yml' file
42
- #{ColorizedString.new('Added').light_green} 'Rakefile' file
43
- #{ColorizedString.new('Added').light_green} template 'Gemfile.erb' with params '{:rspec=>true}' to"\
44
- " destination 'Gemfile'\n"
47
+ #{added_text} '.gitignore' file
48
+ #{added_text} 'Rakefile' file
49
+ #{added_text} template '.rubocop.yml.erb' with params '{:rspec=>true}' to destination '.rubocop.yml'
50
+ #{added_text} template 'Gemfile.erb' with params '{:rspec=>true}' to destination 'Gemfile'\n"
45
51
  end
46
52
  let(:options) { { rspec: true } }
53
+
47
54
  it { is_expected.to eql(expected_output) }
48
55
  end
56
+
49
57
  context 'when options is cucumber => cucumber' do
50
58
  let(:expected_output) do
59
+ added_text = ColorizedString.new('Added').light_green
51
60
  "#{ColorizedString.new(' * Root files generation ...').light_cyan}
52
- #{ColorizedString.new('Added').light_green} '.gitignore' file
53
- #{ColorizedString.new('Added').light_green} '.rubocop.yml' file
54
- #{ColorizedString.new('Added').light_green} 'Rakefile' file
55
- #{ColorizedString.new('Added').light_green} template 'Gemfile.erb' with params '{:cucumber=>true}'"\
56
- " to destination 'Gemfile'\n"
61
+ #{added_text} '.gitignore' file
62
+ #{added_text} 'Rakefile' file
63
+ #{added_text} template '.rubocop.yml.erb' with params '{:cucumber=>true}' to destination '.rubocop.yml'
64
+ #{added_text} template 'Gemfile.erb' with params '{:cucumber=>true}' to destination 'Gemfile'\n"
57
65
  end
58
66
  let(:options) { { cucumber: true } }
67
+
59
68
  it { is_expected.to eql(expected_output) }
60
69
  end
70
+
61
71
  context 'when options is turnip => true' do
62
72
  let(:expected_output) do
73
+ added_text = ColorizedString.new('Added').light_green
63
74
  "#{ColorizedString.new(' * Root files generation ...').light_cyan}
64
- #{ColorizedString.new('Added').light_green} '.gitignore' file
65
- #{ColorizedString.new('Added').light_green} '.rubocop.yml' file
66
- #{ColorizedString.new('Added').light_green} 'Rakefile' file
67
- #{ColorizedString.new('Added').light_green} template 'Gemfile.erb' with params '{:turnip=>true}' to"\
68
- " destination 'Gemfile'\n"
75
+ #{added_text} '.gitignore' file
76
+ #{added_text} 'Rakefile' file
77
+ #{added_text} template '.rubocop.yml.erb' with params '{:turnip=>true}' to destination '.rubocop.yml'
78
+ #{added_text} template 'Gemfile.erb' with params '{:turnip=>true}' to destination 'Gemfile'\n"
69
79
  end
70
80
  let(:options) { { turnip: true } }
81
+
71
82
  it { is_expected.to eql(expected_output) }
72
83
  end
73
84
  end
@@ -0,0 +1,97 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Howitzer::BaseGenerator do
4
+ describe 'Template rendering' do
5
+ context 'when cucumber' do
6
+ subject { ERB.new(template, nil, '-').result(binding) }
7
+ let(:cucumber) { true }
8
+ let(:rspec) { false }
9
+ let(:turnip) { false }
10
+ let(:template) { File.open(source_path, 'r').read }
11
+
12
+ context '.rubocop.yml' do
13
+ let(:source_path) { File.join('generators', 'root', 'templates', '.rubocop.yml.erb') }
14
+ it do
15
+ res = <<~EXPECTED_CONTENT
16
+ # See full list of defaults here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
17
+ # To see all cops used see here: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
18
+
19
+ AllCops:
20
+ DisplayCopNames: true
21
+ TargetRubyVersion: 2.4
22
+
23
+ Layout/CaseIndentation:
24
+ Enabled: false
25
+
26
+ Lint/AmbiguousBlockAssociation:
27
+ Enabled: false
28
+
29
+ Lint/AmbiguousRegexpLiteral:
30
+ Enabled: false
31
+
32
+ Metrics/BlockLength:
33
+ Enabled: false
34
+
35
+ Metrics/LineLength:
36
+ Max: 120
37
+
38
+ Metrics/ModuleLength:
39
+ Max: 150
40
+
41
+ Style/CaseEquality:
42
+ Enabled: false
43
+
44
+ Style/Documentation:
45
+ Enabled: false
46
+
47
+ Style/EmptyElse:
48
+ Enabled: false
49
+
50
+ Style/FrozenStringLiteralComment:
51
+ Enabled: false
52
+
53
+ Style/SymbolProc:
54
+ Exclude:
55
+ - 'features/step_definitions/**/*.rb'
56
+ EXPECTED_CONTENT
57
+ is_expected.to eq(res)
58
+ end
59
+ end
60
+
61
+ context 'Gemfile' do
62
+ let(:source_path) { File.join('generators', 'root', 'templates', 'Gemfile.erb') }
63
+ it do
64
+ res = <<~EXPECTED_CONTENT
65
+ source 'https://rubygems.org'
66
+
67
+ gem 'capybara-screenshot'
68
+ gem 'cucumber', '~>3.0'
69
+ gem 'cuke_sniffer', require: false
70
+ gem 'factory_bot'
71
+ gem 'howitzer'
72
+ gem 'pry'
73
+ gem 'pry-byebug'
74
+ gem 'repeater'
75
+ gem 'rest-client'
76
+ gem 'rubocop'
77
+ gem 'syntax'
78
+
79
+ # Uncomment it if you are going to use 'appium' driver. Appium and Android SDK should be installed.
80
+ # See https://appium.io/docs/en/about-appium/getting-started/
81
+ # gem 'appium_capybara'
82
+
83
+ # Uncomment it if you are going to use 'webkit' driver. QT library should be installed.
84
+ # See https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
85
+ #
86
+ # gem 'capybara-webkit'
87
+
88
+ # Uncomment it if you are going to use 'poltergeist' driver. PhantomJS should be installed.
89
+ # See https://github.com/jnicklas/capybara#poltergeist
90
+ # gem 'poltergeist', git: 'https://github.com/teampoltergeist/poltergeist.git', branch: :master
91
+ EXPECTED_CONTENT
92
+ is_expected.to eq(res)
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,88 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Howitzer::BaseGenerator do
4
+ describe 'Template rendering' do
5
+ context 'when rspecr' do
6
+ subject { ERB.new(template, nil, '-').result(binding) }
7
+ let(:cucumber) { false }
8
+ let(:rspec) { true }
9
+ let(:turnip) { false }
10
+ let(:template) { File.open(source_path, 'r').read }
11
+
12
+ context '.rubocop.yml' do
13
+ let(:source_path) { File.join('generators', 'root', 'templates', '.rubocop.yml.erb') }
14
+ it do
15
+ res = <<~EXPECTED_CONTENT
16
+ # See full list of defaults here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
17
+ # To see all cops used see here: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
18
+
19
+ AllCops:
20
+ DisplayCopNames: true
21
+ TargetRubyVersion: 2.4
22
+
23
+ Layout/CaseIndentation:
24
+ Enabled: false
25
+
26
+ Lint/AmbiguousRegexpLiteral:
27
+ Enabled: false
28
+
29
+ Metrics/BlockLength:
30
+ Enabled: false
31
+
32
+ Metrics/LineLength:
33
+ Max: 120
34
+
35
+ Metrics/ModuleLength:
36
+ Max: 150
37
+
38
+ Style/CaseEquality:
39
+ Enabled: false
40
+
41
+ Style/Documentation:
42
+ Enabled: false
43
+
44
+ Style/EmptyElse:
45
+ Enabled: false
46
+
47
+ Style/FrozenStringLiteralComment:
48
+ Enabled: false
49
+ EXPECTED_CONTENT
50
+ is_expected.to eq(res)
51
+ end
52
+ end
53
+
54
+ context 'Gemfile' do
55
+ let(:source_path) { File.join('generators', 'root', 'templates', 'Gemfile.erb') }
56
+ it do
57
+ res = <<~EXPECTED_CONTENT
58
+ source 'https://rubygems.org'
59
+
60
+ gem 'capybara-screenshot'
61
+ gem 'factory_bot'
62
+ gem 'howitzer'
63
+ gem 'pry'
64
+ gem 'pry-byebug'
65
+ gem 'repeater'
66
+ gem 'rest-client'
67
+ gem 'rspec', '~>3.2'
68
+ gem 'rubocop'
69
+
70
+ # Uncomment it if you are going to use 'appium' driver. Appium and Android SDK should be installed.
71
+ # See https://appium.io/docs/en/about-appium/getting-started/
72
+ # gem 'appium_capybara'
73
+
74
+ # Uncomment it if you are going to use 'webkit' driver. QT library should be installed.
75
+ # See https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
76
+ #
77
+ # gem 'capybara-webkit'
78
+
79
+ # Uncomment it if you are going to use 'poltergeist' driver. PhantomJS should be installed.
80
+ # See https://github.com/jnicklas/capybara#poltergeist
81
+ # gem 'poltergeist', git: 'https://github.com/teampoltergeist/poltergeist.git', branch: :master
82
+ EXPECTED_CONTENT
83
+ is_expected.to eq(res)
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,98 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Howitzer::BaseGenerator do
4
+ describe 'Template rendering' do
5
+ context 'when turnip' do
6
+ subject { ERB.new(template, nil, '-').result(binding) }
7
+ let(:cucumber) { false }
8
+ let(:rspec) { false }
9
+ let(:turnip) { true }
10
+ let(:template) { File.open(source_path, 'r').read }
11
+
12
+ context '.rubocop.yml' do
13
+ let(:source_path) { File.join('generators', 'root', 'templates', '.rubocop.yml.erb') }
14
+ it do
15
+ res = <<~EXPECTED_CONTENT
16
+ # See full list of defaults here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
17
+ # To see all cops used see here: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
18
+
19
+ AllCops:
20
+ DisplayCopNames: true
21
+ TargetRubyVersion: 2.4
22
+
23
+ Layout/CaseIndentation:
24
+ Enabled: false
25
+
26
+ Lint/AmbiguousRegexpLiteral:
27
+ Enabled: false
28
+
29
+ Metrics/BlockLength:
30
+ Enabled: false
31
+
32
+ Metrics/LineLength:
33
+ Max: 120
34
+
35
+ Metrics/ModuleLength:
36
+ Max: 150
37
+
38
+ Style/CaseEquality:
39
+ Enabled: false
40
+
41
+ Style/Documentation:
42
+ Enabled: false
43
+
44
+ Style/EmptyElse:
45
+ Enabled: false
46
+
47
+ Style/FrozenStringLiteralComment:
48
+ Enabled: false
49
+
50
+ Style/MixinGrouping:
51
+ EnforcedStyle: separated
52
+ Exclude:
53
+ - '**/*_steps.rb'
54
+
55
+ Style/SymbolProc:
56
+ Exclude:
57
+ - 'spec/steps/**/*.rb'
58
+ EXPECTED_CONTENT
59
+ is_expected.to eq(res)
60
+ end
61
+ end
62
+
63
+ context 'Gemfile' do
64
+ let(:source_path) { File.join('generators', 'root', 'templates', 'Gemfile.erb') }
65
+ it do
66
+ res = <<~EXPECTED_CONTENT
67
+ source 'https://rubygems.org'
68
+
69
+ gem 'capybara-screenshot'
70
+ gem 'factory_bot'
71
+ gem 'howitzer'
72
+ gem 'pry'
73
+ gem 'pry-byebug'
74
+ gem 'repeater'
75
+ gem 'rest-client'
76
+ gem 'rspec', '~>3.2'
77
+ gem 'rubocop'
78
+ gem 'turnip'
79
+
80
+ # Uncomment it if you are going to use 'appium' driver. Appium and Android SDK should be installed.
81
+ # See https://appium.io/docs/en/about-appium/getting-started/
82
+ # gem 'appium_capybara'
83
+
84
+ # Uncomment it if you are going to use 'webkit' driver. QT library should be installed.
85
+ # See https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
86
+ #
87
+ # gem 'capybara-webkit'
88
+
89
+ # Uncomment it if you are going to use 'poltergeist' driver. PhantomJS should be installed.
90
+ # See https://github.com/jnicklas/capybara#poltergeist
91
+ # gem 'poltergeist', git: 'https://github.com/teampoltergeist/poltergeist.git', branch: :master
92
+ EXPECTED_CONTENT
93
+ is_expected.to eq(res)
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -6,7 +6,6 @@ RSpec.describe Howitzer::CapybaraHelpers do
6
6
 
7
7
  let(:selenium_driver) { false }
8
8
  let(:selenium_grid_driver) { false }
9
- let(:phantomjs_driver) { false }
10
9
  let(:sauce_driver) { false }
11
10
  let(:test_object) { described_class }
12
11
 
@@ -26,7 +25,7 @@ RSpec.describe Howitzer::CapybaraHelpers do
26
25
  it { is_expected.to be_truthy }
27
26
  end
28
27
  context 'when not cloud driver' do
29
- let(:driver_setting) { :phantomjs }
28
+ let(:driver_setting) { :poltergeist }
30
29
  it { is_expected.to be_falsey }
31
30
  end
32
31
  context 'when driver specified as String' do
@@ -47,7 +46,7 @@ RSpec.describe Howitzer::CapybaraHelpers do
47
46
  it { is_expected.to be_falsey }
48
47
  end
49
48
  context 'when not :selenium' do
50
- let(:driver_setting) { :phantomjs }
49
+ let(:driver_setting) { :poltergeist }
51
50
  it { is_expected.to be_falsey }
52
51
  end
53
52
  context 'when driver specified as String' do
@@ -56,6 +55,40 @@ RSpec.describe Howitzer::CapybaraHelpers do
56
55
  end
57
56
  end
58
57
 
58
+ describe '#headless_chrome_driver?' do
59
+ subject { headless_chrome_driver? }
60
+ before { allow(Howitzer).to receive(:driver) { driver_setting } }
61
+ context 'when :headless_chrome' do
62
+ let(:driver_setting) { :headless_chrome }
63
+ it { is_expected.to be_truthy }
64
+ end
65
+ context 'when not :headless_chrome' do
66
+ let(:driver_setting) { :selenium }
67
+ it { is_expected.to be_falsey }
68
+ end
69
+ context 'when driver specified as String' do
70
+ let(:driver_setting) { 'headless_chrome' }
71
+ it { is_expected.to be_truthy }
72
+ end
73
+ end
74
+
75
+ describe '#headless_firefox_driver?' do
76
+ subject { headless_firefox_driver? }
77
+ before { allow(Howitzer).to receive(:driver) { driver_setting } }
78
+ context 'when :headless_firefox_driver' do
79
+ let(:driver_setting) { :headless_firefox }
80
+ it { is_expected.to be_truthy }
81
+ end
82
+ context 'when not :headless_firefox' do
83
+ let(:driver_setting) { :selenium }
84
+ it { is_expected.to be_falsey }
85
+ end
86
+ context 'when driver specified as String' do
87
+ let(:driver_setting) { 'headless_firefox' }
88
+ it { is_expected.to be_truthy }
89
+ end
90
+ end
91
+
59
92
  describe '#selenium_grid_driver?' do
60
93
  subject { selenium_grid_driver? }
61
94
  before { allow(Howitzer).to receive(:driver) { driver_setting } }
@@ -68,7 +101,7 @@ RSpec.describe Howitzer::CapybaraHelpers do
68
101
  it { is_expected.to be_falsey }
69
102
  end
70
103
  context 'when not :selenium' do
71
- let(:driver_setting) { :phantomjs }
104
+ let(:driver_setting) { :poltergeist }
72
105
  it { is_expected.to be_falsey }
73
106
  end
74
107
  context 'when driver specified as String' do