calabash-cucumber 0.9.149 → 0.9.150

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: 640d5e4e268d95b44769d4d5997d619dabff8006
4
- data.tar.gz: da35cf9f62d032d2fa1b181d8c8de934301d4095
3
+ metadata.gz: e9cb615b16697711669a84fa18b9c89d5258c996
4
+ data.tar.gz: 53769b75773781a43f3135d45aad222b5cc662ad
5
5
  SHA512:
6
- metadata.gz: f796bc3ef19fb1d8f5e06198c547841a26ab9c51a1adfde16fd83ac28497f03282dffb48ea898e7c1f05dc3fb64e060637d4dbd5c11b8bd86e82cb0c531a39ca
7
- data.tar.gz: 4321411662fa7214f557d2664b976736cfa5bef19a94fcbbf1f34c5696302b9af8f2505cf1ed6fb6fd8418bb14027b4989f7d54cf12836addcaeae300e3508bb
6
+ metadata.gz: 73c212c4f54a5c85594a8410d17363e65ba1c08cd3949e0a4974dbf27d15a2bd801a5c0bc623ede3bbb18db49268a40c726116332530c2edaca91cba5534fe6d
7
+ data.tar.gz: c975e2107c7fcc76cd5bdc45af86621287907050b2e5b5f48c36fd353f9f9416318e9a4a6e02662938e726927be38d4f2d28c89f397e0bbfae4040643523d46e
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency( "location-one", "~>0.0.10")
27
27
  s.add_dependency( "httpclient","~> 2.3.3")
28
28
  s.add_dependency( "bundler", "~> 1.1")
29
- s.add_dependency( "run_loop", "~> 0.0.13" )
29
+ s.add_dependency( "run_loop", "~> 0.0.15" )
30
30
  s.add_dependency( "awesome_print")
31
31
 
32
32
  end
@@ -1,4 +1,6 @@
1
1
  require 'edn'
2
+ require 'location-one'
3
+
2
4
  module Calabash
3
5
  module Cucumber
4
6
  module UIA
@@ -12,17 +14,70 @@ module Calabash
12
14
  end
13
15
 
14
16
  def uia_query(*queryparts)
15
- #TODO escape ' in query
17
+ #TODO escape '\n etc in query
16
18
  uia_handle_command(:query, queryparts)
17
19
  end
18
20
 
21
+ def uia_names(*queryparts)
22
+ #TODO escape '\n etc in query
23
+ uia_handle_command(:names, queryparts)
24
+ end
25
+
19
26
  def uia_tap(*queryparts)
20
- #TODO escape ' in query
21
27
  uia_handle_command(:tap, queryparts)
22
28
  end
23
29
 
24
- def uia_handle_command(cmd, query)
25
- command = %Q[uia.#{cmd}('#{query.to_edn}')]
30
+ def uia_tap_mark(mark)
31
+ uia_handle_command(:tapMark, mark)
32
+ end
33
+
34
+ def uia_pan(from_q, to_q)
35
+ uia_handle_command(:pan, from_q, to_q)
36
+ end
37
+
38
+ def uia_scroll_to(*queryparts)
39
+ uia_handle_command(:scrollTo, queryparts)
40
+ end
41
+
42
+ def uia_element_exists?(*queryparts)
43
+ uia_handle_command(:elementExists, queryparts)
44
+ end
45
+
46
+ def uia_element_does_not_exist?(*queryparts)
47
+ uia_handle_command(:elementDoesNotExist, queryparts)
48
+ end
49
+
50
+ def uia_screenshot(name)
51
+ uia_handle_command(:elementDoesNotExist, name)
52
+ end
53
+
54
+ def uia_type_string(string)
55
+ uia_handle_command(:typeString, string)
56
+ end
57
+
58
+ def uia_enter()
59
+ uia_handle_command(:enter)
60
+ end
61
+
62
+ def uia_set_location(place)
63
+ if place.is_a?(String)
64
+ loc = LocationOne::Client.location_by_place(place)
65
+ loc_data = {"latitude"=>loc.latitude, "longitude"=>loc.longitude}
66
+ else
67
+ loc_data = place
68
+ end
69
+ uia_handle_command(:setLocation, loc_data)
70
+ end
71
+
72
+ def uia_handle_command(cmd, *query_args)
73
+ args = query_args.map do |part|
74
+ if part.is_a?(String)
75
+ "'#{escape_uia_string(part)}'"
76
+ else
77
+ "'#{escape_uia_string(part.to_edn)}'"
78
+ end
79
+ end
80
+ command = %Q[uia.#{cmd}(#{args.join(', ')})]
26
81
  if ENV['DEBUG'] == '1'
27
82
  puts "Sending UIA command"
28
83
  puts command
@@ -39,6 +94,10 @@ module Calabash
39
94
  end
40
95
  end
41
96
 
97
+ def escape_uia_string(string)
98
+ #TODO escape '\n in query
99
+ string
100
+ end
42
101
 
43
102
  end
44
103
  end
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.149'
4
- FRAMEWORK_VERSION = '0.9.146'
3
+ VERSION = '0.9.150'
4
+ FRAMEWORK_VERSION = '0.9.150'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.149
4
+ version: 0.9.150
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
- version: 0.0.13
159
+ version: 0.0.15
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
- version: 0.0.13
166
+ version: 0.0.15
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: awesome_print
169
169
  requirement: !ruby/object:Gem::Requirement