Commit 5c1eb9ab authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-fix-logging-find-element' into 'master'

log text_filter arg of find_element

Closes gitlab-org/quality/nightly#52

See merge request gitlab-org/gitlab-ce!24064
parents dcc17872 441dee4c
......@@ -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