SurfCustomCalabash 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa6393311248346a1bfdbb65386455b6299b01b5
|
4
|
+
data.tar.gz: 49d689215e69269719e47378f7298449d1b03070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb9273680f9bf8ea1b0aa4fdc0884d40d29dd39cfdf437044b0f46e2c4bfc55c053fa505f86e2704030e311aa131fed91a0e25ee3ed2df2a612cec097f4aacb0
|
7
|
+
data.tar.gz: cb8d7e6e95c75051f0d19d4bec14c3dc7284f4b76be85351d6b2c905c60f696b8bd7be0604005baa49ef58c185f5b9b932799c5bbc502b73bfe94709e38c3c6f
|
@@ -106,6 +106,16 @@ module CommonMethods
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
# Drag element from one place to place of other element
|
110
|
+
def drag_element(element_from , element_to)
|
111
|
+
x_from = get_coordinate_x(element_from)
|
112
|
+
y_from = get_coordinate_y(element_from)
|
113
|
+
|
114
|
+
x_to = get_coordinate_x(element_to)
|
115
|
+
y_to = get_coordinate_y(element_to)
|
116
|
+
drag_coordinates(x_from, y_from, x_to, y_to, 10, 0.5, 0.5)
|
117
|
+
end
|
118
|
+
|
109
119
|
# -------------------------------------------------Asserts------------------------------------------------------------
|
110
120
|
def assert_eql_with_rescue(element1, element2)
|
111
121
|
begin
|
@@ -191,21 +201,29 @@ module CommonMethods
|
|
191
201
|
wait_for_element_does_not_exist("* {text CONTAINS'#{text}'}", :timeout => 5, :retry_frequency => 5)
|
192
202
|
end
|
193
203
|
|
194
|
-
# get element
|
195
|
-
def
|
204
|
+
# get element's coordinates
|
205
|
+
def get_coordinate_x(element)
|
206
|
+
el = query(element)
|
207
|
+
coordinate = el[0]['rect']['center_x']
|
208
|
+
# puts(coordinate)
|
209
|
+
return coordinate.to_i
|
210
|
+
end
|
211
|
+
|
212
|
+
def get_coordinate_y(element)
|
196
213
|
el = query(element)
|
197
214
|
coordinate = el[0]['rect']['center_y']
|
198
215
|
# puts(coordinate)
|
199
216
|
return coordinate.to_i
|
200
217
|
end
|
201
218
|
|
219
|
+
|
202
220
|
# if elements cross - return true, if not - false
|
203
221
|
def cross_coordinate(element_front, element_behind)
|
204
222
|
cross = false
|
205
223
|
|
206
224
|
if element_exists(element_front) && element_exists(element_behind)
|
207
|
-
coordinate_front =
|
208
|
-
coordinate_behind =
|
225
|
+
coordinate_front = get_coordinate_y(element_front)
|
226
|
+
coordinate_behind = get_coordinate_y(element_behind)
|
209
227
|
delta = 100
|
210
228
|
|
211
229
|
if coordinate_front < coordinate_behind + delta
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SurfCustomCalabash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Hripunov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|