File tree 1 file changed +15
-8
lines changed
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,21 @@ xpaths("//some xpaths")
90
90
- ` mobile: ` commands depends on WDA and Apple's framework and the behaviour depends on them.
91
91
- Sometimes issues occur such as "doubleTap isn't tapping #548 "
92
92
- workaround for it:
93
- ```ruby
94
- def double_tap(element)
95
- # Find the object, then go to the middle of it, and double-tap
96
- tap_x = element.location.x + element.size.width * 0.50
97
- tap_y = element.location.y + element.size.height * 0.50
98
- execute_script 'mobile: doubleTap', x: tap_x, y: tap_y
99
- end
100
- ```
93
+ - with ` selenium-webdriver >= 3.4.0 `
94
+ ```ruby
95
+ def double_tap(element)
96
+ rect = element.rect
97
+ execute_script 'mobile: doubleTap', x: rect.x + rect.width / 2, y: rect.y + rect.height / 2
98
+ end
99
+ ```
100
+ - with ` selenium-webdriver < 3.4.0 `
101
+ ```ruby
102
+ def double_tap(element)
103
+ size = element.size
104
+ location = element.location
105
+ execute_script 'mobile: doubleTap', x: location.x + size.width / 2, y: location.y + size.height / 2
106
+ end
107
+ ```
101
108
102
109
## Other actions
103
110
Basically, other actions such as ` type ` are compatible with ` automationName = Appium ` .
You can’t perform that action at this time.
0 commit comments