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

[Backport] Fix flaky specs: proposals and legislation Voting comments Update #2989

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make Capybara check the page between comment votes
As pointed out in PR consul#2734:

"After clicking the first link, there's an AJAX request which replaces
the existing `.in-favor a` and `.against a` links with new elements. So
if Capybara tries to click the existing `.against a` link at the same
moment it's being replaced, clicking the link won't generate a new
request".

Making Capybara check the page for new content before clicking the
second link solves the problem.

This commit solves issues afecting both Madrid's fork and the original
CONSUL repo.
  • Loading branch information
javierm committed Oct 29, 2018
commit 74927f4ed60a2d564b810e2e6c2cc0283aa8b213
5 changes: 5 additions & 0 deletions spec/features/comments/legislation_questions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@

within("#comment_#{@comment.id}_votes") do
find('.in_favor a').click

within('.in_favor') do
expect(page).to have_content "1"
end

find('.against a').click

within('.in_favor') do
Expand Down
5 changes: 5 additions & 0 deletions spec/features/comments/proposals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@

within("#comment_#{@comment.id}_votes") do
find('.in_favor a').click

within('.in_favor') do
expect(page).to have_content "1"
end

find('.against a').click

within('.in_favor') do
Expand Down