From 953f98e7a2688c3d9ff1ec424fbc4cf82a4551f7 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Fri, 20 Dec 2024 10:16:08 +0000 Subject: [PATCH 1/6] Add in options payload to all_there with default of no waiting --- lib/site_prism/element_checker.rb | 4 ++-- site_prism.gemspec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/site_prism/element_checker.rb b/lib/site_prism/element_checker.rb index 388d928..1a75422 100644 --- a/lib/site_prism/element_checker.rb +++ b/lib/site_prism/element_checker.rb @@ -31,8 +31,8 @@ module ElementChecker # Default: 'none' => Perform no recursion when calling #all_there? # Override: 'one' => Perform one recursive dive into all section/sections # items and call #all_there? on all of those items too. - def all_there?(recursion: :none) - SitePrism::AllThere::RecursionChecker.new(self).all_there?(recursion: recursion) + def all_there?(recursion: :none, options: { wait: 0 }) + SitePrism::AllThere::RecursionChecker.new(self).all_there?(recursion: recursion, options: options) end # Returns each element that is currently present inside the scope being tested diff --git a/site_prism.gemspec b/site_prism.gemspec index 9c6b34d..e99976b 100644 --- a/site_prism.gemspec +++ b/site_prism.gemspec @@ -9,8 +9,8 @@ Gem::Specification.new do |s| s.required_rubygems_version = '>= 3.2.3' s.platform = Gem::Platform::RUBY s.license = 'BSD-3-Clause' - s.authors = ['Luke Hill', 'Nat Ritmeyer'] - s.email = %w[lukehill_uk@hotmail.com nat@natontesting.com] + s.authors = ['Luke Hill'] + s.email = %w[lukehill_uk@hotmail.com] s.homepage = 'https://github.com/site-prism/site_prism' s.metadata = { 'bug_tracker_uri' => 'https://github.com/site-prism/site_prism/issues', From c4cb9b23dbc7c60fb3ef844bc742ba3017cd1152 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Fri, 20 Dec 2024 10:17:11 +0000 Subject: [PATCH 2/6] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952b64b..9055045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Added ### Changed +- Permit `#all_there?` to be called with an options payload (Defaults to no waiting for now) + - Pass in keys to the `options` hash i.e. `options: { wait: 5 }` to wait for a specific time ### Fixed From 1196ccabc546b9aed1d714251d6de79603e852ff Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Fri, 20 Dec 2024 10:21:18 +0000 Subject: [PATCH 3/6] Bump minimum supported versions of some gems including capybara --- site_prism.gemspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site_prism.gemspec b/site_prism.gemspec index e99976b..c98788c 100644 --- a/site_prism.gemspec +++ b/site_prism.gemspec @@ -24,15 +24,15 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.add_dependency 'addressable', '~> 2.8', '>= 2.8.4' - s.add_dependency 'capybara', '~> 3.32' - s.add_dependency 'site_prism-all_there', '> 2', '< 5' + s.add_dependency 'capybara', '~> 3.34' + s.add_dependency 'site_prism-all_there', '> 3', '< 5' - s.add_development_dependency 'automation_helpers', '~> 4.0' + s.add_development_dependency 'automation_helpers', '~> 5.0' s.add_development_dependency 'cucumber', '> 7', '< 10' - s.add_development_dependency 'rspec', '~> 3.12' + s.add_development_dependency 'rspec', '~> 3.13' s.add_development_dependency 'rubocop', '~> 1.69.0' s.add_development_dependency 'rubocop-performance', '~> 1.23.0' - s.add_development_dependency 'rubocop-rspec', '~> 3.2.0' + s.add_development_dependency 'rubocop-rspec', '~> 3.3.0' s.add_development_dependency 'selenium-webdriver', '~> 4.7' s.add_development_dependency 'simplecov', '~> 0.21' s.add_development_dependency 'webdrivers', '~> 5.3' From bbfd518392f23ec666b77b729b3e2c4acad8094d Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Fri, 20 Dec 2024 10:22:44 +0000 Subject: [PATCH 4/6] Update changelog with version bumps info --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9055045..6612448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ - Permit `#all_there?` to be called with an options payload (Defaults to no waiting for now) - Pass in keys to the `options` hash i.e. `options: { wait: 5 }` to wait for a specific time +- Version bumps + - `site_prism-all_there` must be at least `3.0` + - `rubocop` and associated gems have had partial bumps + - `capybara` now must be at least `3.34` + ### Fixed ## [5.0.4] - 2024-11-25 From 681fa8a427d7bd752e9208b96156e87730b12d8c Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Fri, 20 Dec 2024 10:25:57 +0000 Subject: [PATCH 5/6] Simplify driver instantiation --- features/support/env.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/features/support/env.rb b/features/support/env.rb index a843f0f..fa7c3cc 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -25,22 +25,15 @@ if browser == :chrome options.tap do |opts| - opts.add_argument('--headless=new') opts.add_argument('--no-sandbox') opts.add_argument('--disable-gpu') end end -Capybara.register_driver :site_prism do |app| - Capybara::Selenium::Driver.new( - app, - browser: browser, - options: options - ) -end +AutomationHelpers::Drivers::Local.new(browser, options).register Capybara.configure do |config| - config.default_driver = :site_prism + config.default_driver = :selenium config.default_max_wait_time = 0.75 config.app_host = "file://#{File.dirname(__FILE__)}/../../test_site" config.ignore_hidden_elements = false From 8bce3941efaca675d5f9e135cface584dca2ba9d Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Wed, 8 Jan 2025 18:15:25 +0000 Subject: [PATCH 6/6] Remove ruby 2.7 from testing matrix as its very old and we need to speed up runners Update bundler to latest and avoid rubygems updates --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc61586..6eabda6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,9 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2', '3.3'] + ruby: ['3.0', '3.1', '3.2', '3.3'] browser: ['chrome', 'firefox'] gemfile: ['Gemfile', 'gemfiles/low_spec.gemfile'] - rubygems: ['latest'] -# include: -# - os: ubuntu-latest -# ruby: '2.7' -# rubygems: '3.2.3' exclude: # Low spec gemfiles are having issues post Selenium Manager release on GHA # Revisit these exclusions once low spec selenium is 4.10+ and chrome is v120+ @@ -37,7 +32,7 @@ jobs: with: ruby-version: ${{ matrix.ruby }} rubygems: ${{ matrix.rubygems }} - bundler: '2.4.22' + bundler: '2.5.23' bundler-cache: true - run: bundle exec rspec - run: bundle exec cucumber --publish-quiet