frameworks-capybara 0.0.23 → 0.0.24

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.23
1
+ 0.0.24
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frameworks-capybara}
8
- s.version = "0.0.23"
8
+ s.version = "0.0.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcrmfc"]
12
- s.date = %q{2011-04-26}
12
+ s.date = %q{2011-05-04}
13
13
  s.description = %q{gem ti aid setup of Capybara for testing bbc sites}
14
14
  s.email = %q{mcrobbins@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -17,7 +17,7 @@ class CapybaraSetup
17
17
 
18
18
  validate_env_vars(capybara_opts) #validate environment variables set using cucumber.yml or passed via command line
19
19
 
20
-
20
+ @proxy_host = capybara_opts[:proxy].gsub(/http:\/\//,'').gsub(/:80/,'') unless capybara_opts[:proxy].nil?
21
21
  capybara_opts[:browser] = capybara_opts[:browser].intern #update :browser value to be a symbol, required for Selenium
22
22
  capybara_opts[:browser_name] = capybara_opts[:browser_name].intern if capybara_opts[:browser_name]
23
23
 
@@ -53,6 +53,17 @@ class CapybaraSetup
53
53
  def register_selenium_driver(opts)
54
54
  Capybara.register_driver :selenium do |app|
55
55
 
56
+ if(opts[:profile] == 'BBC_INTERNAL')
57
+ profile = Selenium::WebDriver::Firefox::Profile.new
58
+ profile["network.proxy.type"] = 1
59
+ profile["network.proxy.no_proxies_on"] = "*.sandbox.dev.bbc.co.uk"
60
+ profile["network.proxy.http"] = @proxy_host
61
+ profile["network.proxy.https"] = @proxy_host
62
+ profile["network.proxy.http_port"] = 80
63
+ profile["network.proxy.https_port"] = 80
64
+ opts[:profile] = profile
65
+ end
66
+
56
67
  if opts[:browser] == :remote
57
68
  client = Selenium::WebDriver::Remote::Http::Default.new
58
69
 
@@ -63,10 +74,10 @@ class CapybaraSetup
63
74
  end
64
75
 
65
76
  #set proxy for remote browser (only supported for ff at present)
66
- if opts[:remote_browser_proxy_url]
67
- opts[:proxy] = Selenium::WebDriver::Proxy.new(:http => opts[:remote_browser_proxy_url])
68
- opts.delete :remote_browser_proxy_url
69
- end
77
+ #if opts[:remote_browser_proxy_url]
78
+ # opts[:proxy] = Selenium::WebDriver::Proxy.new(:http => opts[:remote_browser_proxy_url])
79
+ # opts.delete :remote_browser_proxy_url
80
+ #end
70
81
 
71
82
  #TODO: temp workaround - needs refactoring
72
83
  cap_opts = opts.clone
@@ -93,9 +104,7 @@ class CapybaraSetup
93
104
  Capybara.register_driver :celerity do |app|
94
105
  opts.delete :browser #delete browser from options as value with be 'headless'
95
106
  opts[:javascript_enabled] == 'true' ? opts[:javascript_enabled] = true : opts[:javascript_enabled] = false
96
- if opts[:proxy]
97
- opts[:proxy] = opts[:proxy].gsub(/http:\/\//,'')
98
- end
107
+ opts[:proxy] = "#{@proxy_host}:80" unless opts[:proxy].nil?
99
108
  Capybara::Driver::Celerity.new(app,opts)
100
109
  end
101
110
  :celerity
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frameworks-capybara
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 23
10
- version: 0.0.23
9
+ - 24
10
+ version: 0.0.24
11
11
  platform: ruby
12
12
  authors:
13
13
  - mcrmfc
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-26 00:00:00 +01:00
18
+ date: 2011-05-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency