Module: RUTL::Element::ClickToChangeStateMixin

Included in:
Button, Link
Defined in:
lib/rutl/element/click_to_change_state_mixin.rb

Overview

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.

Instance Method Summary collapse

Instance Method Details

#clickObject

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.



15
16
17
18
19
20
21
# File 'lib/rutl/element/click_to_change_state_mixin.rb', line 15

def click
  @context.interface.camera.screenshot
  @context.find_element.click
  result = @context.interface.wait_for_transition(@context.destinations)
  @context.interface.camera.screenshot
  result
end