calabash-cucumber 0.9.148 → 0.9.149

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: 025f351d56fac5ff108230ce3e40b41a7b3d1a06
4
- data.tar.gz: 2cb59b2008047bd41b12c80fa202d4d6c61a2c4e
3
+ metadata.gz: 640d5e4e268d95b44769d4d5997d619dabff8006
4
+ data.tar.gz: da35cf9f62d032d2fa1b181d8c8de934301d4095
5
5
  SHA512:
6
- metadata.gz: a280eae537a3736f2cde14cdf2d9dde20e4a039021ad637ff86c7c1fd3d92696905bcd3076b9ebca021de8fb86290ec23bc424aebbc04a9bf70f713e42f71567
7
- data.tar.gz: d4bbd775053737edf46b1de99b8e74c6b4cbc062ca4952fcaac76cf271eff7512a572335833be5249ec5e955b422d894dd2607ee97961e4e896cb089e5590575
6
+ metadata.gz: f796bc3ef19fb1d8f5e06198c547841a26ab9c51a1adfde16fd83ac28497f03282dffb48ea898e7c1f05dc3fb64e060637d4dbd5c11b8bd86e82cb0c531a39ca
7
+ data.tar.gz: 4321411662fa7214f557d2664b976736cfa5bef19a94fcbbf1f34c5696302b9af8f2505cf1ed6fb6fd8418bb14027b4989f7d54cf12836addcaeae300e3508bb
@@ -19,13 +19,14 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency( "cucumber", "~> 1.3.0" )
20
20
  s.add_dependency( "calabash-common", "~> 0.0.1" )
21
21
  s.add_dependency( "json" )
22
+ s.add_dependency( 'edn')
22
23
  s.add_dependency( "CFPropertyList" )
23
24
  s.add_dependency( "sim_launcher", "0.4.6")
24
25
  s.add_dependency( "slowhandcuke" )
25
26
  s.add_dependency( "location-one", "~>0.0.10")
26
27
  s.add_dependency( "httpclient","~> 2.3.3")
27
28
  s.add_dependency( "bundler", "~> 1.1")
28
- s.add_dependency( "run_loop", "~> 0.0.12" )
29
+ s.add_dependency( "run_loop", "~> 0.0.13" )
29
30
  s.add_dependency( "awesome_print")
30
31
 
31
32
  end
@@ -1,9 +1,11 @@
1
1
  require 'httpclient'
2
2
  require 'calabash-cucumber/launch/simulator_helper'
3
+ require 'calabash-cucumber/uia'
3
4
 
4
5
  module Calabash
5
6
  module Cucumber
6
7
  module Core
8
+ include Calabash::Cucumber::UIA
7
9
 
8
10
  DATA_PATH = File.expand_path(File.dirname(__FILE__))
9
11
  CAL_HTTP_RETRY_COUNT=3
@@ -91,13 +93,20 @@ module Calabash
91
93
  end
92
94
 
93
95
  options[:query] = uiquery
94
- views_touched = playback("touch", options)
96
+ views_touched = do_touch(options)
95
97
  unless uiquery.nil?
96
98
  screenshot_and_raise "could not find view to touch: '#{uiquery}', args: #{options}" if views_touched.empty?
97
99
  end
98
100
  views_touched
99
101
  end
100
102
 
103
+ def do_touch(options)
104
+ if ENV['OS']=='ios7' || @calabash_launcher && @calabash_launcher.ios_major_version == "7"
105
+ options[:uia_gesture] = :tap
106
+ end
107
+ playback("touch", options)
108
+ end
109
+
101
110
  def swipe(dir, options={})
102
111
  dir = dir.to_sym
103
112
  @current_rotation = @current_rotation || :down
@@ -412,6 +421,7 @@ EOF
412
421
  post_data<< %Q|,"query":"#{escape_quotes(options[:query])}"| if options[:query]
