Sha256: 876e5379bf69c23da38878a83d004f483861b85f211379cc929bfb9a83a0debb

Contents?: true

Size: 951 Bytes

Versions: 8

Compression:

Stored size: 951 Bytes

Contents

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

require "rspec"
# rubocop:disable Style/MixinUsage
include RSpec::Matchers
# rubocop:enable Style/MixinUsage

require "testable"

class Dynamic
  include Testable

  url_is "https://veilus.herokuapp.com/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

Testable.start_browser :firefox

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(4)

page.quick.click

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

Testable.quit_browser

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
testable-1.0.0 examples/testable-watir-events.rb
testable-0.10.0 examples/testable-watir-events.rb
testable-0.9.0 examples/testable-watir-events.rb
testable-0.8.0 examples/testable-watir-events.rb
testable-0.7.0 examples/testable-watir-events.rb
testable-0.6.0 examples/testable-watir-events.rb
testable-0.5.0 examples/testable-watir-events.rb
testable-0.4.0 examples/testable-watir-events.rb