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 flaky specs: proposals, legislation and probe options Voting comments Update #1606

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Make Capybara check the page between custom 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 affecting Madrid's fork but not the original
CONSUL repo.
  • Loading branch information
javierm committed Oct 23, 2018
commit 8b8a191b4074bebea98cd2cfe96daf76287ab401
5 changes: 5 additions & 0 deletions spec/features/comments/spending_proposals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,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/custom/probe_option_comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,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