413
422
  post_data<< %Q|,"offset":#{options[:offset].to_json}| if options[:offset]
414
423
  post_data<< %Q|,"reverse":#{options[:reverse]}| if options[:reverse]
424
+ post_data<< %Q|,"uia_gesture":"#{options[:uia_gesture]}"| if options[:uia_gesture]
415
425
  post_data<< %Q|,"prototype":"#{options[:prototype]}"| if options[:prototype]
416
426
  post_data << "}"
417
427
 
@@ -539,14 +549,6 @@ EOF
539
549
  @calabash_launcher && @calabash_launcher.device
540
550
  end
541
551
 
542
- def send_uia_command(opts ={})
543
- run_loop = opts[:run_loop] || (@calabash_launcher && @calabash_launcher.active? && @calabash_launcher.run_loop)
544
- command = opts[:command]
545
- raise ArgumentError, 'please supply :run_loop or instance var @calabash_launcher' unless run_loop
546
- raise ArgumentError, 'please supply :command' unless command
547
- RunLoop.send_command(run_loop, opts[:command])
548
- end
549
-
550
552
 
551
553
  def http(options, data=nil)
552
554
  options[:uri] = url_for(options[:path])
@@ -72,6 +72,7 @@ class Calabash::Cucumber::Launcher
72
72
  if target != 'DEVICE'
73
73
  default_args[:udid] = target
74
74
  end
75
+ default_args
75
76
  self.run_loop = RunLoop.run(default_args.merge(args))
76
77
  else
77
78
 
