Class: Capybara::PageObject::Attribute

Inherits:
Element
  • Object
show all
Includes:
DSL
Defined in:
lib/capybara-pageobject/attribute.rb

Instance Method Summary collapse

Methods inherited from Element

#initialize, #visible?

Constructor Details

This class inherits a constructor from Capybara::PageObject::Element

Instance Method Details

#to_sObject



18
19
20
# File 'lib/capybara-pageobject/attribute.rb', line 18

def to_s
  "'attribute: #{@name}'"
end

#validation_errorObject



11
12
13
14
15
16
# File 'lib/capybara-pageobject/attribute.rb', line 11

def validation_error
  error_field = @page.all(".field_with_errors").find do |error_field|
    Capybara.using_wait_time(0) { error_field.has_selector?(@selector) }
  end
  error_field.find(".error_message").text if error_field
end