frameworks-capybara 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/Gemfile.lock +1 -1
- data/README.rdoc +1 -1
- data/lib/frameworks/capybara.rb +2 -1
- data/lib/version.rb +1 -1
- data/spec/frameworks_capybara_spec.rb +45 -0
- metadata +4 -4
data/CHANGES
CHANGED
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -43,7 +43,7 @@ The following environment variables can be set to configure your tests:
|
|
43
43
|
CHROME_SWITCHES - pass in any allowed switches for the Selenium chrome driver (http://peter.sh/experiments/chromium-command-line-switches/) e.g. CHROME_SWITCHES="--user-agent=Mozilla/5.0 (PLAYSTATION 3; 3.55)"
|
44
44
|
PROJECT_NAME - optional project name description which gets displayed in Cucumber html reports
|
45
45
|
TEAM_NAME - optional team name description which gets displayed in Cucumber html reports
|
46
|
-
BROWSER_CLI_ARGS - optional additional arguments to pass to local browser processes
|
46
|
+
BROWSER_CLI_ARGS - optional additional arguments to pass to local browser processes (individual arguments should be separated with spaces)
|
47
47
|
|
48
48
|
The following environment variables are specific to running tests against a BrowserStack remote grid:
|
49
49
|
|
data/lib/frameworks/capybara.rb
CHANGED
@@ -12,6 +12,7 @@ class CapybaraSetup
|
|
12
12
|
def initialize
|
13
13
|
|
14
14
|
http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy']
|
15
|
+
browser_cli_args = ENV['BROWSER_CLI_ARGS'].split(/\s+/).compact if ENV['BROWSER_CLI_ARGS']
|
15
16
|
|
16
17
|
capybara_opts = {:environment => ENV['ENVIRONMENT'],
|
17
18
|
:http_proxy => http_proxy,
|
@@ -21,7 +22,7 @@ class CapybaraSetup
|
|
21
22
|
:url => ENV['REMOTE_URL'],
|
22
23
|
:chrome_switches => ENV['CHROME_SWITCHES'],
|
23
24
|
:firefox_prefs => ENV['FIREFOX_PREFS'],
|
24
|
-
:args =>
|
25
|
+
:args => browser_cli_args
|
25
26
|
}
|
26
27
|
|
27
28
|
selenium_remote_opts = {:os => ENV['PLATFORM'],
|
data/lib/version.rb
CHANGED
@@ -95,6 +95,51 @@ describe CapybaraSetup do
|
|
95
95
|
it_behaves_like "Selenium Driver Options Array"
|
96
96
|
end
|
97
97
|
|
98
|
+
context "with no command-line arguments supplied" do
|
99
|
+
before do
|
100
|
+
ENV['BROWSER'] = 'phantomjs'
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should be initialized correctly" do
|
104
|
+
Capybara.delete_session
|
105
|
+
expect(CapybaraSetup.new.driver).to eq :selenium
|
106
|
+
expect(Capybara.current_session.driver.options[:args]).to be nil
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
context "with single command-line argument supplied" do
|
111
|
+
before do
|
112
|
+
ENV['BROWSER'] = 'phantomjs'
|
113
|
+
ENV['BROWSER_CLI_ARGS'] = '--ignore-ssl-errors=true'
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should be initialized correctly" do
|
117
|
+
Capybara.delete_session
|
118
|
+
expect(CapybaraSetup.new.driver).to eq :selenium
|
119
|
+
args = Capybara.current_session.driver.options[:args]
|
120
|
+
expect(args).to be_instance_of Array
|
121
|
+
expect(args.size).to eq 1
|
122
|
+
expect(args[0]).to eq '--ignore-ssl-errors=true'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
context "with multiple command-line arguments supplied" do
|
127
|
+
before do
|
128
|
+
ENV['BROWSER'] = 'phantomjs'
|
129
|
+
ENV['BROWSER_CLI_ARGS'] = '--ignore-ssl-errors=true --remote-debugger-port=9000'
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should be initialized correctly" do
|
133
|
+
Capybara.delete_session
|
134
|
+
expect(CapybaraSetup.new.driver).to eq :selenium
|
135
|
+
args = Capybara.current_session.driver.options[:args]
|
136
|
+
expect(args).to be_instance_of Array
|
137
|
+
expect(args.size).to eq 2
|
138
|
+
expect(args[0]).to eq '--ignore-ssl-errors=true'
|
139
|
+
expect(args[1]).to eq '--remote-debugger-port=9000'
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
98
143
|
context "with Selenium driver and default firefox profile (from profiles.ini)" do
|
99
144
|
before do
|
100
145
|
ENV['BROWSER'] = 'firefox'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frameworks-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
segments:
|
205
205
|
- 0
|
206
|
-
hash:
|
206
|
+
hash: -631767015458493913
|
207
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
208
|
none: false
|
209
209
|
requirements:
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
version: '0'
|
213
213
|
segments:
|
214
214
|
- 0
|
215
|
-
hash:
|
215
|
+
hash: -631767015458493913
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
218
|
rubygems_version: 1.8.23.2
|