1 package com.atlassian.pageobjects.elements;
2
3 /**
4 * <p/>
5 * Encapsulates Javascript form element events of the {@link PageElement}.
6 *
7 * <p/>
8 * {@link com.atlassian.pageobjects.elements.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.
15 *
16 * <p/>
17 * Use this class primarily as workaround when standard methods in
18 * {@link PageElement} simulating user interaction don't produce desired results.
19 *
20 * @since 2.1
21 */
22 public interface PageElementFormJavascript
23 {
24 /**
25 * Dispatches a 'select' event to the associated element, as if a text in this element was selected.
26 *
27 * @return the associated Javascript object
28 */
29 PageElementJavascript select();
30
31 /**
32 * <p/>
33 * Dispatches a 'change' event to the associated element, as if the value of this element has changed.
34 *
35 * @return the associated Javascript object
36 */
37 PageElementJavascript change();
38
39 /**
40 * <p/>
41 * Dispatches a 'submit' event to the associated element, as if its form (or the form it represents) was submitted.
42 *
43 * @return the associated Javascript object
44 */
45 PageElementJavascript submit();
46
47 /**
48 * <p/>
49 * Dispatches a 'focus' event to the associated element, as if it received input focus.
50 *
51 * @return the associated Javascript object
52 */
53 PageElementJavascript focus();
54
55 /**
56 * Dispatches a 'blur' event to the associated element, as if it lost input focus.
57 *
58 * @return the associated Javascript object
59 */
60 PageElementJavascript blur();
61
62 }