calios-uikit-extension 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ceae5deeeea5e86148a7c27182a7cdd642022cc0
4
- data.tar.gz: b0ed25e7c5b7d29d9b3f79edda3f3a5bf8752793
3
+ metadata.gz: 27970df601cc3730fa81e16b3f4b2e8a650508b6
4
+ data.tar.gz: 5c0b5c931f3f65b5808f996edc9cd4b42571502a
5
5
  SHA512:
6
- metadata.gz: cddc8a5f1f57d3342143e848a7015a14596e906f93ffad43d690dd97880635e344651791b3179d64b2972e269159328e7d45b4766ccb0e7676189df44605343d
7
- data.tar.gz: b17499b124e79cdc0f065186a1747b9c617b579a5a1cfc195c9ec52a4bbf1e16eb4e3f91c3d57bdfa154a317c06870916c9ea6230a747429203a78ee633e8f08
6
+ metadata.gz: 5781f5daddf3bdc1285a03af6c909bcc55569c6afb023ad9340f44f32a827e88a16a2902b75b68bc3a5a19b245805424e280d75f6015dfc7c94bcb29eb12188e
7
+ data.tar.gz: b9ae47445ff4b1706dce82d06335eced3421ab6349bbbfdffad77bd1193bda1b991d0a7b77bb6d7dbf844a47d4d954ba42ae937abfc53e1d6bae07de1a152ac9
@@ -8,6 +8,7 @@ require 'calios-uikit-extension/ui_collection_view'
8
8
  require 'calios-uikit-extension/ui_collection_view_cell'
9
9
  require 'calios-uikit-extension/ui_label'
10
10
  require 'calios-uikit-extension/ui_search_bar'
11
+ require 'calios-uikit-extension/ui_segmented_control'
11
12
  require 'calios-uikit-extension/ui_switch'
12
13
  require 'calios-uikit-extension/ui_table_view'
13
14
  require 'calios-uikit-extension/ui_table_view_cell'
