calandroid-widget-extension 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b412bb1da2eb93040f34e4f265703876dee8b3b2
4
- data.tar.gz: 218415cd0322ab6244d4b04db1f6ec6a95ae9eff
3
+ metadata.gz: cde1f524cebde67d65e3eed57f968a774eac67fb
4
+ data.tar.gz: e7808a091d5dd562352d614e7c09281b8e78b120
5
5
  SHA512:
6
- metadata.gz: 4490ba1d15244f5b3b365a9ebd836f1e6ea6b69d716cf1d6e09842d3336e63196e1c107b51bcdfcee215ba6e0e02138b82e762e6ea76e8e5b136b17150d6c71d
7
- data.tar.gz: 3c33dc4d8aecce23a516b2520ad04c14e1cb0a60cb6f28287e667650be69c344a8671604d542324578c06220756a5f2fbdf1f52c4859c3c62224efe6dd3ebe42
6
+ metadata.gz: f3cf2f6b28aad7ca4e78ad2ca31b2a8840a4e5be8f2cc29455642903cfd185d70b7125d5e434053fdb76f15d61df32fd646976831e9c2a1fe3167cf2b661192b
7
+ data.tar.gz: 2e9ed7ca4312b49d3556f914c79a345ebac6893df700d35eb1115d219427fa76df6c687e4f61cce61a30d840ede71667a64b904ad17e8296f1d05bf5a4e6e1b0
@@ -2,7 +2,12 @@ require 'calabash-android/operations'
2
2
 
3
3
  require 'to_boolean'
4
4
 
5
+ require 'calandroid-widget-extension/version'
6
+
5
7
  require 'calandroid-widget-extension/base'
6
8
  require 'calandroid-widget-extension/button'
9
+ require 'calandroid-widget-extension/frame_layout'
10
+ require 'calandroid-widget-extension/image_button'
11
+ require 'calandroid-widget-extension/linear_layout'
7
12
  require 'calandroid-widget-extension/list_view'
8
13
  require 'calandroid-widget-extension/text_view'
