From 6953230a11a0b3bb3a592a0d563123b3c15315d7 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:24:39 +0100 Subject: [PATCH 01/16] Use proper versions of factory_bot and database_cleaner-active_record --- features/support/cucumber_rails_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index c0c307cb..5c461d7a 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -22,8 +22,8 @@ def install_cucumber_rails(*options) add_gem 'capybara', Capybara::VERSION, group: :test add_gem 'rspec-expectations', '~> 3.7', group: :test add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) - add_gem 'database_cleaner-active_record', '>= 2.0.0.beta2', group: :test if options.include?(:database_cleaner_active_record) - add_gem 'factory_bot', '>= 3.2', group: :test unless options.include?(:no_factory_bot) + add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) + add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) bundle_install run_command_and_stop 'bundle exec rails generate cucumber:install' From 341625aaaae7335498524afd1d2ebdb4c6f7bee8 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:27:43 +0100 Subject: [PATCH 02/16] Simplify rails_new command in testing --- features/support/cucumber_rails_helper.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 5c461d7a..cc062482 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -6,7 +6,7 @@ module CucumberRailsHelper def rails_new(options = {}) - validate_rails_new_success(run_rails_new_command(options)) + run_rails_new_command(options) cd options[:name] configure_rails_gems configure_rails_requires @@ -83,11 +83,6 @@ def run_rails_new_command(options) run_command "bundle exec rails new #{options[:name]} #{flags.join(' ')} #{options[:args]}" end - def validate_rails_new_success(result) - expect(result).to have_output(/README/) - expect(last_command_started).to be_successfully_executed - end - def clear_bundle_env_vars unset_bundler_env_vars delete_environment_variable 'BUNDLE_GEMFILE' From 84cefa5782f117f2eee1f8f0cc3788345164b507 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:28:56 +0100 Subject: [PATCH 03/16] test using latest rspec --- features/support/cucumber_rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index cc062482..3e053521 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -20,7 +20,7 @@ def install_cucumber_rails(*options) add_gem 'cucumber', Cucumber::VERSION, group: :test add_gem 'capybara', Capybara::VERSION, group: :test - add_gem 'rspec-expectations', '~> 3.7', group: :test + add_gem 'rspec-expectations', '~> 3.12', group: :test add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) From 797954292f47acee8db389ddd55622662e83df05 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:29:52 +0100 Subject: [PATCH 04/16] Minor readme tweaks --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 588cdb17..0f0c7c36 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Cucumber feature. Let's say you think you have found a bug in the cucumber:insta Fork this project, clone it to your workstation and check out a branch with a descriptive name: git clone git@github.com:you/cucumber-rails.git - git checkout -b bugfix/generator-fails-on-ruby-25 + git checkout -b bugfix/generator-fails-on-ruby-31 Start by making sure you can run the existing features. Now, create a feature that demonstrates what's wrong. See the existing features for examples. When you have a failing feature that @@ -118,10 +118,8 @@ To support the multiple-gemfile testing, when adding a new dependency the follow 1. If it's a runtime dependency of the gem, add it to the gemspec 2. If it's a primary development dependency, add it to the gemspec -3. If it's a dependency of a generated rails app in a test, add it to [the helper] that -modifies the `Gemfile`. +3. If it's a dependency of a generated rails app in a test, add it to [the helper] that modifies the `Gemfile` For example, rspec is a primary development dependency, so it lives in the gemspec. [the helper]: https://github.com/cucumber/cucumber-rails/blob/5e37c530560ae1c1a79521c38a54bae0be94242b/features/step_definitions/cucumber_rails_steps.rb#L15 - From 9ff82bb85e1cb9cb4920d7c74d4fadaf398ddcce Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:32:12 +0100 Subject: [PATCH 05/16] Fix up changelogs --- CHANGELOG.md | 19 ++++++++++++++++--- CHANGELOG.old.md | 25 ------------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f717b7ec..956c1435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,11 +19,24 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber ### Changed - Automate release process [#554](https://github.com/cucumber/cucumber-rails/pull/554) -## [v2.6.0] +## [2.6.0] - 2022-10-07 +### New Features +* Dependabot has now been added to the repo (Alongside this a bunch of gem updates have been done) + ([#540](https://github.com/cucumber/cucumber-rails/pull/540) [mattwynne]) + ### Changed -- New release process. Older releases are in [this changelog](./CHANGELOG.old.md). +* Gem update: allowed cucumber 8 ([#538](https://github.com/cucumber/cucumber-rails/pull/538) / [#541](https://github.com/cucumber/cucumber-rails/pull/541) [mattwynne]) + +* New release process. Older releases are in [this changelog](./CHANGELOG.old.md) + +### Fixed +* Some bugs with dev dependencies have now been fixed externally, so these have been unrestricted + ([#552](https://github.com/cucumber/cucumber-rails/pull/552) [BrianHawley]) + +* Fixed up some rubocop offenses from updated `rubocop-performance` + ([#550](https://github.com/cucumber/cucumber-rails/pull/550) [olleolleolle]) [Unreleased]: https://github.com/cucumber/cucumber-rails/compare/v3.0.0.rc.1...main [3.0.0.rc.1]: https://github.com/cucumber/cucumber-rails/compare/v2.6.1...v3.0.0.rc.1 [2.6.1]: https://github.com/cucumber/cucumber-rails/compare/v2.6.0...v2.6.1 -[v2.6.0]: ./CHANGELOG.old.md +[2.6.0]: https://github.com/cucumber/cucumber-rails/compare/v2.5.1...v2.6.0 diff --git a/CHANGELOG.old.md b/CHANGELOG.old.md index 6cad07c3..093da6aa 100644 --- a/CHANGELOG.old.md +++ b/CHANGELOG.old.md @@ -1,31 +1,6 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) on how to contribute to Cucumber. -## [main](https://github.com/cucumber/cucumber-rails/compare/v2.5.1...main) (Not yet released) - -### New Features - -### Changed - -### Fixed - -## [v2.6.0](https://github.com/cucumber/cucumber-rails/compare/v2.5.1...v2.6.0) (2022-10-07) - -### New Features -* Dependabot has now been added to the repo (Alongside this a bunch of gem updates have been done) - ([#540](https://github.com/cucumber/cucumber-rails/pull/540) [mattwynne]) - -### Changed -* Gem update: allowed cucumber 8 ([#538](https://github.com/cucumber/cucumber-rails/pull/538) / - [#541](https://github.com/cucumber/cucumber-rails/pull/541) [mattwynne]) - -### Fixed -* Some bugs with dev dependencies have now been fixed externally, so these have been unrestricted - ([#552](https://github.com/cucumber/cucumber-rails/pull/552) [BrianHawley]) - -* Fixed up some rubocop offenses from updated `rubocop-performance` - ([#550](https://github.com/cucumber/cucumber-rails/pull/550) [olleolleolle]) - ## [v2.5.1](https://github.com/cucumber/cucumber-rails/compare/v2.5.0...v2.5.1) (2022-04-01) ### Fixed From 060c5c455ea3edaf4aad48fbbd510ba00f6d1271 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:37:57 +0100 Subject: [PATCH 06/16] Remove redundant parts of cucumber.yml file --- config/cucumber.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/cucumber.yml b/config/cucumber.yml index 6cf36d24..432a61b1 100644 --- a/config/cucumber.yml +++ b/config/cucumber.yml @@ -11,7 +11,6 @@ opts = [ "--format #{path == 'features' ? 'progress' : 'pretty'}", "--format rerun -o #{rerun_file}" ] -rails_version = `bundle exec rails --version`.match(/[\d.]+$/).to_s optlist = opts.join(' ') %> -default: <%= path %> <%= optlist %> --tags 'not @broken' +default: <%= path %> <%= optlist %> From b30d27b0eef626f861bb851707efdb744ac62b83 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 15:41:28 +0100 Subject: [PATCH 07/16] Simplify conditional gem installs and ensure selenium is of a reasonably new version --- features/support/cucumber_rails_helper.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 3e053521..77954b04 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -15,15 +15,16 @@ def rails_new(options = {}) end def install_cucumber_rails(*options) - add_conditional_gems(options) - add_rails_specific_gems + add_cucumber_rails(options) + add_sqlite3 add_gem 'cucumber', Cucumber::VERSION, group: :test add_gem 'capybara', Capybara::VERSION, group: :test - add_gem 'rspec-expectations', '~> 3.12', group: :test add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) + add_gem 'rspec-expectations', '~> 3.12', group: :test + add_gem 'selenium-webdriver', '~> 4.6', group: :test bundle_install run_command_and_stop 'bundle exec rails generate cucumber:install' @@ -92,7 +93,7 @@ def rails_equal_or_higher_than?(version) Rails.gem_version >= Gem::Version.new(version) end - def add_conditional_gems(options) + def add_cucumber_rails(options) if options.include?(:not_in_test_group) add_gem 'cucumber-rails', path: File.expand_path('.').to_s else @@ -100,13 +101,11 @@ def add_conditional_gems(options) end end - def add_rails_specific_gems + def add_sqlite3 if rails_equal_or_higher_than?('6.0') add_gem 'sqlite3', '~> 1.4' - add_gem 'selenium-webdriver', '~> 4.0', group: :test else add_gem 'sqlite3', '~> 1.3.13' - add_gem 'selenium-webdriver', '~> 3.11', group: :test end end From a8ae4bdb26acc0e70d2bde08cde3e23836a49af6 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 16:21:05 +0100 Subject: [PATCH 08/16] Re-order file contents --- features/support/cucumber_rails_helper.rb | 76 +++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 77954b04..1a40a39e 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -32,28 +32,12 @@ def install_cucumber_rails(*options) private - def add_gem(name, *args) - line = convert_gem_opts_to_string(name, *args) - gem_regexp = /gem ["']#{name}["'].*$/ - gemfile_content = File.read(expand_path('Gemfile')) - - if gemfile_content.match?(gem_regexp) - updated_gemfile_content = gemfile_content.gsub(gem_regexp, line) - overwrite_file('Gemfile', updated_gemfile_content) - else - append_to_file('Gemfile', line) - end - end - - def remove_gem(name) - content = File.read(expand_path('Gemfile')).gsub(/^\s*gem ["']#{name}["'].*$/, '') - overwrite_file('Gemfile', content) - end - - def bundle_install - run_command_and_stop 'bundle config set --local without "development"' - run_command_and_stop "bundle config set --local path '#{ENV.fetch('GITHUB_WORKSPACE')}/vendor/bundle'" if ENV.key?('GITHUB_WORKSPACE') - run_command_and_stop 'bundle install --jobs 4' + def run_rails_new_command(options) + options[:name] ||= 'test_app' + flags = %w[--skip-action-cable --skip-action-mailer --skip-active-job --skip-bootsnap --skip-bundle --skip-javascript + --skip-jbuilder --skip-listen --skip-spring --skip-sprockets --skip-test-unit --skip-turbolinks --skip-active-storage] + flags += %w[--skip-action-mailbox --skip-action-text] if rails_equal_or_higher_than?('6.0') + run_command "bundle exec rails new #{options[:name]} #{flags.join(' ')} #{options[:args]}" end def configure_rails_gems @@ -63,8 +47,8 @@ def configure_rails_gems def configure_rails_requires content = File.read(expand_path('config/application.rb')) - %w[ active_job/railtie active_storage/engine action_mailer/railtie action_mailbox/engine - action_text/engine action_cable/engine rails/test_unit/railtie sprockets/railtie ].each do |require| + %w[active_job/railtie active_storage/engine action_mailer/railtie action_mailbox/engine + action_text/engine action_cable/engine rails/test_unit/railtie sprockets/railtie].each do |require| content = content.gsub(/^.*require ["']#{require}["']\s*$/, '') end overwrite_file('config/application.rb', content) @@ -76,14 +60,6 @@ def configure_rails_layout overwrite_file(file, content) end - def run_rails_new_command(options) - options[:name] ||= 'test_app' - flags = %w[--skip-action-cable --skip-action-mailer --skip-active-job --skip-bootsnap --skip-bundle --skip-javascript - --skip-jbuilder --skip-listen --skip-spring --skip-sprockets --skip-test-unit --skip-turbolinks --skip-active-storage] - flags += %w[--skip-action-mailbox --skip-action-text] if rails_equal_or_higher_than?('6.0') - run_command "bundle exec rails new #{options[:name]} #{flags.join(' ')} #{options[:args]}" - end - def clear_bundle_env_vars unset_bundler_env_vars delete_environment_variable 'BUNDLE_GEMFILE' @@ -93,6 +69,32 @@ def rails_equal_or_higher_than?(version) Rails.gem_version >= Gem::Version.new(version) end + def remove_gem(name) + content = File.read(expand_path('Gemfile')).gsub(/^\s*gem ["']#{name}["'].*$/, '') + overwrite_file('Gemfile', content) + end + + def add_gem(name, *args) + line = convert_gem_opts_to_string(name, *args) + gem_regexp = /gem ["']#{name}["'].*$/ + gemfile_content = File.read(expand_path('Gemfile')) + + if gemfile_content.match?(gem_regexp) + updated_gemfile_content = gemfile_content.gsub(gem_regexp, line) + overwrite_file('Gemfile', updated_gemfile_content) + else + append_to_file('Gemfile', line) + end + end + + def convert_gem_opts_to_string(name, *args) + options = args.last.is_a?(Hash) ? args.pop : {} + parts = ["'#{name}'"] + parts << args.map(&:inspect) if args.any? + parts << options.inspect[1..-2] if options.any? + "gem #{parts.flatten.join(', ')}\n" + end + def add_cucumber_rails(options) if options.include?(:not_in_test_group) add_gem 'cucumber-rails', path: File.expand_path('.').to_s @@ -109,12 +111,10 @@ def add_sqlite3 end end - def convert_gem_opts_to_string(name, *args) - options = args.last.is_a?(Hash) ? args.pop : {} - parts = ["'#{name}'"] - parts << args.map(&:inspect) if args.any? - parts << options.inspect[1..-2] if options.any? - "gem #{parts.flatten.join(', ')}\n" + def bundle_install + run_command_and_stop 'bundle config set --local without "development"' + run_command_and_stop "bundle config set --local path '#{ENV.fetch('GITHUB_WORKSPACE')}/vendor/bundle'" if ENV.key?('GITHUB_WORKSPACE') + run_command_and_stop 'bundle install --jobs 4' end end From 33eb2358924228a71a818feac7ed5ddf4532ecd4 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 16:49:30 +0100 Subject: [PATCH 09/16] Fix rubocop --- features/support/cucumber_rails_helper.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 1a40a39e..1d76a7ad 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -17,15 +17,7 @@ def rails_new(options = {}) def install_cucumber_rails(*options) add_cucumber_rails(options) add_sqlite3 - - add_gem 'cucumber', Cucumber::VERSION, group: :test - add_gem 'capybara', Capybara::VERSION, group: :test - add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) - add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) - add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) - add_gem 'rspec-expectations', '~> 3.12', group: :test - add_gem 'selenium-webdriver', '~> 4.6', group: :test - + add_remaining_gems(options) bundle_install run_command_and_stop 'bundle exec rails generate cucumber:install' end @@ -111,6 +103,16 @@ def add_sqlite3 end end + def add_remaining_gems(options) + add_gem 'cucumber', Cucumber::VERSION, group: :test + add_gem 'capybara', Capybara::VERSION, group: :test + add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) + add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) + add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) + add_gem 'rspec-expectations', '~> 3.12', group: :test + add_gem 'selenium-webdriver', '~> 4.6', group: :test + end + def bundle_install run_command_and_stop 'bundle config set --local without "development"' run_command_and_stop "bundle config set --local path '#{ENV.fetch('GITHUB_WORKSPACE')}/vendor/bundle'" if ENV.key?('GITHUB_WORKSPACE') From 2b58e0e09173ea630590b98ca992495f1e554e69 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 17:04:57 +0100 Subject: [PATCH 10/16] Avoid race condition --- cucumber-rails.gemspec | 1 + features/support/cucumber_rails_helper.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cucumber-rails.gemspec b/cucumber-rails.gemspec index 58e099ef..90cdfd40 100644 --- a/cucumber-rails.gemspec +++ b/cucumber-rails.gemspec @@ -32,6 +32,7 @@ Gem::Specification.new do |s| s.add_development_dependency('aruba', ['>= 1.0', '< 3']) s.add_development_dependency('bundler', '>= 1.17') s.add_development_dependency('database_cleaner', ['>= 1.8', '< 3.0']) + s.add_development_dependency('rails', ['>= 5.2', '< 8']) s.add_development_dependency('rake', '>= 12.0') s.add_development_dependency('rspec', '~> 3.6') s.add_development_dependency('rubocop', '~> 1.28.2') diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 1d76a7ad..2f4667f0 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -6,7 +6,9 @@ module CucumberRailsHelper def rails_new(options = {}) - run_rails_new_command(options) + # This expectation allows us to wait until the command line monitor has output a README file (i.e. the command has completed) + expect(run_rails_new_command(options)).to have_output(/README/) + cd options[:name] configure_rails_gems configure_rails_requires From 86b5719d3d2f465f32c917bca0b06fa31c1df900 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 17:22:56 +0100 Subject: [PATCH 11/16] Downgrade selenium to work on ruby 2.6 --- features/support/cucumber_rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 2f4667f0..9b0980c0 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -112,7 +112,7 @@ def add_remaining_gems(options) add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) add_gem 'rspec-expectations', '~> 3.12', group: :test - add_gem 'selenium-webdriver', '~> 4.6', group: :test + add_gem 'selenium-webdriver', '~> 4.0', group: :test end def bundle_install From dd72b9098b1320df70eeb516d087cf9f9e7deb30 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 25 Sep 2023 17:23:14 +0100 Subject: [PATCH 12/16] Upgrade database cleaner to version 2 given this is tied now to sister gem --- features/support/cucumber_rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 9b0980c0..46729543 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -108,7 +108,7 @@ def add_sqlite3 def add_remaining_gems(options) add_gem 'cucumber', Cucumber::VERSION, group: :test add_gem 'capybara', Capybara::VERSION, group: :test - add_gem 'database_cleaner', '>= 1.8.0', group: :test unless options.include?(:no_database_cleaner) + add_gem 'database_cleaner', '>= 2.0.0', group: :test unless options.include?(:no_database_cleaner) add_gem 'database_cleaner-active_record', '>= 2.0.0', group: :test if options.include?(:database_cleaner_active_record) add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) add_gem 'rspec-expectations', '~> 3.12', group: :test From 2c93c9f95e09a64d68e4d9751fb6e71d2df82449 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 26 Sep 2023 11:57:46 +0100 Subject: [PATCH 13/16] Remove legacy gem on old versions of selenium/capybara when using rails 5.2 --- features/support/cucumber_rails_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index 46729543..6d338c10 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -113,6 +113,7 @@ def add_remaining_gems(options) add_gem 'factory_bot', '>= 5.0', group: :test unless options.include?(:no_factory_bot) add_gem 'rspec-expectations', '~> 3.12', group: :test add_gem 'selenium-webdriver', '~> 4.0', group: :test + %w[chromedriver-helper].each { |gem| remove_gem(gem) } unless rails_equal_or_higher_than?('6.0') end def bundle_install From 6a8768ff45b794a856e9a495029ab9114d2c1482 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 26 Sep 2023 11:59:29 +0100 Subject: [PATCH 14/16] Ensure all step defs live in folder to improve debugging --- features/capybara_javascript_drivers.feature | 6 +++--- features/raising_errors.feature | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/capybara_javascript_drivers.feature b/features/capybara_javascript_drivers.feature index 3d6e514d..aa63db0d 100644 --- a/features/capybara_javascript_drivers.feature +++ b/features/capybara_javascript_drivers.feature @@ -16,7 +16,7 @@ Feature: Capybara Javascript Drivers Then I should see "Cucumber Trainee" And I should see "2026-02-20 15:10:00 UTC" """ - And I write to "features/create_appointment_steps.rb" with: + And I write to "features/step_definitions/create_appointment_steps.rb" with: """ Given('I am on the new appointment page') do visit new_appointment_path @@ -63,7 +63,7 @@ Feature: Capybara Javascript Drivers Then I should see "Cucumber Trainee" And I should see "2026-02-20 15:10:00 UTC" """ - And I write to "features/create_appointment_steps.rb" with: + And I write to "features/step_definitions/create_appointment_steps.rb" with: """ Given('I am on the new appointment page') do visit new_appointment_path @@ -148,7 +148,7 @@ Feature: Capybara Javascript Drivers Then I should see "Cucumber Trainee" And I should see "2026-02-20 15:10:00 UTC" """ - And I write to "features/create_appointment_steps.rb" with: + And I write to "features/step_definitions/create_appointment_steps.rb" with: """ Given('I am on the new appointment page') do visit new_appointment_path diff --git a/features/raising_errors.feature b/features/raising_errors.feature index 06c62d75..0175ab7f 100644 --- a/features/raising_errors.feature +++ b/features/raising_errors.feature @@ -8,7 +8,7 @@ Feature: Raise Errors Scenario: Tests When I go to the home page """ - And I write to "features/home_steps.rb" with: + And I write to "features/step_definitions/home_steps.rb" with: """ When('I go to the home page') do visit('/') From df511aabad9ba717418be198909e20bfedc79f32 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 26 Sep 2023 12:00:42 +0100 Subject: [PATCH 15/16] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 956c1435..989c1f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 This file is intended to be modified using the [`changelog`](github.com/cucumber/changelog) command-line tool. ## [Unreleased] +### Fixed +* Some of the rails 5.2 tests were installing lots of old conflicting gems ## [3.0.0.rc.1] - 2023-09-15 ### Removed From 7863cb9109d468f30f356c710f9b8cd31a67f003 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 26 Sep 2023 12:02:07 +0100 Subject: [PATCH 16/16] Fix changelog formatting --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 989c1f99..63877c50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber ## [Unreleased] ### Fixed -* Some of the rails 5.2 tests were installing lots of old conflicting gems +* Some of the rails 5.2 tests were installing lots of old conflicting gems ([luke-hill]) ## [3.0.0.rc.1] - 2023-09-15 ### Removed @@ -42,3 +42,9 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber [3.0.0.rc.1]: https://github.com/cucumber/cucumber-rails/compare/v2.6.1...v3.0.0.rc.1 [2.6.1]: https://github.com/cucumber/cucumber-rails/compare/v2.6.0...v2.6.1 [2.6.0]: https://github.com/cucumber/cucumber-rails/compare/v2.5.1...v2.6.0 + +[olleolleolle]: https://github.com/olleolleolle +[BrianHawley]: https://github.com/BrianHawley +[mattwynne]: https://github.com/mattwynne +[orien]: https://github.com/orien +[luke-hill]: https://github.com/luke-hill