@@ -0,0 +1,9 @@
1
+ YnBsaXN0MDCiARLVAgMEBQYHCAkOEVRUaW1lVERhdGFeV2luZG93TG9jYXRpb25Y
2
+ TG9jYXRpb25UVHlwZRMAADAlq7xUgk8QQAEAAAABAAEAAAAAAAAAAAAAAAAAAAAA
3
+ AAAAAAAAAAAAAAABAAICAgAAAIA/AACAPwAALEMAAH5DAECKQAAAAADSCgsMDVFY
4
+ UVkjQGWAAAAAAAAjQG/AAAAAAADSCgsPECNAZYAAAAAAACNAb8AAAAAAABELudUC
5
+ AwQFBhMUFRgREwAAMCWuVOtDTxBABgAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAA
6
+ AAAAAAAAAAEAAgIBAAAAgD8AAIA/AAAsQwAAfkMAAAAAAAAAANIKCxYXI0BlgAAA
7
+ AAAAI0BvwAAAAAAA0goLGRojQGWAAAAAAAAjQG/AAAAAAAAACAALABYAGwAgAC8A
8
+ OAA9AEYAiQCOAJAAkgCbAKQAqQCyALsAvgDJANIBFQEaASMBLAExAToAAAAAAAAC
9
+ AQAAAAAAAAAbAAAAAAAAAAAAAAAAAAABQw==
@@ -0,0 +1,9 @@
1
+ YnBsaXN0MDCiARLVAgMEBQYHCAkOEVRUaW1lVERhdGFeV2luZG93TG9jYXRpb25Y
2
+ TG9jYXRpb25UVHlwZRMAADAlq7xUgk8QQAEAAAABAAEAAAAAAAAAAAAAAAAAAAAA
3
+ AAAAAAAAAAAAAAABAAICAgAAAIA/AACAPwAALEMAAH5DAECKQAAAAADSCgsMDVFY
4
+ UVkjQGWAAAAAAAAjQG/AAAAAAADSCgsPECNAZYAAAAAAACNAb8AAAAAAABELudUC
5
+ AwQFBhMUFRgREwAAMCWuVOtDTxBABgAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAA
6
+ AAAAAAAAAAEAAgIBAAAAgD8AAIA/AAAsQwAAfkMAAAAAAAAAANIKCxYXI0BlgAAA
7
+ AAAAI0BvwAAAAAAA0goLGRojQGWAAAAAAAAjQG/AAAAAAAAACAALABYAGwAgAC8A
8
+ OAA9AEYAiQCOAJAAkgCbAKQAqQCyALsAvgDJANIBFQEaASMBLAExAToAAAAAAAAC
9
+ AQAAAAAAAAAbAAAAAAAAAAAAAAAAAAABQw==
@@ -0,0 +1,45 @@
1
+ require 'edn'
2
+ module Calabash
3
+ module Cucumber
4
+ module UIA
5
+
6
+ def send_uia_command(opts ={})
7
+ run_loop = opts[:run_loop] || (@calabash_launcher && @calabash_launcher.active? && @calabash_launcher.run_loop)
8
+ command = opts[:command]
9
+ raise ArgumentError, 'please supply :run_loop or instance var @calabash_launcher' unless run_loop
10
+ raise ArgumentError, 'please supply :command' unless command
11
+ RunLoop.send_command(run_loop, opts[:command])
12
+ end
13
+
14
+ def uia_query(*queryparts)
15
+ #TODO escape ' in query
16
+ uia_handle_command(:query, queryparts)
17
+ end
18
+
19
+ def uia_tap(*queryparts)
20
+ #TODO escape ' in query
21
+ uia_handle_command(:tap, queryparts)
22
+ end
23
+
24
+ def uia_handle_command(cmd, query)
25
+ command = %Q[uia.#{cmd}('#{query.to_edn}')]
26
+ if ENV['DEBUG'] == '1'
27
+ puts "Sending UIA command"
28
+ puts command
29
+ end
30
+ s=send_uia_command :command => command
31
+ if ENV['DEBUG'] == '1'
32
+ puts "Result"
33
+ p s
34
+ end
35
+ if s['status'] == 'success'
36
+ s['value']
37
+ else
38
+ raise s
39
+ end
40
+ end
41
+
42
+
43
+ end
44
+ end
45
+ end
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.148'
3
+ VERSION = '0.9.149'
4
4
  FRAMEWORK_VERSION = '0.9.146'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.148
4
+ version: 0.9.149
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-04 00:00:00.000000000 Z
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: edn
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: CFPropertyList
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +156,14 @@ dependencies:
142
156
  requirements:
143
157
  - - ~>
144
158
  - !ruby/object:Gem::Version
145
- version: 0.0.12
159
+ version: 0.0.13
146
160
  type: :runtime
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - ~>
151
165
  - !ruby/object:Gem::Version
152
- version: 0.0.12
166
+ version: 0.0.13
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: awesome_print
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -278,6 +292,8 @@ files:
278
292
  - lib/calabash-cucumber/resources/touch_ios4_iphone.base64
279
293
  - lib/calabash-cucumber/resources/touch_ios5_ipad.base64
280
294
  - lib/calabash-cucumber/resources/touch_ios5_iphone.base64
295
+ - lib/calabash-cucumber/resources/touch_ios7_ipad.base64
296
+ - lib/calabash-cucumber/resources/touch_ios7_iphone.base64
281
297
  - lib/calabash-cucumber/resources/wheel_down_ios4_ipad.base64
282
298
  - lib/calabash-cucumber/resources/wheel_down_ios4_iphone.base64
283
299
  - lib/calabash-cucumber/resources/wheel_down_ios5_ipad.base64
@@ -287,6 +303,7 @@ files:
287
303
  - lib/calabash-cucumber/resources/wheel_up_ios5_ipad.base64
288
304
  - lib/calabash-cucumber/resources/wheel_up_ios5_iphone.base64
289
305
  - lib/calabash-cucumber/tests_helpers.rb
306
+ - lib/calabash-cucumber/uia.rb
290
307
  - lib/calabash-cucumber/version.rb
291
308
  - lib/calabash-cucumber/wait_helpers.rb
292
309
  - scripts/.irbrc