briar 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +6 -11
- data/bin/briar +58 -0
- data/bin/briar_helpers.rb +28 -2
- data/briar.gemspec +3 -2
- data/features/step_definitions/alerts_and_sheets/action_sheet_steps.rb +10 -4
- data/features/step_definitions/alerts_and_sheets/alert_view_steps.rb +3 -10
- data/features/step_definitions/bars/navbar_steps.rb +1 -9
- data/features/step_definitions/bars/tabbar_steps.rb +2 -4
- data/features/step_definitions/bars/toolbar_steps.rb +2 -11
- data/features/step_definitions/control/button_steps.rb +3 -8
- data/features/step_definitions/control/segmented_control_steps.rb +20 -58
- data/features/step_definitions/email_steps.rb +10 -7
- data/features/step_definitions/keyboard_steps.rb +7 -2
- data/features/step_definitions/picker/date_picker_steps.rb +21 -177
- data/features/step_definitions/table_steps.rb +35 -71
- data/features/step_definitions/text_field_steps.rb +1 -5
- data/features/step_definitions/text_view_steps.rb +2 -2
- data/install-calabash-framework.sh.example +10 -0
- data/lib/briar.rb +31 -5
- data/lib/briar/alerts_and_sheets/action_sheet.rb +99 -0
- data/lib/briar/alerts_and_sheets/alert_view.rb +25 -4
- data/lib/briar/bars/navbar.rb +30 -19
- data/lib/briar/bars/tabbar.rb +7 -4
- data/lib/briar/bars/toolbar.rb +14 -1
- data/lib/briar/briar_core.rb +46 -15
- data/lib/briar/control/button.rb +35 -1
- data/lib/briar/control/segmented_control.rb +69 -8
- data/lib/briar/control/slider.rb +2 -2
- data/lib/briar/cucumber.rb +3 -1
- data/lib/briar/email.rb +19 -13
- data/lib/briar/keyboard.rb +50 -10
- data/lib/briar/label.rb +20 -0
- data/lib/briar/picker/date_picker.rb +88 -584
- data/lib/briar/picker/date_picker_core.rb +293 -0
- data/lib/briar/picker/date_picker_manipulation.rb +255 -0
- data/lib/briar/picker/picker.rb +10 -0
- data/lib/briar/table.rb +261 -93
- data/lib/briar/version.rb +1 -1
- data/spec/spec_helper.rb +0 -2
- metadata +14 -13
- data/lib/briar/gestalt.rb +0 -87
- data/spec/briar/gestalt_spec.rb +0 -66
data/lib/briar/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: briar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Moody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: calabash-cucumber
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.9.151
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.9.151
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 10.0
|
33
|
+
version: 10.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 10.0
|
40
|
+
version: 10.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,7 +134,9 @@ files:
|
|
134
134
|
- features/support/env.rb
|
135
135
|
- features/support/hooks.rb
|
136
136
|
- features/support/launch.rb
|
137
|
+
- install-calabash-framework.sh.example
|
137
138
|
- lib/briar.rb
|
139
|
+
- lib/briar/alerts_and_sheets/action_sheet.rb
|
138
140
|
- lib/briar/alerts_and_sheets/alert_view.rb
|
139
141
|
- lib/briar/bars/navbar.rb
|
140
142
|
- lib/briar/bars/tabbar.rb
|
@@ -146,11 +148,12 @@ files:
|
|
146
148
|
- lib/briar/control/slider.rb
|
147
149
|
- lib/briar/cucumber.rb
|
148
150
|
- lib/briar/email.rb
|
149
|
-
- lib/briar/gestalt.rb
|
150
151
|
- lib/briar/image_view.rb
|
151
152
|
- lib/briar/keyboard.rb
|
152
153
|
- lib/briar/label.rb
|
153
154
|
- lib/briar/picker/date_picker.rb
|
155
|
+
- lib/briar/picker/date_picker_core.rb
|
156
|
+
- lib/briar/picker/date_picker_manipulation.rb
|
154
157
|
- lib/briar/picker/picker.rb
|
155
158
|
- lib/briar/picker/picker_shared.rb
|
156
159
|
- lib/briar/scroll_view.rb
|
@@ -159,7 +162,6 @@ files:
|
|
159
162
|
- lib/briar/text_view.rb
|
160
163
|
- lib/briar/version.rb
|
161
164
|
- run-tests.sh
|
162
|
-
- spec/briar/gestalt_spec.rb
|
163
165
|
- spec/spec_helper.rb
|
164
166
|
homepage: https://github.com/jmoody/briar
|
165
167
|
licenses:
|
@@ -181,10 +183,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
183
|
version: '0'
|
182
184
|
requirements: []
|
183
185
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.0.
|
186
|
+
rubygems_version: 2.0.7
|
185
187
|
signing_key:
|
186
188
|
specification_version: 4
|
187
|
-
summary: briar-0.0.
|
189
|
+
summary: briar-0.0.8
|
188
190
|
test_files:
|
189
191
|
- features/step_definitions/alerts_and_sheets/action_sheet_steps.rb
|
190
192
|
- features/step_definitions/alerts_and_sheets/alert_view_steps.rb
|
@@ -208,5 +210,4 @@ test_files:
|
|
208
210
|
- features/support/env.rb
|
209
211
|
- features/support/hooks.rb
|
210
212
|
- features/support/launch.rb
|
211
|
-
- spec/briar/gestalt_spec.rb
|
212
213
|
- spec/spec_helper.rb
|
data/lib/briar/gestalt.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
module Briar
|
4
|
-
GESTALT_IPHONE = 'iPhone'
|
5
|
-
GESTALT_IPAD = 'iPad'
|
6
|
-
GESTALT_IPHONE5 = 'Retina 4-inch'
|
7
|
-
GESTALT_SIM_SYS = 'x86_64'
|
8
|
-
GESTALT_IPOD = 'iPod'
|
9
|
-
|
10
|
-
|
11
|
-
class Gestalt
|
12
|
-
|
13
|
-
attr_reader :device_family
|
14
|
-
attr_reader :simulator_details, :ios_version
|
15
|
-
attr_reader :system
|
16
|
-
attr_reader :framework_version
|
17
|
-
|
18
|
-
def initialize (json)
|
19
|
-
ht = JSON.parse json
|
20
|
-
simulator_device = ht['simulator_device']
|
21
|
-
@system = ht['system']
|
22
|
-
@device_family = @system.eql?(GESTALT_SIM_SYS) ? simulator_device : @system.split(/[\d,.]/).first
|
23
|
-
@simulator_details = ht['simulator']
|
24
|
-
@ios_version = ht['iOS_version']
|
25
|
-
@framework_version = ht['version']
|
26
|
-
end
|
27
|
-
|
28
|
-
def is_simulator?
|
29
|
-
self.system.eql?(GESTALT_SIM_SYS)
|
30
|
-
end
|
31
|
-
|
32
|
-
def is_device?
|
33
|
-
not self.is_simulator?
|
34
|
-
end
|
35
|
-
|
36
|
-
def is_iphone?
|
37
|
-
self.device_family.eql? GESTALT_IPHONE
|
38
|
-
end
|
39
|
-
|
40
|
-
def is_ipod?
|
41
|
-
self.device_family.eql? GESTALT_IPOD
|
42
|
-
end
|
43
|
-
|
44
|
-
def is_ipad?
|
45
|
-
self.device_family.eql? GESTALT_IPAD
|
46
|
-
end
|
47
|
-
|
48
|
-
def is_iphone_5?
|
49
|
-
return self.simulator_details.split(/[(),]/)[3].eql? GESTALT_IPHONE5 if self.is_simulator?
|
50
|
-
return self.system.split(/[\D]/).delete_if { |x| x.eql?('') }.first.eql?('5') if self.is_device?
|
51
|
-
end
|
52
|
-
|
53
|
-
def version_hash (version_str)
|
54
|
-
tokens = version_str.split(/[,.]/)
|
55
|
-
{:major_version => tokens[0],
|
56
|
-
:minor_version => tokens[1],
|
57
|
-
:bug_version => tokens[2]}
|
58
|
-
end
|
59
|
-
|
60
|
-
def ios_major_version
|
61
|
-
self.version_hash(self.ios_version)[:major_version]
|
62
|
-
end
|
63
|
-
|
64
|
-
def is_ios6?
|
65
|
-
self.version_hash(self.ios_version)[:major_version].eql?('6')
|
66
|
-
end
|
67
|
-
|
68
|
-
def is_ios5?
|
69
|
-
self.version_hash(self.ios_version)[:major_version].eql?('5')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
#{"outcome":"SUCCESS","app_name":"Rise Up CAL","iOS_version":"5.1.1","app_version":"1.0","system":"iPad1,1","app_id":"org.recoverywarrriors.RiseUp-cal","version":"0.9.125"}=> true
|
75
|
-
|
76
|
-
# "iPhone Simulator 358.4, iPhone OS 6.0 (iPhone (Retina 4-inch)\/10A403)".split(/[(),]/)
|
77
|
-
# => ["iPhone Simulator 358.4", " iPhone OS 6.0 ", "iPhone ", "Retina 4-inch", "/10A403"]
|
78
|
-
|
79
|
-
# system ("curl --insecure #{url}")
|
80
|
-
# {"outcome":"SUCCESS","app_name":"Rise Up CAL","simulator_device":"iPhone","iOS_version":"6.0",
|
81
|
-
#"app_version":"1.0","system":"x86_64","app_id":"org.recoverywarrriors.RiseUp-cal",
|
82
|
-
#"version":"0.9.126","simulator":"iPhone Simulator 358.4, iPhone OS 6.0 (iPhone (Retina 4-inch)\/10A403)"}=> true
|
83
|
-
|
84
|
-
#{"outcome":"SUCCESS","app_name":"Rise Up CAL","iOS_version":"6.0.1","app_version":"1.0",
|
85
|
-
#"system":"iPhone4,1","app_id":"org.recoverywarrriors.RiseUp-cal","version":"0.9.125"}
|
86
|
-
|
87
|
-
|
data/spec/briar/gestalt_spec.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
require_relative './../spec_helper'
|
2
|
-
require_relative './../../lib/briar/gestalt'
|
3
|
-
|
4
|
-
module Briar
|
5
|
-
SIM__IPHONE_5__IOS_6_JSON = "{\"outcome\":\"SUCCESS\",\"app_name\":\"Rise Up CAL\",\"simulator_device\":\"iPhone\",\"iOS_version\":\"6.0\",\"app_version\":\"1.0\",\"system\":\"x86_64\", \"app_id\":\"org.recoverywarrriors.RiseUp-cal\",\"version\":\"0.9.126\", \"simulator\":\"iPhone Simulator 358.4, iPhone OS 6.0 (iPhone (Retina 4-inch)\/10A403)\"}"
|
6
|
-
DEVICE__IPHONE_4__IOS_6_JSON = "{\"outcome\":\"SUCCESS\",\"app_name\":\"Rise Up CAL\",\"iOS_version\":\"6.0.1\",\"app_version\":\"1.0\",\"system\":\"iPhone4,1\",\"app_id\":\"org.recoverywarrriors.RiseUp-cal\",\"version\":\"0.9.125\"}"
|
7
|
-
DEVICE__IPHONE_5__IOS_6_JSON = "{\"outcome\":\"SUCCESS\",\"app_name\":\"Rise Up CAL\",\"iOS_version\":\"6.0.1\",\"app_version\":\"1.0\",\"system\":\"iPhone5,0\",\"app_id\":\"org.recoverywarrriors.RiseUp-cal\",\"version\":\"0.9.125\"}"
|
8
|
-
DEVICE__IPAD1__IOS_5_JSON = "{\"outcome\":\"SUCCESS\",\"app_name\":\"Rise Up CAL\",\"iOS_version\":\"5.1.1\",\"app_version\":\"1.0\",\"system\":\"iPad1,1\",\"app_id\":\"org.recoverywarrriors.RiseUp-cal\",\"version\":\"0.9.125\"}"
|
9
|
-
|
10
|
-
describe 'Gestalt' do
|
11
|
-
before(:each) do
|
12
|
-
@sim_iphone_5_ios6 = Gestalt.new(SIM__IPHONE_5__IOS_6_JSON)
|
13
|
-
@device_iphone4_ios6 = Gestalt.new(DEVICE__IPHONE_4__IOS_6_JSON)
|
14
|
-
@device_iphone5_ios6 = Gestalt.new(DEVICE__IPHONE_5__IOS_6_JSON)
|
15
|
-
@device_ipad1_ios5 = Gestalt.new(DEVICE__IPAD1__IOS_5_JSON)
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should be able to determine ios major version' do
|
19
|
-
@sim_iphone_5_ios6.is_ios6?.should == true
|
20
|
-
@sim_iphone_5_ios6.is_ios5?.should == false
|
21
|
-
|
22
|
-
@device_iphone4_ios6.is_ios6?.should == true
|
23
|
-
@device_iphone4_ios6.is_ios5?.should == false
|
24
|
-
|
25
|
-
@device_ipad1_ios5.is_ios6?.should == false
|
26
|
-
@device_ipad1_ios5.is_ios5?.should == true
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
it 'should be able to determine if running on device or simulator' do
|
31
|
-
@sim_iphone_5_ios6.is_simulator?.should == true
|
32
|
-
@sim_iphone_5_ios6.is_device?.should == false
|
33
|
-
|
34
|
-
@device_iphone4_ios6.is_simulator?.should == false
|
35
|
-
@device_iphone4_ios6.is_device?.should == true
|
36
|
-
|
37
|
-
@device_ipad1_ios5.is_simulator?.should == false
|
38
|
-
@device_ipad1_ios5.is_device?.should == true
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
|
43
|
-
it 'should be able to determine the device family' do
|
44
|
-
@sim_iphone_5_ios6.is_iphone?.should == true
|
45
|
-
@sim_iphone_5_ios6.is_ipad?.should == false
|
46
|
-
|
47
|
-
@device_iphone4_ios6.is_iphone?.should == true
|
48
|
-
@device_iphone4_ios6.is_ipad?.should == false
|
49
|
-
|
50
|
-
@device_ipad1_ios5.is_iphone?.should == false
|
51
|
-
@device_ipad1_ios5.is_ipad?.should == true
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'should be able to determine the if the runtime is on iphone 5' do
|
56
|
-
@sim_iphone_5_ios6.is_iphone_5?.should == true
|
57
|
-
@device_iphone4_ios6.is_iphone_5?.should == false
|
58
|
-
@device_iphone5_ios6.is_iphone_5?.should == true
|
59
|
-
@device_ipad1_ios5.is_iphone_5?.should == false
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'should be able to determine the calabash version' do
|
63
|
-
@sim_iphone_5_ios6.framework_version.should == '0.9.126'
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|