RDee 0.2 → 0.3
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 +4 -4
- data/ChangeLog +4 -0
- data/features/mobile_remote.feature +26 -0
- data/features/remote_browsers.feature +54 -0
- data/features/step_definitions/rdee_steps.rb +17 -0
- data/features/support/pages/cheezyworld.rb +8 -0
- data/features/support/pages/google_search.rb +2 -0
- data/lib/rdee.rb +1 -1
- data/lib/rdee/browser_factory.rb +7 -3
- data/lib/rdee/mobile_devices.rb +17 -0
- data/lib/rdee/target_parser.rb +20 -4
- data/lib/rdee/version.rb +1 -1
- data/spec/lib/rd_spec.rb +22 -0
- data/spec/lib/target_parser_spec.rb +20 -0
- data/spec/lib/targets_spec.rb +36 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6913d8a2e54ddce805ddbff2545d301e242f3a88
|
4
|
+
data.tar.gz: 95255bf370f561c56c592debcb485fd5d76fda50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e658f4076f85347f464ab3021d67f68f743b17c08e174b419905af9a8db31bae658ce71431536acd50d4ddfd7eb2dc3584f4a0106bb8eeead10a1cd28203bd42
|
7
|
+
data.tar.gz: 16209f4084c63e3a1ea3d7ae321133f511a366da5af8d3c3ef7c85e76b9a838590af49fecbe7fbe3d2beb9f9362709f3501ba405b385f62872de381818630df5
|
data/ChangeLog
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: RDee should work well with mobile devices on a remote selenium grid
|
2
|
+
|
3
|
+
Scenario: Creating an iPhone browser on ios 7.1
|
4
|
+
When I establish a iphone_ios71 browser on the remote machine using Selenium
|
5
|
+
And I go to the cheezyworld site
|
6
|
+
And I select the transformations link
|
7
|
+
Then I should see the text "Cucumber Transformations Screencast"
|
8
|
+
|
9
|
+
Scenario: Creating an iPhone browser on ios 7.0
|
10
|
+
When I establish a iphone_ios70 browser on the remote machine using Selenium
|
11
|
+
And I go to the cheezyworld site
|
12
|
+
And I select the transformations link
|
13
|
+
Then I should see the text "Cucumber Transformations Screencast"
|
14
|
+
|
15
|
+
Scenario: Creating an iPhone browser on ios 6.1
|
16
|
+
When I establish a iphone_ios61 browser on the remote machine using Selenium
|
17
|
+
And I go to the cheezyworld site
|
18
|
+
And I select the transformations link
|
19
|
+
Then I should see the text "Cucumber Transformations Screencast"
|
20
|
+
|
21
|
+
Scenario: Creating an iPhone browser on ios 6.0
|
22
|
+
When I establish a iphone_ios60 browser on the remote machine using Selenium
|
23
|
+
And I go to the cheezyworld site
|
24
|
+
And I select the transformations link
|
25
|
+
Then I should see the text "Cucumber Transformations Screencast"
|
26
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
Feature: RDee should work well with browsers on a remote selenium grid
|
2
|
+
|
3
|
+
|
4
|
+
Scenario: Creating a browser on the remote machine using Selenium
|
5
|
+
When I establish a firefox browser on the remote machine using Selenium
|
6
|
+
Then I should be able to perform a google search for cheezyworld
|
7
|
+
And I should be able to close the connection
|
8
|
+
|
9
|
+
Scenario: Creating a browser on the remote machine using Watir
|
10
|
+
When I establish a firefox browser on the remote machine using Watir
|
11
|
+
Then I should be able to perform a google search for cheezyworld
|
12
|
+
And I should be able to close the connection
|
13
|
+
|
14
|
+
Scenario: Creating a browser on Windows 8.1
|
15
|
+
When I establish a chrome32_win81 browser on the remote machine using Watir
|
16
|
+
Then I should be able to perform a google search for cheezyworld
|
17
|
+
And I should be able to close the connection
|
18
|
+
|
19
|
+
Scenario: Creating a browser on Windows 8
|
20
|
+
When I establish a chrome32_win8 browser on the remote machine using Watir
|
21
|
+
Then I should be able to perform a google search for cheezyworld
|
22
|
+
And I should be able to close the connection
|
23
|
+
|
24
|
+
Scenario: Creating a browser on Windows 7
|
25
|
+
When I establish a chrome32_win7 browser on the remote machine using Watir
|
26
|
+
Then I should be able to perform a google search for cheezyworld
|
27
|
+
And I should be able to close the connection
|
28
|
+
|
29
|
+
Scenario: Creating a browser on Windows XP
|
30
|
+
When I establish a chrome32_winxp browser on the remote machine using Watir
|
31
|
+
Then I should be able to perform a google search for cheezyworld
|
32
|
+
And I should be able to close the connection
|
33
|
+
|
34
|
+
Scenario: Creating a browser on Snow Leopard
|
35
|
+
When I establish a chrome32_snow_leopard browser on the remote machine using Watir
|
36
|
+
Then I should be able to perform a google search for cheezyworld
|
37
|
+
And I should be able to close the connection
|
38
|
+
|
39
|
+
Scenario: Creating a browser on Mountain Lion
|
40
|
+
When I establish a chrome32_mountain_lion browser on the remote machine using Watir
|
41
|
+
Then I should be able to perform a google search for cheezyworld
|
42
|
+
And I should be able to close the connection
|
43
|
+
|
44
|
+
Scenario: Creating a browser on Mavricks
|
45
|
+
When I establish a chrome32_mavricks browser on the remote machine using Watir
|
46
|
+
Then I should be able to perform a google search for cheezyworld
|
47
|
+
And I should be able to close the connection
|
48
|
+
|
49
|
+
Scenario: Creating a browser on Linux
|
50
|
+
When I establish a chrome32_linux browser on the remote machine using Watir
|
51
|
+
Then I should be able to perform a google search for cheezyworld
|
52
|
+
And I should be able to close the connection
|
53
|
+
|
54
|
+
|
@@ -8,6 +8,11 @@ When(/^I establish a (.+) browser with a variable using (.+)$/) do |browser, pla
|
|
8
8
|
ENV.delete 'RDEE_BROWSER'
|
9
9
|
end
|
10
10
|
|
11
|
+
When(/^I establish a (.+) browser on the remote machine using (.+)$/) do |browser, platform|
|
12
|
+
@browser = RDee.send "#{platform.downcase}_browser",
|
13
|
+
browser.to_sym, url: 'http://rdee:730071ad-7331-4d65-bd56-ec3ebfdd8232@ondemand.saucelabs.com:80/wd/hub'
|
14
|
+
end
|
15
|
+
|
11
16
|
Then(/^I should be able to perform a google search for cheezyworld$/) do
|
12
17
|
visit(GoogleSearch) do |page|
|
13
18
|
page.perform_search
|
@@ -20,3 +25,15 @@ end
|
|
20
25
|
Then(/^I should be able to close the connection$/) do
|
21
26
|
@browser.close
|
22
27
|
end
|
28
|
+
|
29
|
+
When(/^I go to the cheezyworld site$/) do
|
30
|
+
visit CheezyWorld
|
31
|
+
end
|
32
|
+
|
33
|
+
When(/^I select the transformations link$/) do
|
34
|
+
on(CheezyWorld).transformations_element.click
|
35
|
+
end
|
36
|
+
|
37
|
+
Then(/^I should see the text "(.*?)"$/) do |message|
|
38
|
+
expect(@current_page.text).to include message
|
39
|
+
end
|
data/lib/rdee.rb
CHANGED
data/lib/rdee/browser_factory.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require_relative 'target_parser'
|
2
|
-
|
3
|
-
|
2
|
+
require_relative 'mobile_devices'
|
4
3
|
|
5
4
|
module RDee
|
6
5
|
class ConnectionError < StandardError
|
@@ -10,7 +9,7 @@ module RDee
|
|
10
9
|
include TargetParser
|
11
10
|
|
12
11
|
attr_accessor :url, :persistent_http, :chrome_options, :firefox_options,
|
13
|
-
:ie_options, :safari_options
|
12
|
+
:ie_options, :safari_options, :iphone_options
|
14
13
|
|
15
14
|
def watir_browser(target, options)
|
16
15
|
platform, options = platform_and_options(target, options)
|
@@ -81,6 +80,7 @@ module RDee
|
|
81
80
|
options.merge!(firefox_options) if need_firefox_options? target
|
82
81
|
options.merge!(ie_options) if need_ie_optons? target
|
83
82
|
options.merge!(safari_options) if need_safari_options? target
|
83
|
+
options.merge!(iphone_options) if need_iphone_options? target
|
84
84
|
options
|
85
85
|
end
|
86
86
|
|
@@ -99,5 +99,9 @@ module RDee
|
|
99
99
|
def need_safari_options?(target)
|
100
100
|
not safari_options.nil? and target.to_s.include? 'safari'
|
101
101
|
end
|
102
|
+
|
103
|
+
def need_iphone_options?(target)
|
104
|
+
not iphone_options.nil? and target.to_s.include? 'iphone'
|
105
|
+
end
|
102
106
|
end
|
103
107
|
end
|
data/lib/rdee/target_parser.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
require_relative 'mobile_devices'
|
1
2
|
|
2
3
|
module RDee
|
3
4
|
module TargetParser
|
5
|
+
include MobileDevices
|
4
6
|
|
5
7
|
def parse(value)
|
6
|
-
target = target_for(value)
|
8
|
+
target = target_for(value)
|
7
9
|
version = version_for(value)
|
8
10
|
host = host_for(value)
|
9
11
|
return target, version, host
|
@@ -14,11 +16,12 @@ module RDee
|
|
14
16
|
def target_for(value)
|
15
17
|
target = value.to_s.split(/\d+/)[0]
|
16
18
|
target = target.split('_')[0] if target.include? '_'
|
17
|
-
target
|
19
|
+
target.to_sym
|
18
20
|
end
|
19
21
|
|
20
22
|
def version_for(value)
|
21
|
-
version =
|
23
|
+
version = mobile_version(value) if mobile?(value)
|
24
|
+
version = browser_version(value) unless mobile?(value)
|
22
25
|
unless version.nil?
|
23
26
|
version = nil if version.empty?
|
24
27
|
end
|
@@ -30,6 +33,14 @@ module RDee
|
|
30
33
|
host_lookup[host.join('_').to_sym] if host
|
31
34
|
end
|
32
35
|
|
36
|
+
def browser_version(value)
|
37
|
+
value.to_s.gsub(target_for(value).to_s, '').split(/_/)[0]
|
38
|
+
end
|
39
|
+
|
40
|
+
def mobile_version(value)
|
41
|
+
value.to_s.split(/_/).slice(1..-1)[0][-2,2].insert(1, '.')
|
42
|
+
end
|
43
|
+
|
33
44
|
def host_lookup
|
34
45
|
@host_lookup ||= {
|
35
46
|
win81: 'Windows 8.1',
|
@@ -39,8 +50,13 @@ module RDee
|
|
39
50
|
snow_leopard: 'OS X 10.6',
|
40
51
|
mountain_lion: 'OS X 10.8',
|
41
52
|
mavricks: 'OS X 10.9',
|
42
|
-
linux: 'Linux'
|
53
|
+
linux: 'Linux',
|
54
|
+
ios60: 'OS X 10.8',
|
55
|
+
ios61: 'OS X 10.8',
|
56
|
+
ios70: 'OS X 10.9',
|
57
|
+
ios71: 'OS X 10.9'
|
43
58
|
}
|
44
59
|
end
|
60
|
+
|
45
61
|
end
|
46
62
|
end
|
data/lib/rdee/version.rb
CHANGED
data/spec/lib/rd_spec.rb
CHANGED
@@ -172,5 +172,27 @@ end
|
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
|
+
it "should allow users to add additional options for iPhone by configuration" do
|
176
|
+
RDee.configure do |config|
|
177
|
+
config.iphone_options = {iphone_options: 'option'}
|
178
|
+
end
|
179
|
+
expect(watir_browser).to receive(:new).with(:iphone, iphone_options: 'option')
|
180
|
+
RDee.watir_browser(:iphone_ios70)
|
181
|
+
RDee.configure do |config|
|
182
|
+
config.iphone_options = nil
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
it "shoudl not add iphone_options when not using iPhone" do
|
187
|
+
RDee.configure do |config|
|
188
|
+
config.iphone_options = {iphone_options: 'option'}
|
189
|
+
end
|
190
|
+
expect(watir_browser).to receive(:new).with(:firefox)
|
191
|
+
RDee.watir_browser(:firefox)
|
192
|
+
RDee.configure do |config|
|
193
|
+
config.iphone_options = nil
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
175
197
|
end
|
176
198
|
end
|
@@ -66,6 +66,26 @@ describe RDee::TargetParser do
|
|
66
66
|
expect(host).to eql 'Linux'
|
67
67
|
end
|
68
68
|
|
69
|
+
it "should parse ios60 for iphone" do
|
70
|
+
target, version, host = parser.parse(:iphone_ios60)
|
71
|
+
expect(host).to eql 'OS X 10.8'
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should parse ios70 for iphone" do
|
75
|
+
target, version, host = parser.parse(:iphone_ios70)
|
76
|
+
expect(host).to eql 'OS X 10.9'
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should parse ios71 for iphone" do
|
80
|
+
target, version, host = parser.parse(:iphone_ios71)
|
81
|
+
expect(host).to eql 'OS X 10.9'
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should parse ios61 for iphone" do
|
85
|
+
target, version, host = parser.parse(:iphone_ios61)
|
86
|
+
expect(host).to eql 'OS X 10.8'
|
87
|
+
end
|
88
|
+
|
69
89
|
it "should cleanly handle an invalid host" do
|
70
90
|
target, version, host = parser.parse(:firefox30_foobar)
|
71
91
|
expect(host).to be_nil
|
data/spec/lib/targets_spec.rb
CHANGED
@@ -177,6 +177,42 @@ describe "Supported browser combinations" do
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
|
+
context "for iPhone" do
|
181
|
+
|
182
|
+
before(:each) do
|
183
|
+
allow(capabilities).to receive(:iphone).and_return(desired_capabilities)
|
184
|
+
end
|
185
|
+
|
186
|
+
it "includes iPhone with ios 6.0" do
|
187
|
+
expect(desired_capabilities).to receive(:version=).with('6.0')
|
188
|
+
expect(desired_capabilities).to receive(:platform=).with('OS X 10.8')
|
189
|
+
expect(watir_browser).to receive(:new).with(:remote, url: 'http://blah', desired_capabilities: anything())
|
190
|
+
RDee.watir_browser :iphone_ios60, url: 'http://blah'
|
191
|
+
end
|
192
|
+
|
193
|
+
it "includes iPhone with ios 6.1" do
|
194
|
+
expect(desired_capabilities).to receive(:version=).with('6.1')
|
195
|
+
expect(desired_capabilities).to receive(:platform=).with('OS X 10.8')
|
196
|
+
expect(watir_browser).to receive(:new).with(:remote, url: 'http://blah', desired_capabilities: anything())
|
197
|
+
RDee.watir_browser :iphone_ios61, url: 'http://blah'
|
198
|
+
end
|
199
|
+
|
200
|
+
it "includes iPhone with ios 7.0" do
|
201
|
+
expect(desired_capabilities).to receive(:version=).with('7.0')
|
202
|
+
expect(desired_capabilities).to receive(:platform=).with('OS X 10.9')
|
203
|
+
expect(watir_browser).to receive(:new).with(:remote, url: 'http://blah', desired_capabilities: anything())
|
204
|
+
RDee.watir_browser :iphone_ios70, url: 'http://blah'
|
205
|
+
end
|
206
|
+
|
207
|
+
it "includes iPhone with ios 7.1" do
|
208
|
+
expect(desired_capabilities).to receive(:version=).with('7.1')
|
209
|
+
expect(desired_capabilities).to receive(:platform=).with('OS X 10.9')
|
210
|
+
expect(watir_browser).to receive(:new).with(:remote, url: 'http://blah', desired_capabilities: anything())
|
211
|
+
RDee.watir_browser :iphone_ios71, url: 'http://blah'
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
|
180
216
|
context "for hosts" do
|
181
217
|
before(:each) do
|
182
218
|
allow(capabilities).to receive(:firefox).and_return(desired_capabilities)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RDee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey S. Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: watir-webdriver
|
@@ -128,11 +128,15 @@ files:
|
|
128
128
|
- cucumber.yml
|
129
129
|
- features/environment_variable.feature
|
130
130
|
- features/local_browsers.feature
|
131
|
+
- features/mobile_remote.feature
|
132
|
+
- features/remote_browsers.feature
|
131
133
|
- features/step_definitions/rdee_steps.rb
|
132
134
|
- features/support/env.rb
|
135
|
+
- features/support/pages/cheezyworld.rb
|
133
136
|
- features/support/pages/google_search.rb
|
134
137
|
- lib/rdee.rb
|
135
138
|
- lib/rdee/browser_factory.rb
|
139
|
+
- lib/rdee/mobile_devices.rb
|
136
140
|
- lib/rdee/target_parser.rb
|
137
141
|
- lib/rdee/version.rb
|
138
142
|
- rdee.gemspec
|
@@ -167,11 +171,13 @@ summary: Dynamically create a connection for Selenium or Watir.
|
|
167
171
|
test_files:
|
168
172
|
- features/environment_variable.feature
|
169
173
|
- features/local_browsers.feature
|
174
|
+
- features/mobile_remote.feature
|
175
|
+
- features/remote_browsers.feature
|
170
176
|
- features/step_definitions/rdee_steps.rb
|
171
177
|
- features/support/env.rb
|
178
|
+
- features/support/pages/cheezyworld.rb
|
172
179
|
- features/support/pages/google_search.rb
|
173
180
|
- spec/lib/rd_spec.rb
|
174
181
|
- spec/lib/target_parser_spec.rb
|
175
182
|
- spec/lib/targets_spec.rb
|
176
183
|
- spec/spec_helper.rb
|
177
|
-
has_rdoc:
|