Update all QA tests to use page objects when checking for text content
Problem
Some tests are flaky because they use Capybara's have_text
or have_content
methods, which don't call our wait_for_requests
method and so might time out when waiting for long-running processes.
Proposal
Update all tests so that have_text
or have_content
is invoked on a page object and therefore calls wait_for_requests
, which is defined in Page::Base#has_text?
. E.g., instead of:
expect(page).to have_content('Content on project page')
It would be:
Page::Project::Show.perform do |project|
expect(project).to have_content('Content on project page')
end
See !47351 (merged) for the change that makes it possible to implement this proposal (it includes a few examples of tests that have already been updated).