Skip to content

Commit

Permalink
Fix flaky capybara test (#2098)
Browse files Browse the repository at this point in the history
Fix flaky capybara test by having expect for css change before trying to find score (so capybara waits for ajax to return properly)
  • Loading branch information
20wildmanj authored Feb 20, 2024
1 parent 918e062 commit eeb38c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/features/assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@
click_on "Add annotation"

# verify that score was changed
expect(page).to have_css('div.annotation-badge', text: score_adjust)
problem_name = page.find(:css, 'div.problem_name', text: /#{problem.name}:/i)
problem_score = problem_name.find(:xpath, './following-sibling::div')
within problem_score do
test = problem_score.find(:css, 'b.student_score')
expect(test).to have_content(old_score + score_adjust)
end
expect(page).to have_css('div.annotation-badge', text: score_adjust)
end
end
end
Expand Down

0 comments on commit eeb38c6

Please sign in to comment.