calabash-android 0.3.4 → 0.3.5

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.
@@ -1,3 +1,20 @@
1
+ 0.3.5:
2
+ No longer takes screenshots when perform_action fails.
3
+ If you want to take screenshots when a scenario fails you can use a hook:
4
+
5
+ After do |scenario|
6
+ if scenario.failed?
7
+ screenshot_embed
8
+ end
9
+ end
10
+
11
+ This hook is now part of the generated skeleton.
12
+
13
+ Upgraded to Robotium 3.6 to support api level 17.
14
+
15
+ Fixed mock location.
16
+
17
+
1
18
  0.3.4:
2
19
  Removed maps_unsupported
3
20
  The test will fail at run time if the device does not have
@@ -10,6 +10,12 @@ Before do |scenario|
10
10
  start_test_server_in_background
11
11
  end
12
12
 
13
+ After do |scenario|
14
+ if scenario.failed?
15
+ screenshot_embed
16
+ end
17
+ end
18
+
13
19
  After do
14
20
  shutdown_test_server
15
21
  end
@@ -182,13 +182,9 @@ module Operations
182
182
  raise "Empty result from TestServer" if result.chomp.empty?
183
183
  result = JSON.parse(result)
184
184
  if not result["success"] then
185
- @cucumber_world.screenshot_embed
186
- if result["bonusInformation"] && result["bonusInformation"].size > 0 && result["bonusInformation"][0].include?("Exception")
187
- log result["bonusInformation"][0]
188
- end
189
185
  raise "Step unsuccessful: #{result["message"]}"
190
186
  end
191
- return result
187
+ result
192
188
  end
193
189
  rescue Timeout::Error
194
190
  raise Exception, "Step timed out"
@@ -453,7 +449,7 @@ module Operations
453
449
  def backdoor(sel, arg)
454
450
  ni
455
451
  end
456
-
452
+
457
453
  def map( query, method_name, *method_args )
458
454
  ni
459
455
  end
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
@@ -18,5 +18,9 @@
18
18
  </application>
19
19
  <uses-sdk android:minSdkVersion="4" />
20
20
  <instrumentation android:targetPackage="#targetPackage#" android:name="sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner" />
21
+
22
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
23
+ <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
21
24
  <uses-permission android:name="android.permission.INTERNET" />
22
- </manifest>
25
+
26
+ </manifest>
@@ -14,9 +14,4 @@
14
14
  <instrumentation
15
15
  android:name="android.test.InstrumentationTestRunner"
16
16
  android:targetPackage="sh.calaba" />
17
-
18
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
19
- <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
20
- <uses-permission android:name="android.permission.INTERNET" />
21
-
22
17
  </manifest>
@@ -1,5 +1,7 @@
1
1
  package sh.calaba.instrumentationbackend;
2
2
 
3
+ import android.Manifest;
4
+ import android.content.pm.PackageManager;
3
5
  import sh.calaba.instrumentationbackend.actions.Actions;
4
6
  import sh.calaba.instrumentationbackend.actions.HttpServer;
5
7
  import android.app.Activity;
@@ -71,11 +73,14 @@ public class InstrumentationBackend extends ActivityInstrumentationTestCase2 {
71
73
  Log.e(TAG, message);
72
74
  }
73
75
 
74
- private static void removeTestLocationProviders(Activity activity) {
75
- final LocationManager locationService =
76
- (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
77
- for (final String provider : locationService.getAllProviders()) {
78
- locationService.removeTestProvider(provider);
76
+ private void removeTestLocationProviders(Activity activity) {
77
+ int hasPermission = solo.getCurrentActivity().checkCallingOrSelfPermission(Manifest.permission.ACCESS_MOCK_LOCATION);
78
+
79
+ if (hasPermission == PackageManager.PERMISSION_GRANTED) {
80
+ LocationManager locationService = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
81
+ for (final String provider : locationService.getAllProviders()) {
82
+ locationService.removeTestProvider(provider);
83
+ }
79
84
  }
80
85
  }
81
86
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-22 00:00:00.000000000 Z
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
@@ -161,7 +161,7 @@ files:
161
161
  - test-server/instrumentation-backend/.settings/org.eclipse.jdt.core.prefs
162
162
  - test-server/instrumentation-backend/AndroidManifest.xml
163
163
  - test-server/instrumentation-backend/assets/foo.bar
164
- - test-server/instrumentation-backend/libs/robotium-solo-3.3.jar
164
+ - test-server/instrumentation-backend/libs/robotium-solo-3.6.jar
165
165
  - test-server/instrumentation-backend/project.properties
166
166
  - test-server/instrumentation-backend/res/drawable-hdpi/ic_launcher.png
167
167
  - test-server/instrumentation-backend/res/drawable-ldpi/ic_launcher.png