brazenhead 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  <instrumentation
7
7
  android:name="com.leandog.brazenhead.BrazenheadInstrumentation"
8
- android:targetPackage="com.example.android.apis" />
8
+ android:targetPackage="com.example" />
9
9
 
10
10
  <uses-permission android:name="android.permission.INTERNET" />
11
11
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Binary file
@@ -20,11 +20,6 @@ Feature: Calling Robotium methods
20
20
  When I call a method with a boolean
21
21
  Then I should receive a successful result
22
22
 
23
- Scenario: Getting useful View information
24
- When I get the first "Text" View I find
25
- Then I should receive a successful result
26
- And the view should have some basic information
27
-
28
23
  Scenario: Chaining method calls
29
24
  When I call "getCurrentListViews" and then I call "size"
30
25
  Then I should receive a successful result
@@ -0,0 +1,9 @@
1
+ Feature: Serializing Information
2
+
3
+ Scenario: Getting useful view information
4
+ When I call a method that returns a view
5
+ Then we should have basic information about a view
6
+
7
+ Scenario: Getting text view information
8
+ When I call a method that returns a text view
9
+ Then the text for the view should be returned
@@ -26,24 +26,6 @@ Then /^I should receive a successful result$/ do
26
26
  @driver.last_response.code.should eq '200'
27
27
  end
28
28
 
29
- When /^I get the first "(.*?)" View I find$/ do |view_type|
30
- @driver.send "get_#{view_type.downcase}", 0
31
- end
32
-
33
- Then /^the view should have some basic information$/ do
34
- response = JSON.parse(@driver.last_response.body)
35
- response.should have_key "id"
36
- response.should have_key "classType"
37
- response.should have_key "width"
38
- response.should have_key "height"
39
- response.should have_key "screenLocation"
40
- response.should have_key "windowLocation"
41
- response.should have_key "left"
42
- response.should have_key "top"
43
- response.should have_key "right"
44
- response.should have_key "bottom"
45
- end
46
-
47
29
  When /^I call "(.*?)" and then I call "(.*?)"$/ do |first_method, next_method|
48
30
  @driver.chain_calls do |driver|
49
31
  driver.send first_method
@@ -0,0 +1,30 @@
1
+ When /^I call a method that returns a view$/ do
2
+ @driver.chain_calls do |driver|
3
+ driver.get_views
4
+ driver.get 0
5
+ end
6
+ end
7
+
8
+ Then /^we should have basic information about a view$/ do
9
+ @driver.should have_succeeded
10
+
11
+ response = @driver.json_response
12
+ response.should have_key "id"
13
+ response.should have_key "classType"
14
+ response.should have_key "width"
15
+ response.should have_key "height"
16
+ response.should have_key "screenLocation"
17
+ response.should have_key "windowLocation"
18
+ response.should have_key "left"
19
+ response.should have_key "top"
20
+ response.should have_key "right"
21
+ response.should have_key "bottom"
22
+ end
23
+
24
+ When /^I call a method that returns a text view$/ do
25
+ @driver.get_text 0
26
+ end
27
+
28
+ Then /^the text for the view should be returned$/ do
29
+ @driver.json_response.should have_key "text"
30
+ end
@@ -18,6 +18,14 @@ server = Brazenhead::Server.new('features/support/ApiDemos.apk', keystore)
18
18
 
19
19
  class Driver
20
20
  include Brazenhead
21
+
22
+ def has_succeeded?
23
+ last_response.code == '200'
24
+ end
25
+
26
+ def json_response
27
+ JSON.parse last_response.body
28
+ end
21
29
  end
22
30
 
23
31
  Before do
@@ -7,7 +7,7 @@ module Brazenhead
7
7
  include Brazenhead::Signer
8
8
 
9
9
  def update_manifest(apk, manifest, min_sdk = 8)
10
- process.run(*update, *package(apk), *with(manifest), *using(path_to(min_sdk)))
10
+ process.run(*update, *package(apk), *with_the(manifest), *using(path_to(min_sdk)))
11
11
  end
12
12
 
13
13
  def dump_resources(apk, resource_file)
@@ -32,7 +32,7 @@ module Brazenhead
32
32
  ["-F", apk]
33
33
  end
34
34
 
35
- def with(manifest)
35
+ def with_the(manifest)
36
36
  ["-M", manifest]
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module Brazenhead
2
- VERSION = "0.2"
2
+ VERSION = "0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brazenhead
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-15 00:00:00.000000000 Z
13
+ date: 2012-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: childprocess
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.5.1
70
+ version: 0.5.2
71
71
  type: :development
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ! '>='
77
77
  - !ruby/object:Gem::Version
78
- version: 0.5.1
78
+ version: 0.5.2
79
79
  description: Driver that accepts remote json requests and invokes methods inside Android
80
80
  emulator / device.
81
81
  email:
@@ -89,9 +89,11 @@ files:
89
89
  - features/brazenhead.feature
90
90
  - features/exception.feature
91
91
  - features/robotium.feature
92
+ - features/serialization.feature
92
93
  - features/step_definitions/brazenhead_steps.rb
93
94
  - features/step_definitions/exception_steps.rb
94
95
  - features/step_definitions/robotium_steps.rb
96
+ - features/step_definitions/serialization_steps.rb
95
97
  - features/step_definitions/string_ids_steps.rb
96
98
  - features/strings_ids.feature
97
99
  - features/support/ApiDemos.apk
@@ -135,18 +137,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
137
  - - ! '>='
136
138
  - !ruby/object:Gem::Version
137
139
  version: '0'
138
- segments:
139
- - 0
140
- hash: -501269856312341157
141
140
  required_rubygems_version: !ruby/object:Gem::Requirement
142
141
  none: false
143
142
  requirements:
144
143
  - - ! '>='
145
144
  - !ruby/object:Gem::Version
146
145
  version: '0'
147
- segments:
148
- - 0
149
- hash: -501269856312341157
150
146
  requirements: []
151
147
  rubyforge_project:
152
148
  rubygems_version: 1.8.24
@@ -158,9 +154,11 @@ test_files:
158
154
  - features/brazenhead.feature
159
155
  - features/exception.feature
160
156
  - features/robotium.feature
157
+ - features/serialization.feature
161
158
  - features/step_definitions/brazenhead_steps.rb
162
159
  - features/step_definitions/exception_steps.rb
163
160
  - features/step_definitions/robotium_steps.rb
161
+ - features/step_definitions/serialization_steps.rb
164
162
  - features/step_definitions/string_ids_steps.rb
165
163
  - features/strings_ids.feature
166
164
  - features/support/ApiDemos.apk