@@ -0,0 +1,15 @@
1
+ require_relative 'ui_base'
2
+
3
+ class UISegmentedControl < UIBase
4
+ class << self
5
+ def number_of_segments(aIdOrIndex=nil)
6
+ q = self.parse_query(aIdOrIndex)
7
+ Calabash::Cucumber::Core.query(q, :numberOfSegments).first
8
+ end
9
+
10
+ def selected_segment_index(aIdOrIndex=nil)
11
+ q = self.parse_query(aIdOrIndex)
12
+ Calabash::Cucumber::Core.query(q, :selectedSegmentIndex).first
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,151 @@
1
+ require_relative 'spec_helper'
2
+
3
+ class SpecUISegmentedControl < Minitest::Spec
4
+ before do
5
+ $uiquery = nil
6
+ $args = nil
7
+ end
8
+
9
+ after do
10
+ # nop
11
+ end
12
+
13
+ describe 'UISegmentedControl' do
14
+ describe 'UISegmentedControl.class_name' do
15
+ it 'should return class name' do
16
+ UISegmentedControl.class_name.must_equal('UISegmentedControl')
17
+ end
18
+ end
19
+
20
+ describe 'UISegmentedControl.touch and aliases' do
21
+ it 'should call Calabash touch method with correct parameters' do
22
+ UISegmentedControl.touch
23
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
24
+
25
+ UISegmentedControl.touch(0)
26
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
27
+
28
+ UISegmentedControl.touch('myId')
29
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
30
+
31
+ UISegmentedControl.tap
32
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
33
+
34
+ UISegmentedControl.tap(0)
35
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
36
+
37
+ UISegmentedControl.tap('myId')
38
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
39
+ end
40
+ end
41
+
42
+ describe 'UISegmentedControl.double_tap' do
43
+ it 'should call Calabash double_tap method with correct parameters' do
44
+ UISegmentedControl.double_tap
45
+ $uiquery.must_equal(UISegmentedControl.class_name)
46
+
47
+ UISegmentedControl.double_tap(0)
48
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
49
+
50
+ UISegmentedControl.double_tap('myId')
51
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
52
+ end
53
+ end
54
+
55
+ describe 'UISegmentedControl.property and aliases' do
56
+ it 'should call Calabash query method with correct parameters' do
57
+ UISegmentedControl.property(:finland)
58
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
59
+ $args.first.must_equal(:finland)
60
+
61
+ UISegmentedControl.prop(:finland)
62
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
63
+ $args.first.must_equal(:finland)
64
+
65
+ UISegmentedControl.p(:finland)
66
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
67
+ $args.first.must_equal(:finland)
68
+ end
69
+ end
70
+
71
+ describe 'UISegmentedControl.accessibility_label and aliases' do
72
+ it 'should call Calabash query method with correct parameters' do
73
+ UISegmentedControl.accessibility_label
74
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
75
+ $args.first.must_equal(:accessibilityLabel)
76
+
77
+ UISegmentedControl.label
78
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
79
+ $args.first.must_equal(:accessibilityLabel)
80
+ end
81
+ end
82
+
83
+ describe 'UISegmentedControl.accessibility_identifier and aliases' do
84
+ it 'should call Calabash query method with correct parameters' do
85
+ UISegmentedControl.accessibility_identifier
86
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
87
+ $args.first.must_equal(:accessibilityIdentifier)
88
+
89
+ UISegmentedControl.identifier
90
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
91
+ $args.first.must_equal(:accessibilityIdentifier)
92
+ end
93
+ end
94
+
95
+ describe 'UISegmentedControl.enabled?' do
96
+ it 'should call Calabash query method with correct parameters' do
97
+ $stub_query_response = [true, false]
98
+
99
+ UISegmentedControl.enabled?.must_equal(true)
100
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
101
+ $args.first.must_equal(:isEnabled)
102
+
103
+ UISegmentedControl.enabled?(0).must_equal(true)
104
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
105
+ $args.first.must_equal(:isEnabled)
106
+
107
+ UISegmentedControl.enabled?('myId').must_equal(true)
108
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
109
+ $args.first.must_equal(:isEnabled)
110
+ end
111
+ end
112
+
113
+ describe 'UISegmentedControl.number_of_segments' do
114
+ it 'should call Calabash query method with correct parameters' do
115
+ $stub_query_response = [4, 6]
116
+ UISegmentedControl.number_of_segments.must_equal(4)
117
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
118
+ $args.first.must_equal(:numberOfSegments)
119
+
120
+ $stub_query_response = [5]
121
+ UISegmentedControl.number_of_segments(0).must_equal(5)
122
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
123
+ $args.first.must_equal(:numberOfSegments)
124
+
125
+ $stub_query_response = [10, 6, 7]
126
+ UISegmentedControl.number_of_segments('myId').must_equal(10)
127
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
128
+ $args.first.must_equal(:numberOfSegments)
129
+ end
130
+ end
131
+
132
+ describe 'UISegmentedControl.selected_segment_index' do
133
+ it 'should call Calabash query method with correct parameters' do
134
+ $stub_query_response = [4, 6]
135
+ UISegmentedControl.selected_segment_index.must_equal(4)
136
+ $uiquery.must_equal("#{UISegmentedControl.class_name}")
137
+ $args.first.must_equal(:selectedSegmentIndex)
138
+
139
+ $stub_query_response = [5]
140
+ UISegmentedControl.selected_segment_index(0).must_equal(5)
141
+ $uiquery.must_equal("#{UISegmentedControl.class_name} index:0")
142
+ $args.first.must_equal(:selectedSegmentIndex)
143
+
144
+ $stub_query_response = [10, 6, 7]
145
+ UISegmentedControl.selected_segment_index('myId').must_equal(10)
146
+ $uiquery.must_equal("#{UISegmentedControl.class_name} marked:'myId'")
147
+ $args.first.must_equal(:selectedSegmentIndex)
148
+ end
149
+ end
150
+ end
151
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calios-uikit-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jani Jegoroff
@@ -95,6 +95,7 @@ files:
95
95
  - lib/calios-uikit-extension/ui_collection_view_cell.rb
96
96
  - lib/calios-uikit-extension/ui_label.rb
97
97
  - lib/calios-uikit-extension/ui_search_bar.rb
98
+ - lib/calios-uikit-extension/ui_segmented_control.rb
98
99
  - lib/calios-uikit-extension/ui_switch.rb
99
100
  - lib/calios-uikit-extension/ui_table_view.rb
100
101
  - lib/calios-uikit-extension/ui_table_view_cell.rb
@@ -107,6 +108,7 @@ files:
107
108
  - spec/spec_ui_collection_view_cell.rb
108
109
  - spec/spec_ui_label.rb
109
110
  - spec/spec_ui_search_bar.rb
111
+ - spec/spec_ui_segmented_control.rb
110
112
  - spec/spec_ui_switch.rb
111
113
  - spec/spec_ui_table_view.rb
112
114
  - spec/spec_ui_table_view_cell.rb
@@ -145,6 +147,7 @@ test_files:
145
147
  - spec/spec_ui_collection_view_cell.rb
146
148
  - spec/spec_ui_label.rb
147
149
  - spec/spec_ui_search_bar.rb
150
+ - spec/spec_ui_segmented_control.rb
148
151
  - spec/spec_ui_switch.rb
149
152
  - spec/spec_ui_table_view.rb
150
153
  - spec/spec_ui_table_view_cell.rb