rubocop-capybara 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -0
- data/config/default.yml +71 -3
- data/lib/rubocop/capybara/version.rb +1 -1
- data/lib/rubocop/cop/capybara/absolute_x_path_in_element_scope.rb +104 -0
- data/lib/rubocop/cop/capybara/always_true_count_query.rb +75 -0
- data/lib/rubocop/cop/capybara/ambiguous_click.rb +1 -1
- data/lib/rubocop/cop/capybara/assert_style.rb +1 -1
- data/lib/rubocop/cop/capybara/chained_find.rb +175 -0
- data/lib/rubocop/cop/capybara/find_all_first.rb +13 -41
- data/lib/rubocop/cop/capybara/ignored_query_option.rb +242 -0
- data/lib/rubocop/cop/capybara/mixin/capybara_help.rb +86 -2
- data/lib/rubocop/cop/capybara/mixin/css_attributes_parser.rb +23 -5
- data/lib/rubocop/cop/capybara/mixin/css_selector.rb +13 -10
- data/lib/rubocop/cop/capybara/mixin/query_methods.rb +120 -0
- data/lib/rubocop/cop/capybara/mixin/visibility.rb +53 -0
- data/lib/rubocop/cop/capybara/modal_method_without_block.rb +37 -0
- data/lib/rubocop/cop/capybara/native_attribute.rb +76 -0
- data/lib/rubocop/cop/capybara/redundant_within_find.rb +10 -21
- data/lib/rubocop/cop/capybara/rspec/current_path_expectation.rb +13 -16
- data/lib/rubocop/cop/capybara/rspec/current_url_expectation.rb +122 -0
- data/lib/rubocop/cop/capybara/rspec/find_element_value_eq.rb +173 -0
- data/lib/rubocop/cop/capybara/rspec/have_content.rb +1 -1
- data/lib/rubocop/cop/capybara/rspec/have_selector.rb +26 -15
- data/lib/rubocop/cop/capybara/rspec/match_style.rb +1 -1
- data/lib/rubocop/cop/capybara/rspec/negation_matcher.rb +1 -1
- data/lib/rubocop/cop/capybara/rspec/negation_matcher_after_visit.rb +2 -2
- data/lib/rubocop/cop/capybara/rspec/predicate_matcher.rb +43 -7
- data/lib/rubocop/cop/capybara/rspec/specific_matcher.rb +8 -2
- data/lib/rubocop/cop/capybara/rspec/visibility_matcher.rb +29 -24
- data/lib/rubocop/cop/capybara/rspec.rb +25 -0
- data/lib/rubocop/cop/capybara/specific_actions.rb +12 -7
- data/lib/rubocop/cop/capybara/specific_finders.rb +149 -28
- data/lib/rubocop/cop/capybara/unordered_window_access.rb +40 -0
- data/lib/rubocop/cop/capybara/visibility_option.rb +64 -0
- data/lib/rubocop/cop/capybara.rb +28 -0
- data/lib/rubocop/cop/capybara_cops.rb +4 -16
- data/lib/rubocop-capybara.rb +7 -2
- metadata +18 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'capybara/rspec'
|
|
4
|
+
|
|
5
|
+
module RuboCop
|
|
6
|
+
module Cop
|
|
7
|
+
# Cops for the `Capybara` department. The department's cops are
|
|
8
|
+
# registered for lazy loading and their files are loaded on demand.
|
|
9
|
+
module Capybara
|
|
10
|
+
extend LazyLoader
|
|
11
|
+
|
|
12
|
+
register_cop :AbsoluteXPathInElementScope, "#{__dir__}/capybara/absolute_x_path_in_element_scope"
|
|
13
|
+
register_cop :AlwaysTrueCountQuery, "#{__dir__}/capybara/always_true_count_query"
|
|
14
|
+
register_cop :AmbiguousClick, "#{__dir__}/capybara/ambiguous_click"
|
|
15
|
+
register_cop :AssertStyle, "#{__dir__}/capybara/assert_style"
|
|
16
|
+
register_cop :ChainedFind, "#{__dir__}/capybara/chained_find"
|
|
17
|
+
register_cop :FindAllFirst, "#{__dir__}/capybara/find_all_first"
|
|
18
|
+
register_cop :IgnoredQueryOption, "#{__dir__}/capybara/ignored_query_option"
|
|
19
|
+
register_cop :ModalMethodWithoutBlock, "#{__dir__}/capybara/modal_method_without_block"
|
|
20
|
+
register_cop :NativeAttribute, "#{__dir__}/capybara/native_attribute"
|
|
21
|
+
register_cop :RedundantWithinFind, "#{__dir__}/capybara/redundant_within_find"
|
|
22
|
+
register_cop :SpecificActions, "#{__dir__}/capybara/specific_actions"
|
|
23
|
+
register_cop :SpecificFinders, "#{__dir__}/capybara/specific_finders"
|
|
24
|
+
register_cop :UnorderedWindowAccess, "#{__dir__}/capybara/unordered_window_access"
|
|
25
|
+
register_cop :VisibilityOption, "#{__dir__}/capybara/visibility_option"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require_relative 'capybara
|
|
7
|
-
require_relative 'capybara/rspec/negation_matcher'
|
|
8
|
-
require_relative 'capybara/rspec/negation_matcher_after_visit'
|
|
9
|
-
require_relative 'capybara/rspec/predicate_matcher'
|
|
10
|
-
require_relative 'capybara/rspec/specific_matcher'
|
|
11
|
-
require_relative 'capybara/rspec/visibility_matcher'
|
|
12
|
-
|
|
13
|
-
require_relative 'capybara/ambiguous_click'
|
|
14
|
-
require_relative 'capybara/assert_style'
|
|
15
|
-
require_relative 'capybara/find_all_first'
|
|
16
|
-
require_relative 'capybara/redundant_within_find'
|
|
17
|
-
require_relative 'capybara/specific_actions'
|
|
18
|
-
require_relative 'capybara/specific_finders'
|
|
3
|
+
# @deprecated This file is deprecated. Cops are registered for lazy loading in
|
|
4
|
+
# `rubocop/cop/capybara`; this file is kept for compatibility with code that
|
|
5
|
+
# requires it directly.
|
|
6
|
+
require_relative 'capybara'
|
data/lib/rubocop-capybara.rb
CHANGED
|
@@ -8,13 +8,18 @@ require_relative 'rubocop/capybara/version'
|
|
|
8
8
|
require_relative 'rubocop/cop/capybara/mixin/capybara_help'
|
|
9
9
|
require_relative 'rubocop/cop/capybara/mixin/css_attributes_parser'
|
|
10
10
|
require_relative 'rubocop/cop/capybara/mixin/css_selector'
|
|
11
|
+
require_relative 'rubocop/cop/capybara/mixin/query_methods'
|
|
12
|
+
require_relative 'rubocop/cop/capybara/mixin/visibility'
|
|
11
13
|
|
|
12
|
-
require_relative 'rubocop/cop/
|
|
14
|
+
require_relative 'rubocop/cop/capybara'
|
|
13
15
|
|
|
14
16
|
RuboCop::Cop::Style::TrailingCommaInArguments.singleton_class.prepend(
|
|
15
17
|
Module.new do
|
|
16
18
|
def autocorrect_incompatible_with
|
|
17
|
-
super.push(
|
|
19
|
+
super.push(
|
|
20
|
+
RuboCop::Cop::Capybara::RSpec::CurrentPathExpectation,
|
|
21
|
+
RuboCop::Cop::Capybara::RSpec::CurrentUrlExpectation
|
|
22
|
+
)
|
|
18
23
|
end
|
|
19
24
|
end
|
|
20
25
|
)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-capybara
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '1.
|
|
32
|
+
version: '1.89'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '1.
|
|
39
|
+
version: '1.89'
|
|
40
40
|
description: |
|
|
41
41
|
Code style checking for Capybara test files (RSpec, Cucumber, Minitest).
|
|
42
42
|
A plugin for the RuboCop code style enforcing & linting tool.
|
|
@@ -57,14 +57,26 @@ files:
|
|
|
57
57
|
- lib/rubocop/capybara/description_extractor.rb
|
|
58
58
|
- lib/rubocop/capybara/plugin.rb
|
|
59
59
|
- lib/rubocop/capybara/version.rb
|
|
60
|
+
- lib/rubocop/cop/capybara.rb
|
|
61
|
+
- lib/rubocop/cop/capybara/absolute_x_path_in_element_scope.rb
|
|
62
|
+
- lib/rubocop/cop/capybara/always_true_count_query.rb
|
|
60
63
|
- lib/rubocop/cop/capybara/ambiguous_click.rb
|
|
61
64
|
- lib/rubocop/cop/capybara/assert_style.rb
|
|
65
|
+
- lib/rubocop/cop/capybara/chained_find.rb
|
|
62
66
|
- lib/rubocop/cop/capybara/find_all_first.rb
|
|
67
|
+
- lib/rubocop/cop/capybara/ignored_query_option.rb
|
|
63
68
|
- lib/rubocop/cop/capybara/mixin/capybara_help.rb
|
|
64
69
|
- lib/rubocop/cop/capybara/mixin/css_attributes_parser.rb
|
|
65
70
|
- lib/rubocop/cop/capybara/mixin/css_selector.rb
|
|
71
|
+
- lib/rubocop/cop/capybara/mixin/query_methods.rb
|
|
72
|
+
- lib/rubocop/cop/capybara/mixin/visibility.rb
|
|
73
|
+
- lib/rubocop/cop/capybara/modal_method_without_block.rb
|
|
74
|
+
- lib/rubocop/cop/capybara/native_attribute.rb
|
|
66
75
|
- lib/rubocop/cop/capybara/redundant_within_find.rb
|
|
76
|
+
- lib/rubocop/cop/capybara/rspec.rb
|
|
67
77
|
- lib/rubocop/cop/capybara/rspec/current_path_expectation.rb
|
|
78
|
+
- lib/rubocop/cop/capybara/rspec/current_url_expectation.rb
|
|
79
|
+
- lib/rubocop/cop/capybara/rspec/find_element_value_eq.rb
|
|
68
80
|
- lib/rubocop/cop/capybara/rspec/have_content.rb
|
|
69
81
|
- lib/rubocop/cop/capybara/rspec/have_selector.rb
|
|
70
82
|
- lib/rubocop/cop/capybara/rspec/match_style.rb
|
|
@@ -75,6 +87,8 @@ files:
|
|
|
75
87
|
- lib/rubocop/cop/capybara/rspec/visibility_matcher.rb
|
|
76
88
|
- lib/rubocop/cop/capybara/specific_actions.rb
|
|
77
89
|
- lib/rubocop/cop/capybara/specific_finders.rb
|
|
90
|
+
- lib/rubocop/cop/capybara/unordered_window_access.rb
|
|
91
|
+
- lib/rubocop/cop/capybara/visibility_option.rb
|
|
78
92
|
- lib/rubocop/cop/capybara_cops.rb
|
|
79
93
|
homepage: https://github.com/rubocop/rubocop-capybara
|
|
80
94
|
licenses:
|
|
@@ -98,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
98
112
|
- !ruby/object:Gem::Version
|
|
99
113
|
version: '0'
|
|
100
114
|
requirements: []
|
|
101
|
-
rubygems_version: 4.0.
|
|
115
|
+
rubygems_version: 4.0.20
|
|
102
116
|
specification_version: 4
|
|
103
117
|
summary: Code style checking for Capybara test files
|
|
104
118
|
test_files: []
|