Commit a1447b26 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents e9627b42 5c1eb9ab
......@@ -37,8 +37,11 @@ module QA
exists
end
def find_element(name, wait: Capybara.default_max_wait_time)
log("finding :#{name} (wait: #{wait})")
def find_element(name, text_filter = nil, wait: Capybara.default_max_wait_time)
msg = ["finding :#{name}"]
msg << %Q(with text_filter "#{text_filter}") if text_filter
msg << "(wait: #{wait})"
log(msg.compact.join(' '))
element = super
......
......@@ -47,6 +47,15 @@ describe QA::Support::Page::Logging do
it 'logs find_element' do
expect { subject.find_element(:element) }
.to output(/finding :element/).to_stdout_from_any_process
expect { subject.find_element(:element) }
.to output(/found :element/).to_stdout_from_any_process
end
it 'logs find_element with text_filter' do
expect { subject.find_element(:element, 'foo') }
.to output(/finding :element with text_filter "foo"/).to_stdout_from_any_process
expect { subject.find_element(:element, 'foo') }
.to output(/found :element/).to_stdout_from_any_process
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment