Capybara
Capybara/AmbiguousClick
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
No |
2.22 |
- |
Specify the exact target to click on.
In projects where accessibility needs to be considered, it is crucial to specify the click target precisely.
Capybara/AssertStyle
Capybara/ClickLinkOrButtonStyle
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Disabled |
Yes |
No |
2.19 |
2.22 |
Checks for methods of button or link clicks.
This cop is deprecated. We plan to remove this in the next major version update to 3.0.
The migration target is Capybara/AmbiguousClick.
It is only migration target when EnforcedStyle: strict.
If you are using this cop, please plan for migration.
There is no migration target when EnforcedStyle: link_or_button.
By default, prefer to use click_link_or_button or click_on.
These methods offer a weaker coupling between the test and HTML,
allowing for a more faithful reflection of how the user behaves.
You can set EnforcedStyle: strict to prefer the use of
click_link and click_button, but this is a deprecated setting.
Examples
Capybara/FindAllFirst
Capybara/RedundantWithinFind
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Pending |
Yes |
Always |
2.20 |
- |
Checks for redundant within find(…) calls.
Capybara/SpecificActions
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed |
|---|---|---|---|---|
Pending |
Yes |
No |
2.14 |
- |
Checks for there is a more specific actions offered by Capybara.