Sha256: 29e4ecf11f73701a42f5fa6e56ac2505f63e609bddc38ab51606895acc2c3cb2

Contents?: true

Size: 838 Bytes

Versions: 2

Compression:

Stored size: 838 Bytes

Contents

module RUTL
  module Element
    #
    # Mix this in for things that change state when clicked.
    # The only things that wouldn't change state when clicked either
    # shouldn't be clicked or are just annoying.
    #
    module ClickToChangeStateMixin
      # click does:
      # * Screenshot before clicking. Is this really necessary?
      # * Click.
      # * Waits for transition to post-click state. (Polls until one reached.)
      # * Screenshot again after the transition. This one is definitely needed.
      # * Returns the state we transitioned to.
      def click
        @context.interface.camera.screenshot
        this_css.click
        result = @context.interface.wait_for_transition(@context.destinations)
        @context.interface.camera.screenshot
        result
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rutl-0.6.0 lib/rutl/element/click_to_change_state_mixin.rb
rutl-0.5.0 lib/rutl/element/click_to_change_state_mixin.rb