@@ -37,8 +37,10 @@ public void setUp() throws Exception {
37
37
assertEquals ("Drag text not empty" , "" , dragText .getText ());
38
38
39
39
TouchAction dragNDrop = new TouchAction (driver )
40
- .longPress (new LongPressOptions ().withElement (dragDot1 ))
41
- .moveTo (new MoveToOptions ().withElement (dragDot3 ))
40
+ .longPress (new LongPressOptions ()
41
+ .withElement (dragDot1 ))
42
+ .moveTo (new MoveToOptions ()
43
+ .withElement (dragDot3 ))
42
44
.release ();
43
45
dragNDrop .perform ();
44
46
assertNotEquals ("Drag text empty" , "" , dragText .getText ());
@@ -54,8 +56,12 @@ public void setUp() throws Exception {
54
56
assertEquals ("Drag text not empty" , "" , dragText .getText ());
55
57
56
58
TouchAction dragNDrop = new TouchAction (driver )
57
- .longPress (new LongPressOptions ().withElement (dragDot1 ).withDuration (Duration .ofSeconds (2 )))
58
- .moveTo (new MoveToOptions ().withElement (dragDot3 )).release ();
59
+ .longPress (new LongPressOptions ()
60
+ .withElement (dragDot1 )
61
+ .withDuration (Duration .ofSeconds (2 )))
62
+ .moveTo (new MoveToOptions ()
63
+ .withElement (dragDot3 ))
64
+ .release ();
59
65
dragNDrop .perform ();
60
66
assertNotEquals ("Drag text empty" , "" , dragText .getText ());
61
67
}
@@ -73,8 +79,10 @@ public void setUp() throws Exception {
73
79
Point center2 = dragDot3 .getCenter ();
74
80
75
81
TouchAction dragNDrop = new TouchAction (driver )
76
- .longPress (new LongPressOptions ().withAbsoluteOffset (center1 .x , center1 .y ))
77
- .moveTo (new MoveToOptions ().withRelativeOffset (center2 .x , center2 .y ))
82
+ .longPress (new LongPressOptions ()
83
+ .withAbsoluteOffset (center1 .x , center1 .y ))
84
+ .moveTo (new MoveToOptions ()
85
+ .withRelativeOffset (center2 .x , center2 .y ))
78
86
.release ();
79
87
dragNDrop .perform ();
80
88
assertNotEquals ("Drag text empty" , "" , dragText .getText ());
@@ -96,7 +104,8 @@ public void setUp() throws Exception {
96
104
.longPress (new LongPressOptions ()
97
105
.withAbsoluteOffset (center1 .x , center1 .y )
98
106
.withDuration (Duration .ofSeconds (2 )))
99
- .moveTo (new MoveToOptions ().withRelativeOffset (center2 .x , center2 .y ))
107
+ .moveTo (new MoveToOptions ()
108
+ .withRelativeOffset (center2 .x , center2 .y ))
100
109
.release ();
101
110
dragNDrop .perform ();
102
111
assertNotEquals ("Drag text empty" , "" , dragText .getText ());
@@ -108,8 +117,10 @@ public void setUp() throws Exception {
108
117
Point point =
109
118
driver .findElementById ("io.appium.android.apis:id/button_toggle" ).getLocation ();
110
119
new TouchAction (driver )
111
- .press (new PressOptions ().withAbsoluteOffset (point .x + 20 , point .y + 30 ))
112
- .waitAction (new WaitOptions ().withDuration (Duration .ofSeconds (1 )))
120
+ .press (new PressOptions ()
121
+ .withAbsoluteOffset (point .x + 20 , point .y + 30 ))
122
+ .waitAction (new WaitOptions ()
123
+ .withDuration (Duration .ofSeconds (1 )))
113
124
.release ()
114
125
.perform ();
115
126
assertEquals ("ON" ,driver
@@ -122,7 +133,8 @@ public void setUp() throws Exception {
122
133
new TouchAction (driver )
123
134
.press (new PressOptions ()
124
135
.withElement (driver .findElementById ("io.appium.android.apis:id/button_toggle" )))
125
- .waitAction (new WaitOptions ().withDuration (Duration .ofSeconds (1 )))
136
+ .waitAction (new WaitOptions ()
137
+ .withDuration (Duration .ofSeconds (1 )))
126
138
.release ()
127
139
.perform ();
128
140
assertEquals ("ON" ,driver
@@ -136,9 +148,12 @@ public void setUp() throws Exception {
136
148
driver .findElementById ("io.appium.android.apis:id/chronometer" );
137
149
138
150
TouchAction startStop = new TouchAction (driver )
139
- .tap (new TapOptions ().withElement (driver .findElementById ("io.appium.android.apis:id/start" )))
140
- .waitAction (new WaitOptions ().withDuration (Duration .ofSeconds (2 )))
141
- .tap (new TapOptions ().withElement (driver .findElementById ("io.appium.android.apis:id/stop" )));
151
+ .tap (new TapOptions ()
152
+ .withElement (driver .findElementById ("io.appium.android.apis:id/start" )))
153
+ .waitAction (new WaitOptions ()
154
+ .withDuration (Duration .ofSeconds (2 )))
155
+ .tap (new TapOptions ()
156
+ .withElement (driver .findElementById ("io.appium.android.apis:id/stop" )));
142
157
143
158
startStop .perform ();
144
159
@@ -157,7 +172,8 @@ public void setUp() throws Exception {
157
172
Point center1 = driver .findElementById ("io.appium.android.apis:id/start" ).getCenter ();
158
173
159
174
TouchAction startStop = new TouchAction (driver )
160
- .tap (new TapOptions ().withAbsoluteOffset (center1 .x , center1 .y ))
175
+ .tap (new TapOptions ()
176
+ .withAbsoluteOffset (center1 .x , center1 .y ))
161
177
.tap (new TapOptions ()
162
178
.withElement (driver .findElementById ("io.appium.android.apis:id/stop" ))
163
179
.withRelativeOffset (5 , 5 ));
@@ -181,9 +197,11 @@ public void setUp() throws Exception {
181
197
Point center = gallery .getCenter ();
182
198
183
199
TouchAction swipe = new TouchAction (driver )
184
- .press (new PressOptions ().withElement (images .get (2 ))
200
+ .press (new PressOptions ()
201
+ .withElement (images .get (2 ))
185
202
.withRelativeOffset ( -10 , center .y - location .y ))
186
- .waitAction (new WaitOptions ().withDuration (Duration .ofSeconds (2 )))
203
+ .waitAction (new WaitOptions ()
204
+ .withDuration (Duration .ofSeconds (2 )))
187
205
.moveTo (new MoveToOptions ()
188
206
.withElement (gallery )
189
207
.withRelativeOffset ( 10 , center .y - location .y ))
@@ -201,7 +219,8 @@ public void setUp() throws Exception {
201
219
.withElement (driver .findElementById ("io.appium.android.apis:id/button_toggle" )))
202
220
.waitAction (new WaitOptions ().withDuration (Duration .ofSeconds (1 )))
203
221
.release ();
204
- new MultiTouchAction (driver ).add (press )
222
+ new MultiTouchAction (driver )
223
+ .add (press )
205
224
.perform ();
206
225
assertEquals ("ON" ,driver
207
226
.findElementById ("io.appium.android.apis:id/button_toggle" ).getText ());
0 commit comments