Skip to content

Commit

Permalink
Merge pull request #94 from citizensadvice/release-0.12.0
Browse files Browse the repository at this point in the history
release 0.12.0
  • Loading branch information
mrdaniellewis authored Apr 2, 2024
2 parents 755b3d9 + 59e461d commit 347bbe0
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
ruby-version: ['3.3', '3.2', '3.1', '3.0']
ruby-version: ['3.3', '3.2', '3.1']

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 1 addition & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ inherit_gem:
citizens-advice-style:
- default.yml

require:
- rubocop-performance

AllCops:
SuggestExtensions: false
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Capybara/ClickLinkOrButtonStyle:
Enabled: false
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change log

## Unreleased
## v0.12.0

### Added

Expand All @@ -18,6 +18,10 @@
- `select_combo_box_option` takes a block which can be used to filter the found options
- Added the `aria` filter to all selectors that didn't have it

### Removed

- Removed support for Ruby 3.0. Minimum supported Ruby version is now 3.1

## v0.11.0

### Added
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
source "https://rubygems.org"

group :test, :development do
gem "citizens-advice-style", git: "https://github.com/citizensadvice/citizens-advice-style-ruby", tag: "v10.0.1"
gem "citizens-advice-style", git: "https://github.com/citizensadvice/citizens-advice-style-ruby", tag: "v11.0.0"
gem "debug"
gem "puma"
gem "rack-test"
gem "rackup"
gem "rspec"
gem "rubocop-performance"
gem "selenium-webdriver"
gem "sinatra"
end
Expand Down
27 changes: 15 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
GIT
remote: https://github.com/citizensadvice/citizens-advice-style-ruby
revision: ca09fc508ee68c238428d4558701a766f1e12c79
tag: v10.0.1
revision: 6762c3c2185d457e090147ce04facaa5a3e71249
tag: v11.0.0
specs:
citizens-advice-style (10.0.1)
rubocop (~> 1.45)
rubocop-rails (~> 2.17)
rubocop-rspec (~> 2.18)
citizens-advice-style (11.0.0)
rubocop (~> 1.62)
rubocop-performance (~> 1.20)
rubocop-rails (~> 2.24)
rubocop-rspec (~> 2.27)

PATH
remote: .
Expand Down Expand Up @@ -43,7 +44,7 @@ GEM
xpath (~> 3.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
debug (1.9.1)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
Expand Down Expand Up @@ -127,22 +128,25 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-performance (1.20.2)
rubocop-performance (1.21.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.24.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.27.1)
rubocop-rspec (2.28.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.2)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.18.1)
selenium-webdriver (4.19.0)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand Down Expand Up @@ -175,7 +179,6 @@ DEPENDENCIES
rack-test
rackup
rspec
rubocop-performance
selenium-webdriver
sinatra

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ Include in your Gemfile:

```ruby
group :test do
gem "capybara_accessible_selectors", git: "https://github.com/citizensadvice/capybara_accessible_selectors", branch: "main"
# It is recommended you use a tag as the main branch may contain breaking changes
gem "capybara_accessible_selectors", git: "https://github.com/citizensadvice/capybara_accessible_selectors", tag: "v0.12.0"
end
```

Expand Down
2 changes: 1 addition & 1 deletion capybara_accessible_selectors.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.files = Dir["lib/**/*.rb"]
s.authors = ["Daniel Lewis", "Sean Doyle"]
s.license = "ISC"
s.required_ruby_version = ">= 3.0.0"
s.required_ruby_version = ">= 3.1"

s.add_runtime_dependency "capybara", "~> 3.36"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module Capybara
module RSpecMatchers
module Matchers
class HaveValidationErrors
def matches?(element, &block)
def matches?(element, &)
@page = element
@elements = []
instance_eval(&block)
instance_eval(&)
@errors = []

all_invalid_elements.reject { |el| @elements.include? el }.each do |el|
Expand Down Expand Up @@ -43,7 +43,7 @@ def all_invalid_elements
end

def radio_group(name, exact: nil, **options)
@page.within(:fieldset, name, exact: exact) do
@page.within(:fieldset, name, exact:) do
@elements.push(*@page.all(:radio_button, **options))
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara_accessible_selectors/selectors/grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
colindex = node[:"aria-colindex"] || node.ancestor(:row).all(:gridcell).index(node)
grid = node.find(:xpath, XPath.ancestor[XPath.attr(:role) == "grid"])

grid.has_selector?(:columnheader, value, colindex: colindex)
grid.has_selector?(:columnheader, value, colindex:)
end

filter_set(:capybara_accessible_selectors, %i[aria described_by])
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara_accessible_selectors/selectors/img.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Capybara.add_selector(:img, locator_type: [String, Symbol]) do
expression_filter(:src, valid_values: [String, Regexp]) do |xpath, src|
builder(xpath).add_attribute_conditions(src: src)
builder(xpath).add_attribute_conditions(src:)
end

describe(:expression_filters) do |src: nil, **|
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara_accessible_selectors/selectors/rich_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def within_rich_text(locator = nil, **find_options, &block)
Capybara.page.within_rich_text(locator, **find_options, &block)
end
end
within_iframe_rich_text(locator, **find_options, &block)
within_iframe_rich_text(locator, **find_options, &block) # rubocop:disable Naming/BlockForwarding
end

private
Expand Down
6 changes: 3 additions & 3 deletions spec/selectors/heading_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<div role="heading" aria-level=#{level + 1}>Heading</div>
HTML

expect(page).to have_heading level: level, count: 1
expect(page).to have_heading level:, count: 1
end

it "filters for an h#{level}" do
Expand All @@ -121,7 +121,7 @@
<h#{level + 1}>Heading</div>
HTML

expect(page).to have_heading level: level, count: 1
expect(page).to have_heading level:, count: 1
end

it "filters for a native heading with overridden aria-level" do
Expand All @@ -131,7 +131,7 @@
<h#{wrong_level}>Heading</h#{wrong_level}>
HTML

expect(page).to have_heading level: level, count: 1
expect(page).to have_heading level:, count: 1
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ def squish
options = Selenium::WebDriver::Firefox::Options.new(
binary: "/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox"
)
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
Capybara::Selenium::Driver.new(app, browser: :firefox, options:)
end
Capybara.register_driver(:firefox_aurora_headless) do |app|
options = Selenium::WebDriver::Firefox::Options.new(
binary: "/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox",
args: ["--headless"]
)
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
Capybara::Selenium::Driver.new(app, browser: :firefox, options:)
end
Capybara.register_driver(:edge) { |app| Capybara::Selenium::Driver.new(app, browser: :edge) }
Capybara.register_driver(:edge_headless) do |app|
options = Selenium::WebDriver::Edge::Options.new(args: ["--headless"])
Capybara::Selenium::Driver.new(app, browser: :edge, options: options)
Capybara::Selenium::Driver.new(app, browser: :edge, options:)
end
Capybara.default_driver = driver
Capybara.app = CapybaraAccessibleSelectors::TestApplication
Expand Down

0 comments on commit 347bbe0

Please sign in to comment.