mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Gem updates
This commit is contained in:
parent
b6eef5e5a5
commit
2fd00e52b8
18 changed files with 34 additions and 30 deletions
|
@ -88,6 +88,9 @@ Lint/EmptyBlock:
|
|||
- 'lib/capybara/spec/**/*'
|
||||
- 'spec/**/*.rb'
|
||||
|
||||
Lint/DuplicateBranch:
|
||||
Enabled: false
|
||||
|
||||
Naming/PredicateName:
|
||||
Exclude:
|
||||
- '**/*/*matchers.rb'
|
||||
|
|
|
@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|||
s.add_runtime_dependency('nokogiri', ['~> 1.8'])
|
||||
s.add_runtime_dependency('rack', ['>= 1.6.0'])
|
||||
s.add_runtime_dependency('rack-test', ['>= 0.6.3'])
|
||||
s.add_runtime_dependency('regexp_parser', ['~>1.5'])
|
||||
s.add_runtime_dependency('regexp_parser', ['>=1.5', '<3.0'])
|
||||
s.add_runtime_dependency('xpath', ['~>3.2'])
|
||||
|
||||
s.add_development_dependency('byebug') unless RUBY_PLATFORM == 'java'
|
||||
|
@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency('rake')
|
||||
s.add_development_dependency('rspec', ['>= 3.5.0'])
|
||||
s.add_development_dependency('rspec-instafail')
|
||||
s.add_development_dependency('rubocop', ['~>1.1.0'])
|
||||
s.add_development_dependency('rubocop', ['~>1.1'])
|
||||
s.add_development_dependency('rubocop-performance')
|
||||
s.add_development_dependency('rubocop-rspec', ['~>2.0.0.pre'])
|
||||
s.add_development_dependency('sauce_whisk')
|
||||
|
|
|
@ -103,19 +103,19 @@ module Capybara
|
|||
|
||||
# @api private
|
||||
def find_css(css, **options)
|
||||
if base.method(:find_css).arity != 1
|
||||
base.find_css(css, **options)
|
||||
else
|
||||
if base.method(:find_css).arity == 1
|
||||
base.find_css(css)
|
||||
else
|
||||
base.find_css(css, **options)
|
||||
end
|
||||
end
|
||||
|
||||
# @api private
|
||||
def find_xpath(xpath, **options)
|
||||
if base.method(:find_xpath).arity != 1
|
||||
base.find_xpath(xpath, **options)
|
||||
else
|
||||
if base.method(:find_xpath).arity == 1
|
||||
base.find_xpath(xpath)
|
||||
else
|
||||
base.find_xpath(xpath, **options)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ module Capybara
|
|||
#
|
||||
# page.has_field?('Email', type: 'email')
|
||||
#
|
||||
# Note: 'textarea' and 'select' are valid type values, matching the associated tag names.
|
||||
# NOTE: 'textarea' and 'select' are valid type values, matching the associated tag names.
|
||||
#
|
||||
# @param [String] locator The label, name or id of a field to check for
|
||||
# @option options [String, Regexp] :with The text content of the field or a Regexp to match
|
||||
|
|
|
@ -239,16 +239,16 @@ module Capybara
|
|||
|
||||
case selector_format
|
||||
when :css
|
||||
if node.method(:find_css).arity != 1
|
||||
node.find_css(css, **hints)
|
||||
else
|
||||
if node.method(:find_css).arity == 1
|
||||
node.find_css(css)
|
||||
else
|
||||
node.find_css(css, **hints)
|
||||
end
|
||||
when :xpath
|
||||
if node.method(:find_xpath).arity != 1
|
||||
node.find_xpath(xpath(exact), **hints)
|
||||
else
|
||||
if node.method(:find_xpath).arity == 1
|
||||
node.find_xpath(xpath(exact))
|
||||
else
|
||||
node.find_xpath(xpath(exact), **hints)
|
||||
end
|
||||
else
|
||||
raise ArgumentError, "Unknown format: #{selector_format}"
|
||||
|
|
|
@ -54,10 +54,10 @@ module Capybara
|
|||
idx, length = args
|
||||
max_idx = case idx
|
||||
when Integer
|
||||
if !idx.negative?
|
||||
length.nil? ? idx : idx + length - 1
|
||||
else
|
||||
if idx.negative?
|
||||
nil
|
||||
else
|
||||
length.nil? ? idx : idx + length - 1
|
||||
end
|
||||
when Range
|
||||
# idx.max is broken with beginless ranges
|
||||
|
|
|
@ -171,7 +171,7 @@ require 'capybara/selector/definition'
|
|||
# * Filters:
|
||||
# * :\<any> (String, Regexp) - Match on any specified element attribute
|
||||
#
|
||||
class Capybara::Selector; end
|
||||
class Capybara::Selector; end # rubocop:disable Lint/EmptyClass
|
||||
|
||||
Capybara::Selector::FilterSet.add(:_field) do
|
||||
node_filter(:checked, :boolean) { |node, value| !(value ^ node.checked?) }
|
||||
|
|
|
@ -9,7 +9,7 @@ Capybara.add_selector(:table_row, locator_type: [Array, Hash]) do
|
|||
cell_xp = XPath.descendant(:td)[
|
||||
XPath.string.n.is(cell) & XPath.position.equals(header_xp.preceding_sibling.count.plus(1))
|
||||
]
|
||||
xp[cell_xp]
|
||||
xp.where(cell_xp)
|
||||
end
|
||||
else
|
||||
initial_td = XPath.descendant(:td)[XPath.string.n.is(locator.shift)]
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
// the overflow style of the body, and the body is really overflow:visible.
|
||||
var overflowElem = e;
|
||||
if (htmlOverflowStyle == "visible") {
|
||||
// Note: bodyElem will be null/undefined in SVG documents.
|
||||
// NOTE: bodyElem will be null/undefined in SVG documents.
|
||||
if (e == htmlElem && bodyElem) {
|
||||
overflowElem = bodyElem;
|
||||
} else if (e == bodyElem) {
|
||||
|
|
|
@ -126,7 +126,7 @@ private
|
|||
end
|
||||
|
||||
def chromedriver_version
|
||||
capabilities['chrome']['chromedriverVersion'].split(' ')[0]
|
||||
capabilities['chrome']['chromedriverVersion'].split(' ')[0] # rubocop:disable Style/RedundantArgument
|
||||
end
|
||||
|
||||
def native_displayed?
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
|
||||
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
|
||||
# using Capybara provided assertions with builtin waiting behavior.
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ require 'yaml'
|
|||
|
||||
class TestApp < Sinatra::Base
|
||||
class TestAppError < Exception; end # rubocop:disable Lint/InheritException
|
||||
|
||||
class TestAppOtherError < Exception # rubocop:disable Lint/InheritException
|
||||
def initialize(string1, msg)
|
||||
super()
|
||||
|
|
Loading…
Reference in a new issue