rubocop / rubocop-capybara

Code style checking for Capybara files.
https://docs.rubocop.org/rubocop-capybara
MIT License
41 stars 8 forks source link

Fix a false positive and incorrect autocorrect for `Capybara/SpecificActions`, `Capybara/SpecificFinders` and `Capybara/SpecificMatcher` #10

Closed ydah closed 1 year ago

ydah commented 1 year ago

Fix: https://github.com/rubocop/rubocop-capybara/issues/4


Before submitting the PR make sure the following are checked:

ydah commented 1 year ago

I see some major changes in specs e.g. [disabled] -> [disabled=true], but I trust your judgement that this is correct.

This is a correction to the following comment. https://github.com/rubocop/rubocop-rspec/pull/1481#discussion_r1035856116

CSS selector [visible] means the element has an attribute named visible (e.g. ), NOT "the element is actually visible". CSS does not have :visible pseudo-class --- it's a jQuery's extension. And also, [focused] means the element has an attribute named focused, NOT "the element is now focused". :focus pseudo-class should be used instead.

Therefore, we do not believe that [disabled] can be replaced by a Specific actions/finders/matcher.

pirj commented 1 year ago

Merge at will, @ydah !