Sha256: 1661aab5a05ccb2a1bf22072ad184e17daf7e501ca9bf49741c0dc7955b07ff2

Contents?: true

Size: 1.28 KB

Versions: 3

Compression:

Stored size: 1.28 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

module Arachni
class BrowserCluster
module Jobs
class ResourceExploration

# Loads a {#resource} and {Browser#trigger_event triggers} the specified
# {#event} on the given {#element element}.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class EventTrigger < ResourceExploration

    require_relative 'event_trigger/result'

    # @return   [Symbol]
    #   Event to trigger on the given {#element element}.
    attr_accessor :event

    # @return   [Browser::ElementLocator]
    attr_accessor :element

    # Loads a {#resource} and {Browser#trigger_event triggers} the specified
    # {#event} on the given {#element element}.
    def run
        browser.on_new_page { |page| save_result( page: page ) }

        browser.load resource
        browser.trigger_event( resource, element, event )
    end

    def to_s
        "#<#{self.class}:#{object_id} @resource=#{@resource} " +
            "@event=#{@event.inspect} @element=#{@element.inspect}>"
    end

end

end
end
end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arachni-1.2.1 lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb
arachni-1.2 lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb
arachni-1.1 lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb