Commit cbfc00a1 authored by Mark Lapierre's avatar Mark Lapierre

Backport page object changes from EE

Add new page object methods from EE MR:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8937
parent 24c9e1e2
...@@ -112,6 +112,10 @@ module QA ...@@ -112,6 +112,10 @@ module QA
has_css?(element_selector_css(name)) has_css?(element_selector_css(name))
end end
def has_no_text?(text)
page.has_no_text? text
end
def within_element(name) def within_element(name)
page.within(element_selector_css(name)) do page.within(element_selector_css(name)) do
yield yield
......
...@@ -85,6 +85,14 @@ module QA ...@@ -85,6 +85,14 @@ module QA
found found
end end
def has_no_text?(text)
found = super
log(%Q{has_no_text?('#{text}') returned #{found}})
found
end
def within_element(name) def within_element(name)
log("within element :#{name}") log("within element :#{name}")
......
...@@ -65,6 +65,13 @@ describe QA::Support::Page::Logging do ...@@ -65,6 +65,13 @@ describe QA::Support::Page::Logging do
.to output(/has_element\? :element returned true/).to_stdout_from_any_process .to output(/has_element\? :element returned true/).to_stdout_from_any_process
end 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 it 'logs within_element' do
expect { subject.within_element(:element) } expect { subject.within_element(:element) }
.to output(/within element :element/).to_stdout_from_any_process .to output(/within element :element/).to_stdout_from_any_process
......
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