1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Style updates

This commit is contained in:
Thomas Walpole 2021-06-09 22:57:25 -07:00
parent 60f117c4af
commit 9771bc669c
6 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@
Capybara.add_selector(:checkbox, locator_type: [String, Symbol]) do Capybara.add_selector(:checkbox, locator_type: [String, Symbol]) do
xpath do |locator, allow_self: nil, **options| xpath do |locator, allow_self: nil, **options|
xpath = XPath.axis(allow_self ? :"descendant-or-self" : :descendant, :input)[ xpath = XPath.axis(allow_self ? :'descendant-or-self' : :descendant, :input)[
XPath.attr(:type) == 'checkbox' XPath.attr(:type) == 'checkbox'
] ]
locate_field(xpath, locator, **options) locate_field(xpath, locator, **options)

View file

@ -3,7 +3,7 @@
Capybara.add_selector(:file_field, locator_type: [String, Symbol]) do Capybara.add_selector(:file_field, locator_type: [String, Symbol]) do
label 'file field' label 'file field'
xpath do |locator, allow_self: nil, **options| xpath do |locator, allow_self: nil, **options|
xpath = XPath.axis(allow_self ? :"descendant-or-self" : :descendant, :input)[ xpath = XPath.axis(allow_self ? :'descendant-or-self' : :descendant, :input)[
XPath.attr(:type) == 'file' XPath.attr(:type) == 'file'
] ]
locate_field(xpath, locator, **options) locate_field(xpath, locator, **options)

View file

@ -3,7 +3,7 @@
Capybara.add_selector(:fillable_field, locator_type: [String, Symbol]) do Capybara.add_selector(:fillable_field, locator_type: [String, Symbol]) do
label 'field' label 'field'
xpath do |locator, allow_self: nil, **options| xpath do |locator, allow_self: nil, **options|
xpath = XPath.axis(allow_self ? :"descendant-or-self" : :descendant, :input, :textarea)[ xpath = XPath.axis(allow_self ? :'descendant-or-self' : :descendant, :input, :textarea)[
!XPath.attr(:type).one_of('submit', 'image', 'radio', 'checkbox', 'hidden', 'file') !XPath.attr(:type).one_of('submit', 'image', 'radio', 'checkbox', 'hidden', 'file')
] ]
locate_field(xpath, locator, **options) locate_field(xpath, locator, **options)

View file

@ -3,7 +3,7 @@
Capybara.add_selector(:radio_button, locator_type: [String, Symbol]) do Capybara.add_selector(:radio_button, locator_type: [String, Symbol]) do
label 'radio button' label 'radio button'
xpath do |locator, allow_self: nil, **options| xpath do |locator, allow_self: nil, **options|
xpath = XPath.axis(allow_self ? :"descendant-or-self" : :descendant, :input)[ xpath = XPath.axis(allow_self ? :'descendant-or-self' : :descendant, :input)[
XPath.attr(:type) == 'radio' XPath.attr(:type) == 'radio'
] ]
locate_field(xpath, locator, **options) locate_field(xpath, locator, **options)

View file

@ -8,6 +8,6 @@ RSpec.describe Capybara::Selenium::Driver do
options = { browser: (ENV['SELENIUM_BROWSER'] || :firefox).to_sym } options = { browser: (ENV['SELENIUM_BROWSER'] || :firefox).to_sym }
browser = described_class.new(TestApp, **options).browser browser = described_class.new(TestApp, **options).browser
expect(browser).to be_truthy expect(browser).to be_truthy
expect(true).to eq(true) # rubocop:disable RSpec/ExpectActual expect(true).to eq(true) # rubocop:disable RSpec/ExpectActual,RSpec/IdenticalEqualityAssertion
end end
end end

View file

@ -514,8 +514,8 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
it 'can query attributes with strange characters' do it 'can query attributes with strange characters' do
session.visit('/form') session.visit('/form')
expect(session).to have_selector(:element, "{custom}": true) expect(session).to have_selector(:element, '{custom}': true)
expect(session).to have_selector(:element, "{custom}": 'abcdef') expect(session).to have_selector(:element, '{custom}': 'abcdef')
end end
end end