frameworks-capybara 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frameworks-capybara (0.2.6)
4
+ frameworks-capybara (0.2.8)
5
5
  capybara (>= 1.0.0)
6
6
  capybara-celerity
7
7
  capybara-mechanize (>= 0.3.0)
@@ -13,7 +13,6 @@ GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
15
  addressable (2.2.8)
16
- bouncy-castle-java (1.5.0146.1)
17
16
  builder (3.0.0)
18
17
  capybara (1.1.2)
19
18
  mime-types (>= 1.16)
@@ -31,24 +30,21 @@ GEM
31
30
  celerity (0.9.2)
32
31
  childprocess (0.3.2)
33
32
  ffi (~> 1.0.6)
34
- cucumber (1.1.9)
33
+ cucumber (1.2.0)
35
34
  builder (>= 2.1.2)
36
- diff-lcs (>= 1.1.2)
37
- gherkin (~> 2.9.0)
35
+ diff-lcs (>= 1.1.3)
36
+ gherkin (~> 2.10.0)
38
37
  json (>= 1.4.6)
39
- term-ansicolor (>= 1.0.6)
40
38
  diff-lcs (1.1.3)
41
39
  domain_name (0.5.3)
42
40
  unf (~> 0.0.3)
43
41
  ffi (1.0.11)
44
- gherkin (2.9.3)
42
+ gherkin (2.10.0)
45
43
  json (>= 1.4.6)
46
- jruby-openssl (0.7.6.1)
47
- bouncy-castle-java (>= 1.5.0146.1)
48
- json (1.7.0)
44
+ json (1.7.3)
49
45
  libwebsocket (0.1.3)
50
46
  addressable
51
- mechanize (2.4)
47
+ mechanize (2.5.1)
52
48
  domain_name (~> 0.5, >= 0.5.1)
53
49
  mime-types (~> 1.17, >= 1.17.2)
54
50
  net-http-digest_auth (~> 1.1, >= 1.1.1)
@@ -57,8 +53,8 @@ GEM
57
53
  ntlm-http (~> 0.1, >= 0.1.1)
58
54
  webrobots (~> 0.0, >= 0.0.9)
59
55
  mime-types (1.18)
60
- multi_json (1.3.4)
61
- net-http-digest_auth (1.2)
56
+ multi_json (1.3.5)
57
+ net-http-digest_auth (1.2.1)
62
58
  net-http-persistent (2.6)
63
59
  nokogiri (1.5.2)
64
60
  ntlm-http (0.1.1)
@@ -66,14 +62,14 @@ GEM
66
62
  rack-test (0.6.1)
67
63
  rack (>= 1.0)
68
64
  rake (0.9.2.2)
69
- rspec (2.9.0)
70
- rspec-core (~> 2.9.0)
71
- rspec-expectations (~> 2.9.0)
72
- rspec-mocks (~> 2.9.0)
73
- rspec-core (2.9.0)
74
- rspec-expectations (2.9.1)
65
+ rspec (2.10.0)
66
+ rspec-core (~> 2.10.0)
67
+ rspec-expectations (~> 2.10.0)
68
+ rspec-mocks (~> 2.10.0)
69
+ rspec-core (2.10.1)
70
+ rspec-expectations (2.10.0)
75
71
  diff-lcs (~> 1.1.3)
76
- rspec-mocks (2.9.0)
72
+ rspec-mocks (2.10.1)
77
73
  rubyzip (0.9.8)
78
74
  selenium-webdriver (2.21.2)
79
75
  childprocess (>= 0.2.5)
@@ -81,7 +77,6 @@ GEM
81
77
  libwebsocket (~> 0.1.3)
82
78
  multi_json (~> 1.0)
83
79
  rubyzip
84
- term-ansicolor (1.0.7)
85
80
  unf (0.0.5)
86
81
  unf_ext
87
82
  unf_ext (0.0.4)
@@ -93,7 +88,6 @@ GEM
93
88
  nokogiri (~> 1.3)
94
89
 
95
90
  PLATFORMS
96
- java
97
91
  ruby
98
92
 
99
93
  DEPENDENCIES
@@ -18,7 +18,9 @@ module Frameworks
18
18
  #Generate base urls to use in Cucumber step defs
19
19
  def generate_base_urls
20
20
  environment = ENV['ENVIRONMENT'].downcase #be defensive
21
+
21
22
  set_scheme
23
+
22
24
  if(environment =='sandbox')
23
25
  @base_url = @sandbox + @bbc_domain
