Class: CheckIn::Select

Inherits:
Object
  • Object
show all
Includes:
RSpec::Expectations, RSpec::Matchers
Defined in:
lib/cucumber/pickles/steps/check_in/select.rb

Instance Method Summary collapse

Constructor Details

#initialize(label, value, within) ⇒ Select

Returns a new instance of Select.



6
7
8
9
10
# File 'lib/cucumber/pickles/steps/check_in/select.rb', line 6

def initialize(label, value, within)
  @label = label
  @value = value
  @within = within || Capybara.current_session
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
# File 'lib/cucumber/pickles/steps/check_in/select.rb', line 12

def call
  locator, wait  = Locator::Wait.execute(@label)

  options = { selected: @value }
  options[:wait] = wait if wait

  expect(@within).to have_select(locator, options)
end