@@ -0,0 +1,7 @@
1
+ require_relative 'base'
2
+
3
+ class FrameLayout < Base
4
+ class << self
5
+ # Nothing here yet
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'base'
2
+
3
+ class ImageButton < Base
4
+ class << self
5
+ def selected?(aIdOrIndex=nil)
6
+ q = self.parse_query(aIdOrIndex)
7
+ Calabash::Android::Operations.query(q, :selected).first.to_boolean
8
+ end
9
+
10
+ def activated?(aIdOrIndex=nil)
11
+ q = self.parse_query(aIdOrIndex)
12
+ Calabash::Android::Operations.query(q, :activated).first.to_boolean
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ require_relative 'base'
2
+
3
+ class LinearLayout < Base
4
+ class << self
5
+ # Nothing here yet
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module CalandroidWidgetExtension
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,66 @@
1
+ require_relative 'spec_helper'
2
+
3
+ class SpecFrameLayout < Minitest::Spec
4
+ before do
5
+ $uiquery = nil
6
+ $args = nil
7
+ end
8
+
9
+ after do
10
+ # nop
11
+ end
12
+
13
+ describe 'FrameLayout' do
14
+ describe 'FrameLayout.class_name' do
15
+ it 'should return class name' do
16
+ FrameLayout.class_name.must_equal('FrameLayout')
17
+ end
18
+ end
19
+
20
+ describe 'FrameLayout.touch and aliases' do
21
+ it 'should call Calabash touch method with correct parameters' do
22
+ FrameLayout.touch
23
+ $uiquery.must_equal("#{FrameLayout.class_name}")
24
+
25
+ FrameLayout.touch(0)
26
+ $uiquery.must_equal("#{FrameLayout.class_name} index:0")
27
+
28
+ FrameLayout.touch('myId')
29
+ $uiquery.must_equal("#{FrameLayout.class_name} marked:'myId'")
30
+
31
+ FrameLayout.tap
32
+ $uiquery.must_equal("#{FrameLayout.class_name}")
33
+
34
+ FrameLayout.tap(0)
35
+ $uiquery.must_equal("#{FrameLayout.class_name} index:0")
36
+
37
+ FrameLayout.tap('myId')
38
+ $uiquery.must_equal("#{FrameLayout.class_name} marked:'myId'")
39
+ end
40
+ end
41
+
42
+ describe 'FrameLayout.property and aliases' do
43
+ it 'should call Calabash query method with correct parameters' do
44
+ FrameLayout.property(:finland)
45
+ $uiquery.must_equal("#{FrameLayout.class_name}")
46
+ $args.first.must_equal(:finland)
47
+
48
+ FrameLayout.prop(:finland)
49
+ $uiquery.must_equal("#{FrameLayout.class_name}")
50
+ $args.first.must_equal(:finland)
51
+
52
+ FrameLayout.p(:finland)
53
+ $uiquery.must_equal("#{FrameLayout.class_name}")
54
+ $args.first.must_equal(:finland)
55
+ end
56
+ end
57
+
58
+ describe 'FrameLayout.id' do
59
+ it 'should call Calabash query method with correct parameters' do
60
+ FrameLayout.id
61
+ $uiquery.must_equal("#{FrameLayout.class_name}")
62
+ $args.first.must_equal(:id)
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,110 @@
1
+ require_relative 'spec_helper'
2
+
3
+ class SpecImageButton < Minitest::Spec
4
+ before do
5
+ $uiquery = nil
6
+ $args = nil
7
+ end
8
+
9
+ after do
10
+ # nop
11
+ end
12
+
13
+ describe 'ImageButton' do
14
+ describe 'ImageButton.class_name' do
15
+ it 'should return class name' do
16
+ ImageButton.class_name.must_equal('ImageButton')
17
+ end
18
+ end
19
+
20
+ describe 'ImageButton.selected?' do
21
+ it 'should call Calabash query method with correct parameters' do
22
+ $stub_query_response = [false, true]
23
+ ret = ImageButton.selected?
24
+ ret.must_equal(false)
25
+ $uiquery.must_equal("#{ImageButton.class_name}")
26
+ $args.first.must_equal(:selected)
27
+
28
+ $stub_query_response = [false, true]
29
+ ret = ImageButton.selected?(0)
30
+ ret.must_equal(false)
31
+ $uiquery.must_equal("#{ImageButton.class_name} index:0")
32
+ $args.first.must_equal(:selected)
33
+
34
+ $stub_query_response = [true, false]
35
+ ret = ImageButton.selected?('myId')
36
+ ret.must_equal(true)
37
+ $uiquery.must_equal("#{ImageButton.class_name} marked:'myId'")
38
+ $args.first.must_equal(:selected)
39
+ end
40
+ end
41
+
42
+ describe 'ImageButton.activated?' do
43
+ it 'should call Calabash query method with correct parameters' do
44
+ $stub_query_response = [false, true]
45
+ ret = ImageButton.activated?
46
+ ret.must_equal(false)
47
+ $uiquery.must_equal("#{ImageButton.class_name}")
48
+ $args.first.must_equal(:activated)
49
+
50
+ $stub_query_response = [false, true]
51
+ ret = ImageButton.activated?(0)
52
+ ret.must_equal(false)
53
+ $uiquery.must_equal("#{ImageButton.class_name} index:0")
54
+ $args.first.must_equal(:activated)
55
+
56
+ $stub_query_response = [true, false]
57
+ ret = ImageButton.activated?('myId')
58
+ ret.must_equal(true)
59
+ $uiquery.must_equal("#{ImageButton.class_name} marked:'myId'")
60
+ $args.first.must_equal(:activated)
61
+ end
62
+ end
63
+
64
+ describe 'ImageButton.touch and aliases' do
65
+ it 'should call Calabash touch method with correct parameters' do
66
+ ImageButton.touch
67
+ $uiquery.must_equal("#{ImageButton.class_name}")
68
+
69
+ ImageButton.touch(0)
70
+ $uiquery.must_equal("#{ImageButton.class_name} index:0")
71
+
72
+ ImageButton.touch('myId')
73
+ $uiquery.must_equal("#{ImageButton.class_name} marked:'myId'")
74
+
75
+ ImageButton.tap
76
+ $uiquery.must_equal("#{ImageButton.class_name}")
77
+
78
+ ImageButton.tap(0)
79
+ $uiquery.must_equal("#{ImageButton.class_name} index:0")
80
+
81
+ ImageButton.tap('myId')
82
+ $uiquery.must_equal("#{ImageButton.class_name} marked:'myId'")
83
+ end
84
+ end
85
+
86
+ describe 'ImageButton.property and aliases' do
87
+ it 'should call Calabash query method with correct parameters' do
88
+ ImageButton.property(:finland)
89
+ $uiquery.must_equal("#{ImageButton.class_name}")
90
+ $args.first.must_equal(:finland)
91
+
92
+ ImageButton.prop(:finland)
93
+ $uiquery.must_equal("#{ImageButton.class_name}")
94
+ $args.first.must_equal(:finland)
95
+
96
+ ImageButton.p(:finland)
97
+ $uiquery.must_equal("#{ImageButton.class_name}")
98
+ $args.first.must_equal(:finland)
99
+ end
100
+ end
101
+
102
+ describe 'ImageButton.id' do
103
+ it 'should call Calabash query method with correct parameters' do
104
+ ImageButton.id
105
+ $uiquery.must_equal("#{ImageButton.class_name}")
106
+ $args.first.must_equal(:id)
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,66 @@
1
+ require_relative 'spec_helper'
2
+
3
+ class SpecLinearLayout < Minitest::Spec
4
+ before do
5
+ $uiquery = nil
6
+ $args = nil
7
+ end
8
+
9
+ after do
10
+ # nop
11
+ end
12
+
13
+ describe 'LinearLayout' do
14
+ describe 'LinearLayout.class_name' do
15
+ it 'should return class name' do
16
+ LinearLayout.class_name.must_equal('LinearLayout')
17
+ end
18
+ end
19
+
20
+ describe 'LinearLayout.touch and aliases' do
21
+ it 'should call Calabash touch method with correct parameters' do
22
+ LinearLayout.touch
23
+ $uiquery.must_equal("#{LinearLayout.class_name}")
24
+
25
+ LinearLayout.touch(0)
26
+ $uiquery.must_equal("#{LinearLayout.class_name} index:0")
27
+
28
+ LinearLayout.touch('myId')
29
+ $uiquery.must_equal("#{LinearLayout.class_name} marked:'myId'")
30
+
31
+ LinearLayout.tap
32
+ $uiquery.must_equal("#{LinearLayout.class_name}")
33
+
34
+ LinearLayout.tap(0)
35
+ $uiquery.must_equal("#{LinearLayout.class_name} index:0")
36
+
37
+ LinearLayout.tap('myId')
38
+ $uiquery.must_equal("#{LinearLayout.class_name} marked:'myId'")
39
+ end
40
+ end
41
+
42
+ describe 'LinearLayout.property and aliases' do
43
+ it 'should call Calabash query method with correct parameters' do
44
+ LinearLayout.property(:finland)
45
+ $uiquery.must_equal("#{LinearLayout.class_name}")
46
+ $args.first.must_equal(:finland)
47
+
48
+ LinearLayout.prop(:finland)
49
+ $uiquery.must_equal("#{LinearLayout.class_name}")
50
+ $args.first.must_equal(:finland)
51
+
52
+ LinearLayout.p(:finland)
53
+ $uiquery.must_equal("#{LinearLayout.class_name}")
54
+ $args.first.must_equal(:finland)
55
+ end
56
+ end
57
+
58
+ describe 'LinearLayout.id' do
59
+ it 'should call Calabash query method with correct parameters' do
60
+ LinearLayout.id
61
+ $uiquery.must_equal("#{LinearLayout.class_name}")
62
+ $args.first.must_equal(:id)
63
+ end
64
+ end
65
+ end
66
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calandroid-widget-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jani Jegoroff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-18 00:00:00.000000000 Z
11
+ date: 2014-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: calabash-android
@@ -91,11 +91,18 @@ files:
91
91
  - lib/calandroid-widget-extension.rb
