mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Style updates
This commit is contained in:
parent
60f117c4af
commit
9771bc669c
6 changed files with 7 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
Capybara.add_selector(:checkbox, locator_type: [String, Symbol]) do
|
||||
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'
|
||||
]
|
||||
locate_field(xpath, locator, **options)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Capybara.add_selector(:file_field, locator_type: [String, Symbol]) do
|
||||
label 'file field'
|
||||
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'
|
||||
]
|
||||
locate_field(xpath, locator, **options)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Capybara.add_selector(:fillable_field, locator_type: [String, Symbol]) do
|
||||
label 'field'
|
||||
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')
|
||||
]
|
||||
locate_field(xpath, locator, **options)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Capybara.add_selector(:radio_button, locator_type: [String, Symbol]) do
|
||||
label 'radio button'
|
||||
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'
|
||||
]
|
||||
locate_field(xpath, locator, **options)
|
||||
|
|
|
@ -8,6 +8,6 @@ RSpec.describe Capybara::Selenium::Driver do
|
|||
options = { browser: (ENV['SELENIUM_BROWSER'] || :firefox).to_sym }
|
||||
browser = described_class.new(TestApp, **options).browser
|
||||
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
|
||||
|
|
|
@ -514,8 +514,8 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|||
|
||||
it 'can query attributes with strange characters' do
|
||||
session.visit('/form')
|
||||
expect(session).to have_selector(:element, "{custom}": true)
|
||||
expect(session).to have_selector(:element, "{custom}": 'abcdef')
|
||||
expect(session).to have_selector(:element, '{custom}': true)
|
||||
expect(session).to have_selector(:element, '{custom}': 'abcdef')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue