Update capybara method calls inside wait blocks to use page object methods that will be logged
Problem to solve
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22084 adds logging of page object actions. Some actions are inside a wait
block but they don't get logged because they use Capybara::DSL#page
methods directly instead of using the methods in QA::Page::Base
where logging occurs.
E.g., a block that looks like this:
wait(max: 500) do
has_css?('.login-page')
end
Would be logged as:
with wait: max 500; time 0.1; reload true
end wait
Which looks like it waited for nothing.
Whereas if the block were:
wait(max: 500) do
has_element? :login_page
end
It would be logged as:
with wait: max 500; time 0.1; reload true
has_element? :login_page returned true
end wait
Which shows what it was waiting for.
Proposal
Update all wait
blocks to use methods in QA::Page::Base
We would like to eventually update all page object actions to use methods in QA::Page::Base
rather than using Capybara::DSL#page
methods directly, but that's a much bigger task that will be at least partially completed by doing this first.