Skip to content

Commit b697246

Browse files
committed
[2.2.0] - Update dependencies. Fixed related parts.
1 parent 6ec3898 commit b697246

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.itarray</groupId>
88
<artifactId>automotion</artifactId>
9-
<version>2.1.1</version>
9+
<version>2.2.0</version>
1010
<name>Automotion</name>
1111
<description>Library for smart visual automation testing</description>
1212
<url>https://automotion.itarray.net</url>
@@ -163,22 +163,22 @@
163163
<dependency>
164164
<groupId>org.seleniumhq.selenium</groupId>
165165
<artifactId>selenium-java</artifactId>
166-
<version>3.10.0</version>
166+
<version>3.141.59</version>
167167
</dependency>
168168
<dependency>
169169
<groupId>org.seleniumhq.selenium</groupId>
170170
<artifactId>selenium-server</artifactId>
171-
<version>3.10.0</version>
171+
<version>3.141.59</version>
172172
</dependency>
173173
<dependency>
174174
<groupId>org.seleniumhq.selenium</groupId>
175175
<artifactId>selenium-remote-driver</artifactId>
176-
<version>3.10.0</version>
176+
<version>3.141.59</version>
177177
</dependency>
178178
<dependency>
179179
<groupId>io.appium</groupId>
180180
<artifactId>java-client</artifactId>
181-
<version>5.0.4</version>
181+
<version>7.0.0</version>
182182
</dependency>
183183
<dependency>
184184
<groupId>com.google.guava</groupId>
@@ -188,12 +188,12 @@
188188
<dependency>
189189
<groupId>org.apache.httpcomponents</groupId>
190190
<artifactId>httpclient</artifactId>
191-
<version>4.5.5</version>
191+
<version>4.5.6</version>
192192
</dependency>
193193
<dependency>
194194
<groupId>org.apache.httpcomponents</groupId>
195195
<artifactId>httpmime</artifactId>
196-
<version>4.5.5</version>
196+
<version>4.5.6</version>
197197
</dependency>
198198
<dependency>
199199
<groupId>org.apache.commons</groupId>
@@ -213,7 +213,7 @@
213213
<dependency>
214214
<groupId>javax.mail</groupId>
215215
<artifactId>javax.mail-api</artifactId>
216-
<version>1.6.1</version>
216+
<version>1.6.2</version>
217217
</dependency>
218218
<dependency>
219219
<groupId>ru.yandex.qatools.ashot</groupId>
@@ -253,13 +253,13 @@
253253
<dependency>
254254
<groupId>org.assertj</groupId>
255255
<artifactId>assertj-core</artifactId>
256-
<version>3.9.1</version>
256+
<version>3.11.1</version>
257257
<scope>test</scope>
258258
</dependency>
259259
<dependency>
260260
<groupId>org.mockito</groupId>
261261
<artifactId>mockito-core</artifactId>
262-
<version>2.15.0</version>
262+
<version>2.23.4</version>
263263
<scope>test</scope>
264264
</dependency>
265265
<dependency>

src/main/java/net/itarray/automotion/tools/driver/DriverHelper.java

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import io.appium.java_client.*;
44
import io.appium.java_client.android.AndroidDriver;
5+
import io.appium.java_client.touch.WaitOptions;
6+
import io.appium.java_client.touch.offset.PointOption;
57
import org.apache.commons.io.FileUtils;
68
import org.openqa.selenium.*;
79
import org.openqa.selenium.interactions.Actions;
@@ -15,6 +17,7 @@
1517
import java.time.Duration;
1618
import java.util.List;
1719

20+
import static io.appium.java_client.touch.offset.PointOption.*;
1821
import static java.lang.Thread.sleep;
1922
import static net.itarray.automotion.tools.environment.EnvironmentFactory.*;
2023

@@ -101,9 +104,9 @@ public static void scrollDownMobile(AppiumDriver driver, int duration) {
101104

102105
new MultiTouchAction(driver)
103106
.add(new TouchAction(driver)
104-
.press(screenWidthStart, screenHeightStart)
105-
.waitAction(Duration.ofMillis(duration))
106-
.moveTo(screenWidthStart, 0))
107+
.press(point(new Point(screenWidthStart, screenHeightStart)))
108+
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(duration)))
109+
.moveTo(point(screenWidthStart, 0)))
107110
.perform();
108111
}
109112

@@ -120,9 +123,9 @@ public static void scrollUpMobile(AppiumDriver driver, int duration) {
120123

121124
new MultiTouchAction(driver)
122125
.add(new TouchAction(driver)
123-
.press(screenWidthStart, screenHeightStart)
124-
.waitAction(Duration.ofMillis(duration))
125-
.moveTo(screenWidthStart, dimensions.getHeight()))
126+
.press(point(screenWidthStart, screenHeightStart))
127+
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(duration)))
128+
.moveTo(point(screenWidthStart, dimensions.getHeight())))
126129
.perform();
127130
}
128131

@@ -142,9 +145,9 @@ public static void scrollDownMobileElement(AppiumDriver driver, MobileElement el
142145

143146
new MultiTouchAction(driver)
144147
.add(new TouchAction(driver)
145-
.press(screenWidthStart, screenHeightStart)
146-
.waitAction(Duration.ofMillis(duration))
147-
.moveTo(screenWidthStart, position.getY()))
148+
.press(point(screenWidthStart, screenHeightStart))
149+
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(duration)))
150+
.moveTo(point(screenWidthStart, position.getY())))
148151
.perform();
149152

150153
LOG.info("Scroll down element " + element.getId());
@@ -159,9 +162,9 @@ public static void scrollUpMobileElement(AppiumDriver driver, MobileElement elem
159162

160163
new MultiTouchAction(driver)
161164
.add(new TouchAction(driver)
162-
.press(screenWidthStart, screenHeightStart)
163-
.waitAction(Duration.ofMillis(500))
164-
.moveTo(screenWidthStart, dimensions.getHeight()))
165+
.press(point(screenWidthStart, screenHeightStart))
166+
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(500)))
167+
.moveTo(point(screenWidthStart, dimensions.getHeight())))
165168
.perform();
166169

167170
LOG.info("Scroll up element " + element.getId());
@@ -213,15 +216,15 @@ public static void hideKeyboard(AppiumDriver driver) {
213216

214217
new MultiTouchAction(driver)
215218
.add(new TouchAction(driver)
216-
.press(screenWidthStart, screenHeightStart)
217-
.waitAction(Duration.ofMillis(500))
218-
.moveTo(screenWidthStart, dimensions.getHeight()))
219+
.press(point(screenWidthStart, screenHeightStart))
220+
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(500)))
221+
.moveTo(point(screenWidthStart, dimensions.getHeight())))
219222
.perform();
220223
} else {
221224
int x = dimensions.getWidth() - 30;
222225
int y = dimensions.getHeight() - 30;
223226

224-
new TouchAction(driver).tap(x, y);
227+
new TouchAction(driver).tap(point(x, y));
225228
}
226229
} else if (isAndroid()) {
227230
try {
@@ -310,19 +313,19 @@ public static void clickMobileElementByLocation(AppiumDriver driver, MobileEleme
310313
int y = location.getY();
311314
switch (clickPoint) {
312315
case TOP_LEFT:
313-
new TouchAction(driver).tap(x + 5, y + 5);
316+
new TouchAction(driver).tap(point(x + 5, y + 5));
314317
break;
315318
case TOP_RIGHT:
316-
new TouchAction(driver).tap(x + size.getWidth() - 5, y + 5);
319+
new TouchAction(driver).tap(point(x + size.getWidth() - 5, y + 5));
317320
break;
318321
case BOTTOM_LEFT:
319-
new TouchAction(driver).tap(x + 5, y + size.getHeight() - 5);
322+
new TouchAction(driver).tap(point(x + 5, y + size.getHeight() - 5));
320323
break;
321324
case BOTTOM_RIGHT:
322-
new TouchAction(driver).tap(x + size.getWidth() - 5, y + size.getHeight() - 5);
325+
new TouchAction(driver).tap(point(x + size.getWidth() - 5, y + size.getHeight() - 5));
323326
break;
324327
case CENTER:
325-
new TouchAction(driver).tap(x + size.getWidth() / 2, y + size.getHeight() / 2);
328+
new TouchAction(driver).tap(point(x + size.getWidth() / 2, y + size.getHeight() / 2));
326329
break;
327330
}
328331
LOG.info("INFO", "Click on " + clickPoint + " point");

0 commit comments

Comments
 (0)