Sha256: 50971a17aa7afbb2b7fb4a26ee2dddcd5211bfd56eef2ac8fc9af3946aca9ebd

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

Stored size: 802 Bytes

Contents

require 'selenium/webdriver/support/abstract_event_listener'

class RedGlassListener < Selenium::WebDriver::Support::AbstractEventListener
  attr_accessor :red_glass

  def before_change_value_of(element, driver)
    @red_glass.event_sequence << {:change_value => element.tag_name}
  end

  def before_click(element, driver)
    @red_glass.event_sequence << {:click => element.tag_name}
  end

  def after_navigate_back(driver)
    @red_glass.event_sequence.clear
    @red_glass.page_metadata = {}
    @red_glass.reload
  end

  def after_navigate_forward(driver)
    @red_glass.event_sequence.clear
    @red_glass.page_metadata = {}
    @red_glass.reload
  end

  def after_navigate_to(url, driver)
    @red_glass.event_sequence.clear
    @red_glass.page_metadata = {}
    @red_glass.reload
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
red-glass-0.1.3 lib/red-glass/red_glass_listener.rb
red-glass-0.1.2 lib/red-glass/red_glass_listener.rb
red-glass-0.1.1 lib/red-glass/red_glass_listener.rb
red-glass-0.1.0 lib/red-glass/red_glass_listener.rb