Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features 5.1 updates #228

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
### 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

- 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

Expand Down
11 changes: 2 additions & 9 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/site_prism/element_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions site_prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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[[email protected] [email protected]]
s.authors = ['Luke Hill']
s.email = %w[[email protected]]
s.homepage = 'https://github.com/site-prism/site_prism'
s.metadata = {
'bug_tracker_uri' => 'https://github.com/site-prism/site_prism/issues',
Expand All @@ -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'
Expand Down
Loading