summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamya Authappan <rauthappan@gitlab.com>2019-01-02 06:16:44 +0000
committerRamya Authappan <rauthappan@gitlab.com>2019-01-02 06:16:44 +0000
commit5c1eb9ab821f8d9427d43b4f2959b918de9dd3c2 (patch)
treee7e0c45b32e9050feb2e80aea9971e7a70fe7e94
parentdcc17872d510da91f0ad05a44339e3826f6d7cae (diff)
parent441dee4c315cb728e61ae5e5e42f36d782ef8e29 (diff)
downloadgitlab-ce-5c1eb9ab821f8d9427d43b4f2959b918de9dd3c2.tar.gz
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
-rw-r--r--qa/qa/support/page/logging.rb7
-rw-r--r--qa/spec/page/logging_spec.rb9
2 files changed, 14 insertions, 2 deletions
diff --git a/qa/qa/support/page/logging.rb b/qa/qa/support/page/logging.rb
index df3b794b14b..cfccbb910b7 100644
--- a/qa/qa/support/page/logging.rb
+++ b/qa/qa/support/page/logging.rb
@@ -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
diff --git a/qa/spec/page/logging_spec.rb b/qa/spec/page/logging_spec.rb
index a54ff424f53..f108a5ca318 100644
--- a/qa/spec/page/logging_spec.rb
+++ b/qa/spec/page/logging_spec.rb
@@ -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