Class: Capybara::Queries::SelectorQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/true_automation/driver/capybara.rb

Instance Method Summary collapse

Instance Method Details

#description(only_applied = false) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/true_automation/driver/capybara.rb', line 6

def description(only_applied = false)
  desc = original_description
  matched_result = desc.match(/.*__taonly__(.+)__taonly__.*/)
  if selector = matched_result && matched_result[1]
    desc = "Element was not found on the page. Element '#{selector}' with such locator is not on this page and could not be detected by TrueAutomation."
  end
  matched_result_ta = desc.match(/visible\s(.+)\s\"(.*)__ta__(.+)__ta__.*/)
  if matched_result_ta && matched_result_ta[3]
    desc = "Unable to locate element { using: '#{matched_result_ta[1]}', selector: '#{matched_result_ta[2]}' }"
  end
  desc
end

#original_descriptionObject



5
# File 'lib/true_automation/driver/capybara.rb', line 5

alias_method :original_description, :description