1 package com.atlassian.pageobjects.elements;
2
3 /**
4 * <p>
5 * Encapsulates Javascript form element events of the {@link PageElement}.
6 * </p>
7 *
8 * <p>
9 * {@link com.atlassian.pageobjects.elements.PageElement#isPresent()} of the corresponding page element must return <code>true</code>
10 * before any of the methods of this interface are invoked, otherwise {@link org.openqa.selenium.NoSuchElementException}
11 * will be raised.
12 * </p>
13 *
14 * <p>
15 * NOTE: all events invoked via this class are pure Javascript events and don't simulate the real user-browser
16 * interaction.
17 * </p>
18 *
19 * <p>
20 * Use this class primarily as workaround when standard methods in
21 * {@link PageElement} simulating user interaction don't produce desired results.
22 * </p>
23 *
24 * @since 2.1
25 */
26 public interface PageElementFormJavascript
27 {
28 /**
29 * Dispatches a 'select' event to the associated element, as if a text in this element was selected.
30 *
31 * @return the associated Javascript object
32 */
33 PageElementJavascript select();
34
35 /**
36 * Dispatches a 'change' event to the associated element, as if the value of this element has changed.
37 *
38 * @return the associated Javascript object
39 */
40 PageElementJavascript change();
41
42 /**
43 * Dispatches a 'submit' event to the associated element, as if its form (or the form it represents) was submitted.
44 *
45 * @return the associated Javascript object
46 */
47 PageElementJavascript submit();
48
49 /**
50 * Dispatches a 'focus' event to the associated element, as if it received input focus.
51 *
52 * @return the associated Javascript object
53 */
54 PageElementJavascript focus();
55
56 /**
57 * Dispatches a 'blur' event to the associated element, as if it lost input focus.
58 *
59 * @return the associated Javascript object
60 */
61 PageElementJavascript blur();
62
63 }