Graphene Implementation 1.0.0.CR3

org.jboss.arquillian.ajocado.actions
Class Drag

java.lang.Object
  extended by org.jboss.arquillian.ajocado.actions.Drag

public class Drag
extends Object

Provides item dragging capability to Selenium tests.

Methods can be call in following serie: start, mouseOut, move, enter, drop.

If we are calling preceding phase (e.g. move, when drag was already called), IllegalStateException is thrown.

If we are calling following phase (e.g. drop, when no action was called), all phases preceding requested phase will be done before requested phase can be done.

Version:
$Revision$
Author:
Lukas Fryc

Nested Class Summary
static class Drag.Phase
          Enumeration of phases supported by this Drag object.
 
Constructor Summary
Drag(ElementLocator<?> itemToDrag, ElementLocator<?> dropTarget)
          Initiates Drag object, handled by given Selenium instance, instructing drag of itemToDrag to dropTarget object.
 
Method Summary
 void drop()
          Last phase of dragging.
 void enter()
          Starts fourth phase of dragging.
 void mouseOut()
          Starts second phase of dragging.
 void move()
          Starts third phase of dragging.
 void setDragIndicator(ElementLocator<?> dragIndicator)
           
 void setDropTarget(ElementLocator<?> dropTarget)
           
 void setNumberOfSteps(int numberOfSteps)
           
 void start()
          Starts first phase of dragging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Drag

public Drag(ElementLocator<?> itemToDrag,
            ElementLocator<?> dropTarget)
Initiates Drag object, handled by given Selenium instance, instructing drag of itemToDrag to dropTarget object.

Parameters:
itemToDrag - item to drag
dropTarget - target of item dragging
Method Detail

setDropTarget

public void setDropTarget(ElementLocator<?> dropTarget)

setDragIndicator

public void setDragIndicator(ElementLocator<?> dragIndicator)

setNumberOfSteps

public void setNumberOfSteps(int numberOfSteps)

start

public void start()
Starts first phase of dragging. Simulate left mouse button pressing and small initial movement.


mouseOut

public void mouseOut()
Starts second phase of dragging. If there is some unfinished preceding phases, it will be done before this phase. Simulate movement of mouse cursor out of the item that ve want to drag.


move

public void move()
Starts third phase of dragging. If there is some unfinished preceding phases, it will be done before this phase. Simulate movement of mouse cursor near the target item.


enter

public void enter()
Starts fourth phase of dragging. If there is some unfinished preceding phases, it will be done before this phase.


drop

public void drop()
Last phase of dragging. If there is some unfinished preceding phases, it will be done before this phase. Drop the item to target.


Graphene Implementation 1.0.0.CR3

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.