Class: Wrapybara::PasswordField
- Inherits:
-
Object
- Object
- Wrapybara::PasswordField
- Includes:
- Element, FillableField
- Defined in:
- lib/wrapybara/elements/password_field.rb
Instance Method Summary collapse
-
#initialize(identifier, scope = default_scope, how = default_how) ⇒ PasswordField
constructor
A new instance of PasswordField.
- #should_exist ⇒ Object
- #should_not_exist ⇒ Object
Methods included from FillableField
#empty?, #fill_in, #has_content?, #should_be_empty, #should_have_content, #should_not_be_empty, #should_not_have_content, #value
Methods included from Element
#click, #default_how, #default_scope, #disabled?, #element, #element_identifier, #enabled?, #exists?, #focused?, #get_element, #parent_identifier, #path, #should_be_disabled, #should_be_enabled, #should_be_focused, #should_be_visible, #should_have_attribute, #should_not_be_disabled, #should_not_be_enabled, #should_not_be_focused, #should_not_be_visible, #should_not_have_attribute, #style, #visible?, #within
Constructor Details
#initialize(identifier, scope = default_scope, how = default_how) ⇒ PasswordField
Returns a new instance of PasswordField.
6 7 8 9 10 11 12 |
# File 'lib/wrapybara/elements/password_field.rb', line 6 def initialize(identifier, scope = default_scope, how = default_how) @identifier = identifier @how = how @scope = scope xpath = XPath::HTML.send(:locate_field, XPath.descendant(:input)[XPath.attr(:type).equals('password')], identifier) @element = get_element(xpath, scope) end |
Instance Method Details
#should_exist ⇒ Object
14 15 16 |
# File 'lib/wrapybara/elements/password_field.rb', line 14 def should_exist super "Expected a password field #{self.element_identifier} to exist" end |
#should_not_exist ⇒ Object
18 19 20 |
# File 'lib/wrapybara/elements/password_field.rb', line 18 def should_not_exist super "Did not expect a password field #{self.element_identifier}' to exist" end |