View Javadoc

1   package com.atlassian.pageobjects.elements;
2   
3   /**
4    * <p/>
5    * Encapsulates Javascript mouse events of the {@link com.atlassian.pageobjects.elements.PageElement}.
6    *
7    * <p/>
8    * {@link PageElement#isPresent()} of the corresponding page element must return <code>true</code>
9    * before any of the methods of this interface are invoked, otherwise {@link org.openqa.selenium.NoSuchElementException}
10   * will be raised.
11   *
12   * <p/>
13   * NOTE: all events invoked via this class are pure Javascript events and don't simulate the real user-browser
14   * interaction. E.g. in real interaction a mouse click would trigger 'mousedown', 'mouseup' and 'click' events,
15   * whereas the {@link #click()} in this class only produces the 'click' event.
16   *
17   * <p/>
18   * Use this class primarily as workaround when standard methods in
19   * {@link com.atlassian.pageobjects.elements.PageElement} simulating user interaction don't produce desired results.
20   *
21   * @since 2.1
22   */
23  public interface PageElementMouseJavascript
24  {
25      /**
26       * Dispatches a click event to the associated element. This is different to {@link PageElement#click()}
27       * in that this is invoking the Javascript 'click' event as opposed to simulating user click action.
28       *
29       * @return the associated Javascript object
30       */
31      PageElementJavascript click();
32  
33      /**
34       * <p/>
35       * Dispatches a 'double click' event to the associated element.
36       *
37       * @return the associated Javascript object
38       */
39      PageElementJavascript doubleClick();
40  
41      /**
42       * <p/>
43       * Dispatches a 'mouseup' event to the associated element.
44       *
45       * @return the associated Javascript object
46       */
47      PageElementJavascript mouseup();
48  
49      /**
50       * <p/>
51       * Dispatches a 'mousedown' event to the associated element.
52       *
53       * @return the associated Javascript object
54       */
55      PageElementJavascript mousedown();
56  
57      /**
58       * Dispatches a 'mouseover' event to the associated element, commonly referred to as 'hover'.
59       *
60       * @return the associated Javascript object
61       */
62      PageElementJavascript mouseover();
63  
64      /**
65       * Dispatches a 'mousemove' event to the associated element.
66       *
67       * @return the associated Javascript object
68       */
69      PageElementJavascript mousemove();
70  
71      /**
72       * Dispatches a 'mouseout' event to the associated element.
73       *
74       * @return the associated Javascript object
75       */
76      PageElementJavascript mouseout();
77  
78  }