saucelabs-adapter 0.9.0 → 0.9.1
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.
data/README.markdown
CHANGED
@@ -3,27 +3,33 @@ Saucelabs-Adapter
|
|
3
3
|
|
4
4
|
Saucelabs-adapter provides the glue to connect Rails Selenium tests to saucelabs.com.
|
5
5
|
|
6
|
-
Currently it supports tests written using Webrat,
|
6
|
+
Currently it supports tests written using Webrat (via Test::Unit or Rspec), and JSUnit.
|
7
7
|
|
8
|
-
Getting Started - Webrat
|
8
|
+
Getting Started - Webrat + Test::Unit test suites
|
9
9
|
------------------------------------------------
|
10
10
|
|
11
|
-
1. Prerequisites:
|
12
|
-
|
13
|
-
You must be able to run selenium tests locally using test/selenium/selenium_suite.rb
|
14
|
-
|
15
11
|
2. Install the gem:
|
16
12
|
|
17
13
|
gem install saucelabs-adapter
|
18
14
|
|
19
15
|
3. Run the saucelabs_adapter generator in your project:
|
20
16
|
|
21
|
-
cd
|
17
|
+
$ cd your_rails_project
|
18
|
+
$ script/generate saucelabs_adapter
|
19
|
+
|
20
|
+
4. If you will run against saucelabs (not just a local selenium rc server), enter your credentials.
|
21
|
+
In config/selenium.yml, replace YOUR-SAUCELABS-USERNAME and YOUR-SAUCELABS-ACCESS-KEY with your saucelabs.com account information.
|
22
|
+
|
23
|
+
5. Install the webrat gem (>= 0.7.3) and the mongrel gem (so it can start your Rails app)
|
22
24
|
|
23
|
-
|
25
|
+
$ gem install webrat
|
26
|
+
$ gem install mongrel
|
24
27
|
|
25
|
-
|
26
|
-
|
28
|
+
6. To run against a local selenium server during development/test (not saucelabs), have an installed and running Selenium RC server
|
29
|
+
(e.g. selenium-rc gem which provides 'selenium-rc' executable)
|
30
|
+
|
31
|
+
$ gem install selenium-rc
|
32
|
+
$ selenium-rc
|
27
33
|
|
28
34
|
5. Run Tests
|
29
35
|
|
@@ -35,49 +41,6 @@ Getting Started - Webrat or Polonium test suites
|
|
35
41
|
|
36
42
|
rake selenium:sauce
|
37
43
|
|
38
|
-
Getting Started - JsUnit test suite
|
39
|
-
-----------------------------------
|
40
|
-
|
41
|
-
1. Prerequisites:
|
42
|
-
|
43
|
-
Install the latest JsUnit from http://github.com/pivotal/jsunit
|
44
|
-
|
45
|
-
JsUnit must be installed in RAILS_ROOT/public/jsunit as follows:
|
46
|
-
|
47
|
-
public/jsunit/jsunit_jar/jsunit.jar -- the compiled jar
|
48
|
-
public/jsunit/jsunit/build.xml etc... -- jsunit sources
|
49
|
-
|
50
|
-
2. Install the saucelabs-adapter gem:
|
51
|
-
|
52
|
-
gem install saucelabs-adapter
|
53
|
-
|
54
|
-
3. Run the saucelabs_adapter generator in your project:
|
55
|
-
|
56
|
-
cd your_project
|
57
|
-
|
58
|
-
script/generate saucelabs_adapter --jsunit
|
59
|
-
|
60
|
-
4. Configure it.
|
61
|
-
|
62
|
-
In config/selenium.yml, replace YOUR-SAUCELABS-USERNAME and
|
63
|
-
YOUR-SAUCELABS-ACCESS-KEY with your saucelabs.com account information.
|
64
|
-
|
65
|
-
Rename RAILS_ROOT/test/jsunit/jsunit_suite_example.rb to RAILS_ROOT/test/jsunit/jsunit_suite.rb
|
66
|
-
and modify it if necessary:
|
67
|
-
test_page needs to be set to the path under /public where your JsUnit test page (suite.html or similar) lives,
|
68
|
-
with '/jsunit' prepended. e.g. if your JsUnit suite runs from RAILS_ROOT/public/javascripts/test-pages/suite.html
|
69
|
-
then test_page needs to be set to '/jsunit/javascripts/test-pages/suite.html'.
|
70
|
-
|
71
|
-
5. Run Tests
|
72
|
-
|
73
|
-
To run JsUnit tests locally:
|
74
|
-
|
75
|
-
rake jsunit:selenium_rc:local
|
76
|
-
|
77
|
-
To run JsUnit tests using saucelabs.com:
|
78
|
-
|
79
|
-
rake jsunit:selenium_rc:sauce
|
80
|
-
|
81
44
|
RSpec + Rails
|
82
45
|
-------------
|
83
46
|
|
@@ -122,6 +85,50 @@ be more lengthy.
|
|
122
85
|
[parallel]: http://github.com/grosser/parallel_tests
|
123
86
|
|
124
87
|
|
88
|
+
Getting Started - JsUnit test suite
|
89
|
+
-----------------------------------
|
90
|
+
|
91
|
+
1. Prerequisites:
|
92
|
+
|
93
|
+
Install the latest JsUnit from http://github.com/pivotal/jsunit
|
94
|
+
|
95
|
+
JsUnit must be installed in RAILS_ROOT/public/jsunit as follows:
|
96
|
+
|
97
|
+
public/jsunit/jsunit_jar/jsunit.jar -- the compiled jar
|
98
|
+
public/jsunit/jsunit/build.xml etc... -- jsunit sources
|
99
|
+
|
100
|
+
2. Install the saucelabs-adapter gem:
|
101
|
+
|
102
|
+
gem install saucelabs-adapter
|
103
|
+
|
104
|
+
3. Run the saucelabs_adapter generator in your project:
|
105
|
+
|
106
|
+
cd your_project
|
107
|
+
|
108
|
+
script/generate saucelabs_adapter --jsunit
|
109
|
+
|
110
|
+
4. Configure it.
|
111
|
+
|
112
|
+
In config/selenium.yml, replace YOUR-SAUCELABS-USERNAME and
|
113
|
+
YOUR-SAUCELABS-ACCESS-KEY with your saucelabs.com account information.
|
114
|
+
|
115
|
+
Rename RAILS_ROOT/test/jsunit/jsunit_suite_example.rb to RAILS_ROOT/test/jsunit/jsunit_suite.rb
|
116
|
+
and modify it if necessary:
|
117
|
+
test_page needs to be set to the path under /public where your JsUnit test page (suite.html or similar) lives,
|
118
|
+
with '/jsunit' prepended. e.g. if your JsUnit suite runs from RAILS_ROOT/public/javascripts/test-pages/suite.html
|
119
|
+
then test_page needs to be set to '/jsunit/javascripts/test-pages/suite.html'.
|
120
|
+
|
121
|
+
5. Run Tests
|
122
|
+
|
123
|
+
To run JsUnit tests locally:
|
124
|
+
|
125
|
+
rake jsunit:selenium_rc:local
|
126
|
+
|
127
|
+
To run JsUnit tests using saucelabs.com:
|
128
|
+
|
129
|
+
rake jsunit:selenium_rc:sauce
|
130
|
+
|
131
|
+
|
125
132
|
What You Should See
|
126
133
|
-------------------
|
127
134
|
|
@@ -136,14 +143,14 @@ When running tests, intermixed with your test output you should see the followin
|
|
136
143
|
|
137
144
|
In Case of Problems
|
138
145
|
-------------------
|
139
|
-
Try setting environment variable
|
146
|
+
Try setting environment variable SAUCELABS\_ADAPTER\_DEBUG to "true". This enables more verbose output.
|
140
147
|
|
141
148
|
|
142
149
|
Continuous Integration
|
143
150
|
----------------------
|
144
151
|
Sauce Labs now lets you set the name of a test job.
|
145
152
|
By default the SaucelabsAdapter will set this to the name of the machine it is currently running on,
|
146
|
-
however you may override this by setting the environment variable
|
153
|
+
however you may override this by setting the environment variable SAUCELABS\_JOB\_NAME.
|
147
154
|
|
148
155
|
This can be useful if you run many tests from the same CI machine and would like to differentiate between
|
149
156
|
them without actually viewing the video.
|
@@ -153,7 +160,7 @@ What it Does
|
|
153
160
|
|
154
161
|
The saucelabs-adapter performs two functions when it detects you are running a test that will use saucelabs.com:
|
155
162
|
|
156
|
-
1. It sets up a
|
163
|
+
1. It sets up a Sauce Connect Tunnel before the test run starts and tears it down after the test ends. This happens once for the entire test run.
|
157
164
|
|
158
165
|
2. It configures the selenium client to connect to the correct address at saucelabs.com. This happens at the start of each test.
|
159
166
|
|
@@ -162,12 +169,16 @@ Resources
|
|
162
169
|
* [The gem](http://gemcutter.org/gems/saucelabs-adapter)
|
163
170
|
* [Source code](http://github.com/pivotal/saucelabs-adapter)
|
164
171
|
* [Tracker project](http://www.pivotaltracker.com/projects/59050)
|
165
|
-
* [Canary CI build](http://
|
172
|
+
* [Canary CI build](http://cibuilder.pivotallabs.com:3333/builds/SaucelabsCanary)
|
166
173
|
* [Canary project source code](http://github.com/pivotal/saucelabs-canary)
|
167
174
|
|
168
175
|
NOTABLE CHANGES
|
169
176
|
===============
|
170
177
|
|
178
|
+
0.9.1
|
179
|
+
-----
|
180
|
+
- Fix error with port when running webrat against local server
|
181
|
+
|
171
182
|
0.9.0
|
172
183
|
-----
|
173
184
|
- Added support for :sauce_connect_tunnel tunnel method, which uses 'sauce connect'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
@@ -9,12 +9,8 @@ class SaucelabsAdapterGenerator < Rails::Generator::Base
|
|
9
9
|
|
10
10
|
The saucelabs_adapter generator installs glue to connect your Selenium tests to saucelabs.com
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
1) Go edit config/selenium.yml and add your SauceLabs API credentials
|
15
|
-
2) Add this to your selenium_helper.rb:
|
16
|
-
|
17
|
-
require 'saucelabs-adapter'
|
12
|
+
Read the README.markdown at http://github.com/pivotal/saucelabs-adapter for
|
13
|
+
detailed instructions on various usage scenarios.
|
18
14
|
|
19
15
|
HELPFUL_INSTRUCTIONS
|
20
16
|
super
|
@@ -69,7 +69,7 @@ module SaucelabsAdapter
|
|
69
69
|
'selenium_server_port' => :selenium_server_port,
|
70
70
|
'selenium_browser_key' => :selenium_browser_key,
|
71
71
|
'application_address' => :application_address,
|
72
|
-
'application_port_for_selenium' => :tunnel_to_localhost_port,
|
72
|
+
'application_port_for_selenium' => start_tunnel? ? :tunnel_to_localhost_port : :application_port,
|
73
73
|
'application_port' => :application_port
|
74
74
|
}.each do |webrat_configuration_method, our_accessor|
|
75
75
|
webrat_configuration_object.send("#{webrat_configuration_method}=", self.send(our_accessor).to_s)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saucelabs-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 1
|
10
|
+
version: 0.9.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Felkins, Chad Woolley, Sam Pierson, Nate Clark
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-21 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|