|
32 | 32 | import org.openqa.selenium.By;
|
33 | 33 | import org.openqa.selenium.Capabilities;
|
34 | 34 | import org.openqa.selenium.DeviceRotation;
|
35 |
| -import org.openqa.selenium.Dimension; |
36 |
| -import org.openqa.selenium.Point; |
37 | 35 | import org.openqa.selenium.ScreenOrientation;
|
38 | 36 | import org.openqa.selenium.WebDriver;
|
39 | 37 | import org.openqa.selenium.WebDriverException;
|
@@ -208,131 +206,6 @@ public List<T> findElementsByXPath(String using) {
|
208 | 206 | return executeMethod;
|
209 | 207 | }
|
210 | 208 |
|
211 |
| - /** |
212 |
| - * This method is deprecated and it is going to be removed soon. |
213 |
| - */ |
214 |
| - @Deprecated |
215 |
| - public void tap(int fingers, WebElement element, int duration) { |
216 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
217 |
| - |
218 |
| - for (int i = 0; i < fingers; i++) { |
219 |
| - TouchAction tap = new TouchAction(this); |
220 |
| - multiTouch.add(tap.press(element).waitAction(duration).release()); |
221 |
| - } |
222 |
| - |
223 |
| - multiTouch.perform(); |
224 |
| - } |
225 |
| - |
226 |
| - /** |
227 |
| - * This method is deprecated and it is going to be removed soon. |
228 |
| - */ |
229 |
| - @Deprecated |
230 |
| - public void tap(int fingers, int x, int y, int duration) { |
231 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
232 |
| - |
233 |
| - for (int i = 0; i < fingers; i++) { |
234 |
| - TouchAction tap = new TouchAction(this); |
235 |
| - multiTouch.add(tap.press(x,y).waitAction(duration).release()); |
236 |
| - } |
237 |
| - multiTouch.perform(); |
238 |
| - } |
239 |
| - |
240 |
| - /** |
241 |
| - * This method is deprecated. It is going to be removed |
242 |
| - */ |
243 |
| - @Deprecated |
244 |
| - public void swipe(int startx, int starty, int endx, int endy, int duration) { |
245 |
| - //does nothing |
246 |
| - } |
247 |
| - |
248 |
| - /** |
249 |
| - * This method is deprecated and it is going to be removed soon. |
250 |
| - */ |
251 |
| - @Deprecated |
252 |
| - public void pinch(WebElement el) { |
253 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
254 |
| - |
255 |
| - Dimension dimensions = el.getSize(); |
256 |
| - Point upperLeft = el.getLocation(); |
257 |
| - Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2, |
258 |
| - upperLeft.getY() + dimensions.getHeight() / 2); |
259 |
| - int yOffset = center.getY() - upperLeft.getY(); |
260 |
| - |
261 |
| - TouchAction action0 = |
262 |
| - new TouchAction(this).press(el, center.getX(), center.getY() - yOffset).moveTo(el) |
263 |
| - .release(); |
264 |
| - TouchAction action1 = |
265 |
| - new TouchAction(this).press(el, center.getX(), center.getY() + yOffset).moveTo(el) |
266 |
| - .release(); |
267 |
| - |
268 |
| - multiTouch.add(action0).add(action1).perform(); |
269 |
| - } |
270 |
| - |
271 |
| - /** |
272 |
| - * This method is deprecated and it is going to be removed soon. |
273 |
| - */ |
274 |
| - @Deprecated |
275 |
| - public void pinch(int x, int y) { |
276 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
277 |
| - |
278 |
| - int scrHeight = this.manage().window().getSize().getHeight(); |
279 |
| - int yOffset = 100; |
280 |
| - |
281 |
| - if (y - 100 < 0) { |
282 |
| - yOffset = y; |
283 |
| - } else if (y + 100 > scrHeight) { |
284 |
| - yOffset = scrHeight - y; |
285 |
| - } |
286 |
| - |
287 |
| - TouchAction action0 = new TouchAction(this).press(x, y - yOffset).moveTo(x, y).release(); |
288 |
| - TouchAction action1 = new TouchAction(this).press(x, y + yOffset).moveTo(x, y).release(); |
289 |
| - |
290 |
| - multiTouch.add(action0).add(action1).perform(); |
291 |
| - } |
292 |
| - |
293 |
| - /** |
294 |
| - * This method is deprecated and it is going to be removed soon. |
295 |
| - */ |
296 |
| - @Deprecated |
297 |
| - public void zoom(WebElement el) { |
298 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
299 |
| - |
300 |
| - Dimension dimensions = el.getSize(); |
301 |
| - Point upperLeft = el.getLocation(); |
302 |
| - Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2, |
303 |
| - upperLeft.getY() + dimensions.getHeight() / 2); |
304 |
| - int yOffset = center.getY() - upperLeft.getY(); |
305 |
| - |
306 |
| - TouchAction action0 = new TouchAction(this).press(center.getX(), center.getY()) |
307 |
| - .moveTo(el, center.getX(), center.getY() - yOffset).release(); |
308 |
| - TouchAction action1 = new TouchAction(this).press(center.getX(), center.getY()) |
309 |
| - .moveTo(el, center.getX(), center.getY() + yOffset).release(); |
310 |
| - |
311 |
| - multiTouch.add(action0).add(action1).perform(); |
312 |
| - } |
313 |
| - |
314 |
| - /** |
315 |
| - * This method is deprecated and it is going to be removed soon. |
316 |
| - */ |
317 |
| - @Deprecated |
318 |
| - public void zoom(int x, int y) { |
319 |
| - MultiTouchAction multiTouch = new MultiTouchAction(this); |
320 |
| - |
321 |
| - int scrHeight = this.manage().window().getSize().getHeight(); |
322 |
| - int yOffset = 100; |
323 |
| - |
324 |
| - if (y - 100 < 0) { |
325 |
| - yOffset = y; |
326 |
| - } else if (y + 100 > scrHeight) { |
327 |
| - yOffset = scrHeight - y; |
328 |
| - } |
329 |
| - |
330 |
| - TouchAction action0 = new TouchAction(this).press(x, y).moveTo(0, -yOffset).release(); |
331 |
| - TouchAction action1 = new TouchAction(this).press(x, y).moveTo(0, yOffset).release(); |
332 |
| - |
333 |
| - multiTouch.add(action0).add(action1).perform(); |
334 |
| - } |
335 |
| - |
336 | 209 | @Override public WebDriver context(String name) {
|
337 | 210 | checkNotNull(name, "Must supply a context name");
|
338 | 211 | execute(DriverCommand.SWITCH_TO_CONTEXT, ImmutableMap.of("name", name));
|
|
0 commit comments