class InteractorUIAutomation::Interactor::TextFieldInteractor
Public Class Methods
new(driver, name, xpath_root='//*')
click to toggle source
Calls superclass method
InteractorUIAutomation::Interactor::BaseInteractor::new
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 3 def initialize(driver, name, xpath_root='//*') super end
Public Instance Methods
clear_text()
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 26 def clear_text find_element.send_keys([:control, 'a'], :delete) end
does_not_have_text!(text)
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 11 def does_not_have_text!(text) wait.until { find_element.attribute('value') != text } end
enter_text(text)
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 19 def enter_text(text) find_element.tap do |element| element.clear element.send_keys(text) end end
has_text!(text)
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 7 def has_text!(text) wait.until { find_element.attribute('value') == text } end
is_blank!()
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 15 def is_blank! has_text!('') end
Private Instance Methods
current_xpath()
click to toggle source
# File lib/interactor_ui_automation/interactor/text_field_interactor.rb, line 32 def current_xpath "#{@xpath_root}//*[@name='#{@name}']" end