Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #205 #207

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Fix #205 #207

merged 3 commits into from
Dec 21, 2023

Conversation

kratob
Copy link
Member

@kratob kratob commented Dec 5, 2023

See #205.

Sped up the FieldErrorFinder significantly by setting Capybara.default_max_wait_time to 0. We are always called inside a patiently block anyways.

@kratob kratob requested a review from begerdom December 5, 2023 16:23
CHANGELOG.md Outdated Show resolved Hide resolved
## 4.6.0
- Spreewald not explicitly depends on Capybara. We don't expect anyone used it without Capybara in the first place.
- Changes to "the ... field should (not) have (an error|the error ...)" step:
- fixed an edgecases where errors were nested deeper inside a .field_with_errors element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- fixed an edgecases where errors were nested deeper inside a .field_with_errors element
- fixed an edgecase where errors were nested deeper inside a .field_with_errors element

lib/spreewald_support/field_errors.rb Show resolved Hide resolved
end

def rails_error?
parent_element_classes = @element.find(:xpath, '..')[:class] &.split(' ') || []
parent_element_classes.include?('field_with_errors')
has_xpath? do |x|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brauchen wir dafür noch einen Test?

@denzelem
Copy link
Contributor

denzelem commented Dec 20, 2023

@kratob Thanks for the PR, I encountered the same issue and the changes reduce the execution time of an affected step from 12.195985515999837 to 0.12304369100002077 seconds. Would be happy to see this MR released soon.

@kratob kratob merged commit 23e0a6b into master Dec 21, 2023
3 checks passed
@kratob
Copy link
Member Author

kratob commented Dec 21, 2023

Now released as 4.6.0.
@denzelem

@kratob kratob deleted the tk/fix-rails-error branch December 21, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants