Class: UiInteractors::Interactors::DropdownFieldInteractor

Inherits:
BaseInteractor
  • Object
show all
Defined in:
lib/ui_interactors/interactors/dropdown_field_interactor.rb

Instance Method Summary collapse

Methods inherited from BaseInteractor

#is_not_visible!, #is_visible!

Constructor Details

#initialize(driver, name, xpath_root = '//*') ⇒ DropdownFieldInteractor

Returns a new instance of DropdownFieldInteractor.



3
4
5
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 3

def initialize(driver, name, xpath_root='//*')
  super
end

Instance Method Details

#empty_option_is_selected!Object



15
16
17
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 15

def empty_option_is_selected!
  option_is_selected!('')
end

#option_is_not_selected!(option_name) ⇒ Object



11
12
13
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 11

def option_is_not_selected!(option_name)
  wait.until { find_element.first_selected_option.text != option_name }
end

#option_is_selected!(option_name) ⇒ Object



7
8
9
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 7

def option_is_selected!(option_name)
  wait.until { find_element.first_selected_option.text == option_name }
end

#select_empty_optionObject



23
24
25
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 23

def select_empty_option
  select_option('')
end

#select_option(option_name) ⇒ Object



19
20
21
# File 'lib/ui_interactors/interactors/dropdown_field_interactor.rb', line 19

def select_option(option_name)
  find_element.select_by(:text, option_name)
end