92
92
  - lib/calandroid-widget-extension/base.rb
93
93
  - lib/calandroid-widget-extension/button.rb
94
+ - lib/calandroid-widget-extension/frame_layout.rb
95
+ - lib/calandroid-widget-extension/image_button.rb
96
+ - lib/calandroid-widget-extension/linear_layout.rb
94
97
  - lib/calandroid-widget-extension/list_view.rb
95
98
  - lib/calandroid-widget-extension/text_view.rb
99
+ - lib/calandroid-widget-extension/version.rb
96
100
  - spec/spec_base.rb
97
101
  - spec/spec_button.rb
102
+ - spec/spec_frame_layout.rb
98
103
  - spec/spec_helper.rb
104
+ - spec/spec_image_button.rb
105
+ - spec/spec_linear_layout.rb
99
106
  - spec/spec_list_view.rb
100
107
  - spec/spec_text_view.rb
101
108
  - spec/stubs/calabash_android_operations_stub.rb
@@ -126,7 +133,10 @@ summary: Calabash-android widget extension.
126
133
  test_files:
127
134
  - spec/spec_base.rb
128
135
  - spec/spec_button.rb
136
+ - spec/spec_frame_layout.rb
129
137
  - spec/spec_helper.rb
138
+ - spec/spec_image_button.rb
139
+ - spec/spec_linear_layout.rb
130
140
  - spec/spec_list_view.rb
131
141
  - spec/spec_text_view.rb
132
142
  - spec/stubs/calabash_android_operations_stub.rb