24
26
  @ssl_base_url = @sslsandbox + @bbc_domain
@@ -37,6 +39,7 @@ module Frameworks
37
39
  @static_base_url = @static_prefix.chop + @bbci_domain if environment == 'live'
38
40
  @open_base_url = @open_prefix + environment + @bbc_domain
39
41
  end
42
+
40
43
  proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
41
44
  @proxy_host = proxy.scan(/http:\/\/(.*):80/)[0][0] if proxy
42
45
  end
@@ -88,10 +91,18 @@ Before do
88
91
  #it was either this or a monkey patch - need to think about pushing a softer reset change to capybara-mechanize to override this
89
92
  http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy']
90
93
  if page.driver.class == Capybara::Mechanize::Driver
91
- page.driver.browser.agent.cert, page.driver.browser.agent.key = ENV['FW_CERT_LOCATION'], ENV['FW_CERT_LOCATION'] if ENV['FW_CERT_LOCATION']
94
+
95
+ if ENV['FW_CERT_LOCATION']
96
+ page.driver.browser.agent.cert, page.driver.browser.agent.key =
97
+ ENV['FW_CERT_LOCATION'],
98
+ ENV['FW_CERT_LOCATION']
99
+ end
100
+
92
101
  page.driver.browser.agent.ca_file = ENV['CA_CERT_LOCATION'] if ENV['CA_CERT_LOCATION']
102
+
93
103
  #TODO: Fix proxy logic globally...use system proxy instead of PROXY_URL
94
104
  page.driver.browser.agent.set_proxy(http_proxy.scan(/http:\/\/(.*):80/).to_s,80) if http_proxy
105
+
95
106
  #This is necessary because Mech2 does not ship with root certs like Mech1 did and boxes may not have the OpenSSL set installed
96
107
  page.driver.browser.agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
97
108
  end
@@ -61,6 +61,12 @@ class Capybara::Mechanize::Driver
61
61
  browser.agent.cookie_jar.clear!
62
62
  end
63
63
 
64
+ def delete_cookies_in_domain(domain)
65
+ cookies.each do |cookie|
66
+ delete_cookie(cookie[:name]) if cookie[:domain].include?(domain)
67
+ end
68
+ end
69
+
64
70
  FakeURI = Struct.new(:host)
65
71
  def add_cookie(attribs)
66
72
  c = Mechanize::Cookie.new(attribs[:name],attribs[:value])
@@ -43,6 +43,10 @@ class Capybara::Selenium::Driver
43
43
  def add_cookie(attribs)
44
44
  browser.manage.add_cookie(attribs)
45
45
  end
46
+
47
+ def delete_cookies_in_domain(domain)
48
+ browser.manage.delete_cookies_in_domain(domain)
49
+ end
46
50
  end
47
51
 
48
52
  module Capybara
@@ -78,6 +82,8 @@ module Capybara
78
82
  driver.add_cookie(attribs)
79
83
  end
80
84
 
85
+ def delete_cookies_in_domain(domain)
86
+ driver.delete_cookies_in_domain(domain)
87
+ end
81
88
  end
82
-
83
89
  end
@@ -7,7 +7,6 @@ module Selenium
7
7
  module WebDriver
8
8
  module Remote
9
9
  class Capabilities
10
-
11
10
  def custom_capabilities(opts)
12
11
  @custom_capabilities = opts
13
12
  end
@@ -15,7 +14,6 @@ module Selenium
15
14
  #hopefuly this alias approach will mean we capture changes in the webdriver method
16
15
  alias_method :old_as_json, :as_json
17
16
  def as_json(opts = nil)
18
-
19
17
  hash = old_as_json
20
18
  if @custom_capabilities
21
19
  @custom_capabilities.each do |key, value|
@@ -24,10 +22,14 @@ module Selenium
24
22
  end
25
23
  hash
26
24
  end
25
+ end
27
26
 
27
+ class Options
28
+ def delete_cookies_in_domain(domain)
29
+ delete_all_cookies #proxy to this method as WebDriver only deletes
30
+ #by domain
31
+ end
28
32
  end
29
33
  end
30
34
  end
31
35
  end
32
-
33
-
data/lib/version.rb CHANGED
@@ -1,4 +1,3 @@
1
1
  module FrameworksCapybara
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.8'
3
3
  end
4
-
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: 27
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 8
10
+ version: 0.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - matt robbins
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-15 00:00:00 +01:00
18
+ date: 2012-05-23 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency