gametel 0.5.9.1 → 0.5.9.2

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.
@@ -32,11 +32,16 @@ Feature: Interacting with the standard text field
32
32
  When I'm on the search view filter screen
33
33
  Then I am am given the description "Edit Description" for the "text_field_id" control
34
34
 
35
- Scenario: Retrieving text identified by index
35
+ Scenario: Retrieving text identified by id
36
36
  Given I'm on the controls screen
37
37
  When I enter "example text" into the text field identified by "id"
38
38
  Then I should have the value "example text" in the text field identified by "id"
39
39
 
40
+ Scenario: Retrieving text identified by index
41
+ Given I'm on the controls screen
42
+ When I enter "example text" into the text field identified by "index"
43
+ Then I should have the value "example text" in the text field identified by "index"
44
+
40
45
  Scenario: Determining if a text view is enabled
41
46
  When I'm on the controls screen
42
47
  Then the "text" field's "enabled" property is "true"
@@ -11,6 +11,13 @@ module Gametel
11
11
  end
12
12
  end
13
13
 
14
+ def get_text_by_index(index)
15
+ get_view_by_index('android.widget.EditText', index) do |device|
16
+ device.get_text
17
+ device.to_string
18
+ end
19
+ end
20
+
14
21
  def enter_text_by_id(id, text)
15
22
  get_view_by_id(id) do |device|
16
23
  device.enter_text '@@the_view@@', text, :target => 'Robotium'
@@ -26,7 +26,8 @@ module Gametel
26
26
  # get text
27
27
  #
28
28
  def get_text(locator)
29
- result = get_text_by_id(locator[:id])
29
+ result = get_text_by_id(locator[:id]) if locator[:id]
30
+ result = get_text_by_index(locator[:index]) if locator[:index]
30
31
  last_json
31
32
  end
32
33
 
@@ -1,3 +1,3 @@
1
1
  module Gametel
2
- VERSION = "0.5.9.1"
2
+ VERSION = "0.5.9.2"
3
3
  end
@@ -112,6 +112,16 @@ describe Gametel::Accessors do
112
112
  screen.first_name_id.should eq('the value')
113
113
  end
114
114
 
115
+ it "should know how to get text by index" do
116
+ accumulator.should_receive(:get_class)
117
+ accumulator.should_receive(:for_name).with('android.widget.EditText', :variable => '@@the_type@@')
118
+ accumulator.should_receive(:get_view).with('@@the_type@@', 2, :target => 'Robotium', :variable => '@@the_view@@')
119
+ accumulator.should_receive(:get_text)
120
+ accumulator.should_receive(:to_string)
121
+ device.should_receive(:last_json).and_return('the indexed text')
122
+ screen.first_name_index.should eq('the indexed text')
123
+ end
124
+
115
125
  it "should know how to get the hint text" do
116
126
  accumulator.should_receive(:id_from_name)
117
127
  accumulator.should_receive(:get_view)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gametel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9.1
4
+ version: 0.5.9.2
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: 2013-04-08 00:00:00.000000000 Z
13
+ date: 2013-04-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: brazenhead