diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-12-24 07:44:08 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-12-24 07:44:08 +0000 |
commit | 4ae9d26e5eef65c87ec86d043c6d093f895ad888 (patch) | |
tree | ac33b7083061480be02331ba0b021d5c05e2b60f | |
parent | 751217987b0782115140e4c2858d91a4b596463a (diff) | |
parent | cbfc00a1e554ed5faf6f5651ef2cb5997f8f384e (diff) | |
download | gitlab-ce-4ae9d26e5eef65c87ec86d043c6d093f895ad888.tar.gz |
Merge branch 'fix-geo-ssh-push-secondary-clone-qa' into 'master'
Backport page object changes from EE
See merge request gitlab-org/gitlab-ce!23956
-rw-r--r-- | qa/qa/page/base.rb | 4 | ||||
-rw-r--r-- | qa/qa/support/page/logging.rb | 8 | ||||
-rw-r--r-- | qa/spec/page/logging_spec.rb | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 88ade66f47d..d6b763ed5fc 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -112,6 +112,10 @@ module QA has_css?(element_selector_css(name)) end + def has_no_text?(text) + page.has_no_text? text + end + def within_element(name) page.within(element_selector_css(name)) do yield diff --git a/qa/qa/support/page/logging.rb b/qa/qa/support/page/logging.rb index 43bc16d8c9a..5765a8041cc 100644 --- a/qa/qa/support/page/logging.rb +++ b/qa/qa/support/page/logging.rb @@ -85,6 +85,14 @@ module QA found end + def has_no_text?(text) + found = super + + log(%Q{has_no_text?('#{text}') returned #{found}}) + + found + end + def within_element(name) log("within element :#{name}") diff --git a/qa/spec/page/logging_spec.rb b/qa/spec/page/logging_spec.rb index 9d56353062b..a54ff424f53 100644 --- a/qa/spec/page/logging_spec.rb +++ b/qa/spec/page/logging_spec.rb @@ -65,6 +65,13 @@ describe QA::Support::Page::Logging do .to output(/has_element\? :element returned true/).to_stdout_from_any_process end + it 'logs has_no_text?' do + allow(page).to receive(:has_no_text?).with('foo').and_return(true) + + expect { subject.has_no_text? 'foo' } + .to output(/has_no_text\?\('foo'\) returned true/).to_stdout_from_any_process + end + it 'logs within_element' do expect { subject.within_element(:element) } .to output(/within element :element/).to_stdout_from_any_process |