Sha256: 341b49582807143e596053501ad23a68a235eb0f65d3d9f33ef36c6e24277678

Contents?: true

Size: 858 Bytes

Versions: 6

Compression:

Stored size: 858 Bytes

Contents

#!/usr/bin/env ruby
$: << "./lib"

require "rspec"
include RSpec::Matchers

require "tapestry"

class Dynamic
  include Tapestry

  url_is "http://localhost:9292/practice/dynamic_events"

  button :long,  id: 'long'
  button :quick, id: 'quick'
  button :stale, id: 'stale'
  button :fade,  id: 'fade'

  div :dom_events,    id: 'container1'
  div :stale_event,   id: 'container2'
  div :effect_events, id: 'container3'
end

Tapestry.start_browser

page = Dynamic.new

page.visit

expect(page.dom_events.dom_updated?).to be_truthy
expect(page.dom_events.wait_until(&:dom_updated?).spans.count).to eq(0)

page.long.click

expect(page.dom_events.dom_updated?).to be_falsey
expect(page.dom_events.wait_until(&:dom_updated?).spans.count).to eq(5)

page.quick.click

expect(page.dom_events.wait_until(&:dom_updated?).spans.count).to eq(25)

Tapestry.quit_browser

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tapestry-0.7.0 examples/tapestry-events.rb
tapestry-0.6.0 examples/tapestry-events.rb
tapestry-0.5.0 examples/tapestry-events.rb
tapestry-0.4.0 examples/tapestry-events.rb
tapestry-0.3.0 examples/tapestry-events.rb
tapestry-0.2.0 examples/tapestry-events.rb