Add an eventually matcher to ContributionAnalytics E2E
What does this MR do and why?
We occasionally seem to see failures in the ContributionAnalytics spec where some items are not included in the statistics yet. Looking at how the feature works, it seems there can be a slight lag between when an event happens and when it appears in this page.
Let's try to account for this in the E2E test here, by using eventually matchers to give the spec a chance to pass in these occasions.
Sample failure: Failure in browser_ui/2_plan/contribution_analy... (#389985 - closed)
How to set up and validate locally
bundle exec bin/qa Test::Instance::All http://gdk.test:3000 -- qa/specs/features/ee/browser_ui/2_plan/contribution_analytics_spec.rb
I found it easiest to test this change out by modifying the expectation locally, and then when the test starts to 'wait' - then manually creating an additional 'issue/mr/commit' to match -- the test will then retry/reload the page until the event in question shows up.
# e.g. modify test, and then in a separate tab create a new issue to satisfy the test expectation to verify the waiting function works
# expect { analytics_page.issue_analytics_content }.to eventually_have_content('1 created, 1 closed.')
expect { analytics_page.issue_analytics_content }.to eventually_have_content('2 created, 1 closed.')
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.