SurfCustomCalabash 0.1.4 → 0.1.6

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: 5783c8d5dd0f7b7aa8faf7e231b7c550b4c32bdd
4
- data.tar.gz: b0e76a7a96c1d707d3b627789b334c8502e07f5f
3
+ metadata.gz: 719a47490b3ee7c43b29dfff52939628a76d8a3e
4
+ data.tar.gz: 9f0a757d2fa132e512298c31fdd49ae5cba54257
5
5
  SHA512:
6
- metadata.gz: 384d562cfc65bd410888bbeb61e8e7b9814d62ec680617254381442239939b6ca90f85b696226d7a43bfb42e979e602766d4bfd51195a80b6aa3f515745b3b27
7
- data.tar.gz: 045a65d035bab415b2f99c1428446f23d97f0dd5f3db3e0bcd1dd7c677ffa12dba6e8e5793c7297d281bf51d2911ae568d59f66276b742cc65eeb1fa9cac0e8b
6
+ metadata.gz: d9093b915c8bf382758cf40fb47358ea73f910129ff397bd97337adb40365f4a8ceab6e018434c41d684a7edbfd5cb6e58bc7bcef8949520c920d70d0b9bb462
7
+ data.tar.gz: 3a7d4fea4a6cd56da9e1e351df84dc52f23714a01a81e6cc0754ba8c61431e0499bbd916495e5fe39956fa632925d31667563a7d03bcb5e6e1ac5f381bf36a4f
@@ -1,9 +1,9 @@
1
1
  require 'rspec/expectations'
2
2
 
3
- module CommonMethods
3
+ # module CommonMethods
4
4
 
5
5
 
6
- def enter_text(text)
6
+ def enter_text_from_keyboard(text)
7
7
  wait_for_keyboard(:timeout=>5)
8
8
  keyboard_enter_text(text)
9
9
  end
@@ -108,16 +108,6 @@ module CommonMethods
108
108
  end
109
109
  end
110
110
 
111
- # Drag element from one place to place of other element
112
- def drag_element(element_from , element_to)
113
- x_from = get_coordinate_x(element_from)
114
- y_from = get_coordinate_y(element_from)
115
-
116
- x_to = get_coordinate_x(element_to)
117
- y_to = get_coordinate_y(element_to)
118
- drag_coordinates(x_from, y_from, x_to, y_to, 10, 0.5, 0.5)
119
- end
120
-
121
111
  # -------------------------------------------------Asserts------------------------------------------------------------
122
112
  def assert_eql_with_rescue(element1, element2)
123
113
  begin
@@ -225,6 +215,15 @@ module CommonMethods
225
215
  return coordinate.to_i
226
216
  end
227
217
 
218
+ # Drag element from one place to place of other element
219
+ def drag_element(element_from , element_to)
220
+ x_from = get_coordinate_x(element_from)
221
+ y_from = get_coordinate_y(element_from)
222
+
223
+ x_to = get_coordinate_x(element_to)
224
+ y_to = get_coordinate_y(element_to)
225
+ drag_coordinates(x_from, y_from, x_to, y_to, 10, 0.5, 0.5)
226
+ end
228
227
 
229
228
  # if elements cross - return true, if not - false
230
229
  def cross_coordinate(element_front, element_behind)
@@ -255,12 +254,13 @@ module CommonMethods
255
254
 
256
255
  # if apps support two localization, this method check exists text in different locations
257
256
  def text_with_locale(text_locale1, text_locale2)
258
- if element_exists("* {text BEGINSWITH '#{text_locale2}'}")
259
- puts (element_exists("* {text BEGINSWITH '#{text_locale2}'}"))
260
- return "* {text BEGINSWITH '#{text_locale2}'}"
261
- elsif element_exists("* {text BEGINSWITH '#{text_locale1}'}")
262
- puts(element_exists("* {text BEGINSWITH '#{text_locale1}'}"))
263
- return "* {text BEGINSWITH '#{text_locale1}'}"
257
+ sleep(1)
258
+ locale_el1 = "* {text CONTAINS '#{text_locale1}'}"
259
+ locale_el2 = "* {text CONTAINS '#{text_locale2}'}"
260
+ if element_exists(locale_el1)
261
+ return locale_el1
262
+ elsif element_exists(locale_el2)
263
+ return locale_el2
264
264
  else
265
265
  return ("No such query!")
266
266
  end
@@ -277,4 +277,4 @@ module CommonMethods
277
277
  end
278
278
  end
279
279
 
280
- end
280
+ # end
@@ -1,9 +1,9 @@
1
1
  require 'calabash-android'
2
2
  require 'SurfCustomCalabash/CommonMethods'
3
3
 
4
- module DroidMethods
5
- include Calabash::Android::Operations
6
- include CommonMethods
4
+ # module DroidMethods
5
+ # include Calabash::Android::Operations
6
+ # include CommonMethods
7
7
 
8
8
  def close_keyboard
9
9
  if keyboard_visible?
@@ -91,4 +91,4 @@ module DroidMethods
91
91
  perform_action('drag', 50, 50, 15, 75, 4)
92
92
  end
93
93
 
94
- end
94
+ # end
@@ -1,8 +1,17 @@
1
1
  require 'calabash-cucumber/ibase'
2
2
  require 'SurfCustomCalabash/CommonMethods'
3
3
 
4
- module IosMethods
5
- include CommonMethods
4
+ # module IosMethods
5
+ # include CommonMethods
6
+
7
+ # tap on Done on keyboard
8
+ def submit_keyboard
9
+ if element_exists("* marked:'Toolbar Done Button'")
10
+ touch("* marked:'Toolbar Done Button'")
11
+ else
12
+ tap_keyboard_action_key
13
+ end
14
+ end
6
15
 
7
16
  #----------------------------------------------Custom Swipe iOS-------------------------------------------------------
8
17
  def strong_swipe(dir)
@@ -86,4 +95,4 @@ module IosMethods
86
95
  swipe(:down, :offset => {:x => 0, :y => -200})
87
96
  end
88
97
 
89
- end
98
+ # end
@@ -1,3 +1,3 @@
1
1
  module SurfCustomCalabash
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.6"
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.4
4
+ version: 0.1.6
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-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler