calios-uikit-extension 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/calios-uikit-extension/ui_base.rb +12 -7
- data/lib/calios-uikit-extension/ui_button.rb +5 -0
- data/spec/spec_ui_button.rb +40 -0
- data/spec/spec_ui_collection_view.rb +18 -0
- data/spec/spec_ui_collection_view_cell.rb +18 -0
- data/spec/spec_ui_label.rb +18 -0
- data/spec/spec_ui_switch.rb +18 -0
- data/spec/spec_ui_table_view.rb +18 -0
- data/spec/spec_ui_table_view_cell.rb +18 -0
- data/spec/spec_ui_text_field.rb +18 -0
- data/spec/spec_ui_view.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3375efdd73faa47a7295a0795bc66e0d32eded4e
|
4
|
+
data.tar.gz: 7dfa12fbd09ea2c94978da490ecf2145fb6763b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489d829a460e8bb82a334acb6b04b5834bc3572cd05e4d670782f2ffd2e3ac66540701bfd13e469b86ebd65a60c9fe28e5bf24ad28075b4098badc77055cae59
|
7
|
+
data.tar.gz: d692651284a26a25006ab1e93c23e92b80f18d053d24cd26499680a349aab483f72fd20454c9d79245054c3fa16dd4d8df80bdfd0f53c3983df4a246d6941e49
|
@@ -6,6 +6,18 @@ class UIBase
|
|
6
6
|
name
|
7
7
|
end
|
8
8
|
|
9
|
+
def property(*aParams)
|
10
|
+
Calabash::Cucumber::Core.query(self.class_name, *aParams)
|
11
|
+
end
|
12
|
+
|
13
|
+
alias_method :prop, :property
|
14
|
+
alias_method :p, :property
|
15
|
+
|
16
|
+
def enabled?(aIdOrIndex=nil)
|
17
|
+
q = self.parse_query(aIdOrIndex)
|
18
|
+
Calabash::Cucumber::Core.query(q, :isEnabled).first.to_boolean
|
19
|
+
end
|
20
|
+
|
9
21
|
def touch(aIdOrIndex=nil)
|
10
22
|
q = self.parse_query(aIdOrIndex)
|
11
23
|
Calabash::Cucumber::Core.touch(q)
|
@@ -18,13 +30,6 @@ class UIBase
|
|
18
30
|
Calabash::Cucumber::Core.double_tap(q)
|
19
31
|
end
|
20
32
|
|
21
|
-
def property(*aParams)
|
22
|
-
Calabash::Cucumber::Core.query(self.class_name, *aParams)
|
23
|
-
end
|
24
|
-
|
25
|
-
alias_method :prop, :property
|
26
|
-
alias_method :p, :property
|
27
|
-
|
28
33
|
def query(aIdOrIndex=nil)
|
29
34
|
q = parse_query(aIdOrIndex)
|
30
35
|
Calabash::Cucumber::Core.query(q)
|
data/spec/spec_ui_button.rb
CHANGED
@@ -35,6 +35,28 @@ class SpecUIButton < Minitest::Spec
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
describe 'UIButton.selected?' do
|
39
|
+
it 'should call Calabash query method with correct parameters' do
|
40
|
+
$stub_query_response = [false, true]
|
41
|
+
ret = UIButton.selected?
|
42
|
+
ret.must_equal(false)
|
43
|
+
$uiquery.must_equal("#{UIButton.class_name}")
|
44
|
+
$args.first.must_equal(:isSelected)
|
45
|
+
|
46
|
+
$stub_query_response = [false, true]
|
47
|
+
ret = UIButton.selected?(0)
|
48
|
+
ret.must_equal(false)
|
49
|
+
$uiquery.must_equal("#{UIButton.class_name} index:0")
|
50
|
+
$args.first.must_equal(:isSelected)
|
51
|
+
|
52
|
+
$stub_query_response = [true, false]
|
53
|
+
ret = UIButton.selected?('myId')
|
54
|
+
ret.must_equal(true)
|
55
|
+
$uiquery.must_equal("#{UIButton.class_name} marked:'myId'")
|
56
|
+
$args.first.must_equal(:isSelected)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
38
60
|
describe 'UIButton.touch and aliases' do
|
39
61
|
it 'should call Calabash touch method with correct parameters' do
|
40
62
|
UIButton.touch
|
@@ -109,5 +131,23 @@ class SpecUIButton < Minitest::Spec
|
|
109
131
|
$args.first.must_equal(:accessibilityIdentifier)
|
110
132
|
end
|
111
133
|
end
|
134
|
+
|
135
|
+
describe 'UIButton.enabled?' do
|
136
|
+
it 'should call Calabash query method with correct parameters' do
|
137
|
+
$stub_query_response = [true, false]
|
138
|
+
|
139
|
+
UIButton.enabled?.must_equal(true)
|
140
|
+
$uiquery.must_equal("#{UIButton.class_name}")
|
141
|
+
$args.first.must_equal(:isEnabled)
|
142
|
+
|
143
|
+
UIButton.enabled?(0).must_equal(true)
|
144
|
+
$uiquery.must_equal("#{UIButton.class_name} index:0")
|
145
|
+
$args.first.must_equal(:isEnabled)
|
146
|
+
|
147
|
+
UIButton.enabled?('myId').must_equal(true)
|
148
|
+
$uiquery.must_equal("#{UIButton.class_name} marked:'myId'")
|
149
|
+
$args.first.must_equal(:isEnabled)
|
150
|
+
end
|
151
|
+
end
|
112
152
|
end
|
113
153
|
end
|
@@ -153,5 +153,23 @@ class SpecUICollectionView < Minitest::Spec
|
|
153
153
|
$args.first.must_equal(:accessibilityIdentifier)
|
154
154
|
end
|
155
155
|
end
|
156
|
+
|
157
|
+
describe 'UICollectionView.enabled?' do
|
158
|
+
it 'should call Calabash query method with correct parameters' do
|
159
|
+
$stub_query_response = [true, false]
|
160
|
+
|
161
|
+
UICollectionView.enabled?.must_equal(true)
|
162
|
+
$uiquery.must_equal("#{UICollectionView.class_name}")
|
163
|
+
$args.first.must_equal(:isEnabled)
|
164
|
+
|
165
|
+
UICollectionView.enabled?(0).must_equal(true)
|
166
|
+
$uiquery.must_equal("#{UICollectionView.class_name} index:0")
|
167
|
+
$args.first.must_equal(:isEnabled)
|
168
|
+
|
169
|
+
UICollectionView.enabled?('myId').must_equal(true)
|
170
|
+
$uiquery.must_equal("#{UICollectionView.class_name} marked:'myId'")
|
171
|
+
$args.first.must_equal(:isEnabled)
|
172
|
+
end
|
173
|
+
end
|
156
174
|
end
|
157
175
|
end
|
@@ -113,5 +113,23 @@ class SpecUICollectionViewCell < Minitest::Spec
|
|
113
113
|
$args.first.must_equal(:accessibilityIdentifier)
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
describe 'UICollectionView.enabled?' do
|
118
|
+
it 'should call Calabash query method with correct parameters' do
|
119
|
+
$stub_query_response = [true, false]
|
120
|
+
|
121
|
+
UICollectionViewCell.enabled?.must_equal(true)
|
122
|
+
$uiquery.must_equal("#{UICollectionViewCell.class_name}")
|
123
|
+
$args.first.must_equal(:isEnabled)
|
124
|
+
|
125
|
+
UICollectionViewCell.enabled?(0).must_equal(true)
|
126
|
+
$uiquery.must_equal("#{UICollectionViewCell.class_name} index:0")
|
127
|
+
$args.first.must_equal(:isEnabled)
|
128
|
+
|
129
|
+
UICollectionViewCell.enabled?('myId').must_equal(true)
|
130
|
+
$uiquery.must_equal("#{UICollectionViewCell.class_name} marked:'myId'")
|
131
|
+
$args.first.must_equal(:isEnabled)
|
132
|
+
end
|
133
|
+
end
|
116
134
|
end
|
117
135
|
end
|
data/spec/spec_ui_label.rb
CHANGED
@@ -109,5 +109,23 @@ class SpecUILabel < Minitest::Spec
|
|
109
109
|
$args.first.must_equal(:accessibilityIdentifier)
|
110
110
|
end
|
111
111
|
end
|
112
|
+
|
113
|
+
describe 'UILabel.enabled?' do
|
114
|
+
it 'should call Calabash query method with correct parameters' do
|
115
|
+
$stub_query_response = [true, false]
|
116
|
+
|
117
|
+
UILabel.enabled?.must_equal(true)
|
118
|
+
$uiquery.must_equal("#{UILabel.class_name}")
|
119
|
+
$args.first.must_equal(:isEnabled)
|
120
|
+
|
121
|
+
UILabel.enabled?(0).must_equal(true)
|
122
|
+
$uiquery.must_equal("#{UILabel.class_name} index:0")
|
123
|
+
$args.first.must_equal(:isEnabled)
|
124
|
+
|
125
|
+
UILabel.enabled?('myId').must_equal(true)
|
126
|
+
$uiquery.must_equal("#{UILabel.class_name} marked:'myId'")
|
127
|
+
$args.first.must_equal(:isEnabled)
|
128
|
+
end
|
129
|
+
end
|
112
130
|
end
|
113
131
|
end
|
data/spec/spec_ui_switch.rb
CHANGED
@@ -113,5 +113,23 @@ class SpecUISwitch < Minitest::Spec
|
|
113
113
|
$args.first.must_equal(:accessibilityIdentifier)
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
describe 'UISwitch.enabled?' do
|
118
|
+
it 'should call Calabash query method with correct parameters' do
|
119
|
+
$stub_query_response = [true, false]
|
120
|
+
|
121
|
+
UISwitch.enabled?.must_equal(true)
|
122
|
+
$uiquery.must_equal("#{UISwitch.class_name}")
|
123
|
+
$args.first.must_equal(:isEnabled)
|
124
|
+
|
125
|
+
UISwitch.enabled?(0).must_equal(true)
|
126
|
+
$uiquery.must_equal("#{UISwitch.class_name} index:0")
|
127
|
+
$args.first.must_equal(:isEnabled)
|
128
|
+
|
129
|
+
UISwitch.enabled?('myId').must_equal(true)
|
130
|
+
$uiquery.must_equal("#{UISwitch.class_name} marked:'myId'")
|
131
|
+
$args.first.must_equal(:isEnabled)
|
132
|
+
end
|
133
|
+
end
|
116
134
|
end
|
117
135
|
end
|
data/spec/spec_ui_table_view.rb
CHANGED
@@ -103,5 +103,23 @@ class SpecUITableView < Minitest::Spec
|
|
103
103
|
$args.first.must_equal(:accessibilityIdentifier)
|
104
104
|
end
|
105
105
|
end
|
106
|
+
|
107
|
+
describe 'UITableView.enabled?' do
|
108
|
+
it 'should call Calabash query method with correct parameters' do
|
109
|
+
$stub_query_response = [true, false]
|
110
|
+
|
111
|
+
UITableView.enabled?.must_equal(true)
|
112
|
+
$uiquery.must_equal("#{UITableView.class_name}")
|
113
|
+
$args.first.must_equal(:isEnabled)
|
114
|
+
|
115
|
+
UITableView.enabled?(0).must_equal(true)
|
116
|
+
$uiquery.must_equal("#{UITableView.class_name} index:0")
|
117
|
+
$args.first.must_equal(:isEnabled)
|
118
|
+
|
119
|
+
UITableView.enabled?('myId').must_equal(true)
|
120
|
+
$uiquery.must_equal("#{UITableView.class_name} marked:'myId'")
|
121
|
+
$args.first.must_equal(:isEnabled)
|
122
|
+
end
|
123
|
+
end
|
106
124
|
end
|
107
125
|
end
|
@@ -115,5 +115,23 @@ class SpecUITableViewCell < Minitest::Spec
|
|
115
115
|
$args.first.must_equal(:accessibilityIdentifier)
|
116
116
|
end
|
117
117
|
end
|
118
|
+
|
119
|
+
describe 'UITableViewCell.enabled?' do
|
120
|
+
it 'should call Calabash query method with correct parameters' do
|
121
|
+
$stub_query_response = [true, false]
|
122
|
+
|
123
|
+
UITableViewCell.enabled?.must_equal(true)
|
124
|
+
$uiquery.must_equal("#{UITableViewCell.class_name}")
|
125
|
+
$args.first.must_equal(:isEnabled)
|
126
|
+
|
127
|
+
UITableViewCell.enabled?(0).must_equal(true)
|
128
|
+
$uiquery.must_equal("#{UITableViewCell.class_name} index:0")
|
129
|
+
$args.first.must_equal(:isEnabled)
|
130
|
+
|
131
|
+
UITableViewCell.enabled?('myId').must_equal(true)
|
132
|
+
$uiquery.must_equal("#{UITableViewCell.class_name} marked:'myId'")
|
133
|
+
$args.first.must_equal(:isEnabled)
|
134
|
+
end
|
135
|
+
end
|
118
136
|
end
|
119
137
|
end
|
data/spec/spec_ui_text_field.rb
CHANGED
@@ -109,5 +109,23 @@ class SpecUITextField < Minitest::Spec
|
|
109
109
|
$args.first.must_equal(:accessibilityIdentifier)
|
110
110
|
end
|
111
111
|
end
|
112
|
+
|
113
|
+
describe 'UITextField.enabled?' do
|
114
|
+
it 'should call Calabash query method with correct parameters' do
|
115
|
+
$stub_query_response = [true, false]
|
116
|
+
|
117
|
+
UITextField.enabled?.must_equal(true)
|
118
|
+
$uiquery.must_equal("#{UITextField.class_name}")
|
119
|
+
$args.first.must_equal(:isEnabled)
|
120
|
+
|
121
|
+
UITextField.enabled?(0).must_equal(true)
|
122
|
+
$uiquery.must_equal("#{UITextField.class_name} index:0")
|
123
|
+
$args.first.must_equal(:isEnabled)
|
124
|
+
|
125
|
+
UITextField.enabled?('myId').must_equal(true)
|
126
|
+
$uiquery.must_equal("#{UITextField.class_name} marked:'myId'")
|
127
|
+
$args.first.must_equal(:isEnabled)
|
128
|
+
end
|
129
|
+
end
|
112
130
|
end
|
113
131
|
end
|
data/spec/spec_ui_view.rb
CHANGED
@@ -91,5 +91,23 @@ class SpecUIView < Minitest::Spec
|
|
91
91
|
$args.first.must_equal(:accessibilityIdentifier)
|
92
92
|
end
|
93
93
|
end
|
94
|
+
|
95
|
+
describe 'UIView.enabled?' do
|
96
|
+
it 'should call Calabash query method with correct parameters' do
|
97
|
+
$stub_query_response = [true, false]
|
98
|
+
|
99
|
+
UIView.enabled?.must_equal(true)
|
100
|
+
$uiquery.must_equal("#{UIView.class_name}")
|
101
|
+
$args.first.must_equal(:isEnabled)
|
102
|
+
|
103
|
+
UIView.enabled?(0).must_equal(true)
|
104
|
+
$uiquery.must_equal("#{UIView.class_name} index:0")
|
105
|
+
$args.first.must_equal(:isEnabled)
|
106
|
+
|
107
|
+
UIView.enabled?('myId').must_equal(true)
|
108
|
+
$uiquery.must_equal("#{UIView.class_name} marked:'myId'")
|
109
|
+
$args.first.must_equal(:isEnabled)
|
110
|
+
end
|
111
|
+
end
|
94
112
|
end
|
95
113
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calios-uikit-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: calabash-cucumber
|