Class: Capybara::Vue::Waiter

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/vue/waiter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ Waiter

Returns a new instance of Waiter.



6
7
8
# File 'lib/capybara/vue/waiter.rb', line 6

def initialize(page)
  @page = page
end

Instance Attribute Details

#pageObject

Returns the value of attribute page.



4
5
6
# File 'lib/capybara/vue/waiter.rb', line 4

def page
  @page
end

Instance Method Details

#wait_until_readyObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/capybara/vue/waiter.rb', line 10

def wait_until_ready
  return unless vue_loaded?

  setup_ready

  start = Time.now
  until ready?
    timeout! if timeout?(start)
    setup_ready if page_reloaded_on_wait?
    sleep(0.01)
  end
end