SurfCustomCalabash 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1233f86a1afab59432539f0488d1d02cd3ed5aa5
4
- data.tar.gz: cf180dd1f054eb76e65160aefa04a17e7525a707
3
+ metadata.gz: aa6393311248346a1bfdbb65386455b6299b01b5
4
+ data.tar.gz: 49d689215e69269719e47378f7298449d1b03070
5
5
  SHA512:
6
- metadata.gz: af2cdcb154b0ea5d21c7429348de920654b7bd360b14ee904401d2fc363b176ebfb0a188676f6ffc4c11553a3af2cd6723a40a314d64efa116b6938e4a785b2e
7
- data.tar.gz: cda894ea7873a46fc361602c827baea1e4f0575575bac5e739d3182462880bc4563153171d2c9660eac5f85ece44a9d66d45f007acee899d9b7fd957258b46fb
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 coordinate
195
- def get_coordinate(element)
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 = get_coordinate(element_front)
208
- coordinate_behind = get_coordinate(element_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
@@ -78,7 +78,7 @@ module IosMethods
78
78
  end
79
79
 
80
80
  def light_swipe_trait_until_exists(dir, element_destination)
81
- light_swipe_until_exists(dir, element_destination)
81
+ normal_swipe_until_exists(dir, element_destination)
82
82
  end
83
83
 
84
84
  # pull-to-refresh screen
@@ -1,3 +1,3 @@
1
1
  module SurfCustomCalabash
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-02-02 00:00:00.000000000 Z
11
+ date: 2019-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler