| ... | ... | @@ -76,23 +76,18 @@ module QA |
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_element?(name, text: nil, wait: Capybara.default_max_wait_time)
|
|
|
|
def has_element?(name, **kwargs)
|
|
|
|
found = super
|
|
|
|
|
|
|
|
msg = ["has_element? :#{name}"]
|
|
|
|
msg << %Q(with text "#{text}") if text
|
|
|
|
msg << "(wait: #{wait})"
|
|
|
|
msg << "returned: #{found}"
|
|
|
|
|
|
|
|
log(msg.compact.join(' '))
|
|
|
|
log_has_element_or_not('has_element?', name, found, **kwargs)
|
|
|
|
|
|
|
|
found
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_no_element?(name, wait: Capybara.default_max_wait_time)
|
|
|
|
def has_no_element?(name, **kwargs)
|
|
|
|
found = super
|
|
|
|
|
|
|
|
log("has_no_element? :#{name} returned #{found}")
|
|
|
|
log_has_element_or_not('has_no_element?', name, found, **kwargs)
|
|
|
|
|
|
|
|
found
|
|
|
|
end
|
| ... | ... | @@ -149,6 +144,15 @@ module QA |
|
|
|
def log(msg)
|
|
|
|
QA::Runtime::Logger.debug(msg)
|
|
|
|
end
|
|
|
|
|
|
|
|
def log_has_element_or_not(method, name, found, **kwargs)
|
|
|
|
msg = ["#{method} :#{name}"]
|
|
|
|
msg << %Q(with text "#{kwargs[:text]}") if kwargs[:text]
|
|
|
|
msg << "(wait: #{kwargs[:wait] || Capybara.default_max_wait_time})"
|
|
|
|
msg << "returned: #{found}"
|
|
|
|
|
|
|
|
log(msg.compact.join(' '))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
| ... | ... | |
| ... | ... | |