frameworks-capybara 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ 2.2.0
2
+ Added Capybara cookie-handling extensions.
3
+
1
4
  2.1.0
2
5
  Added Wait utility class.
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frameworks-capybara (2.1.0)
4
+ frameworks-capybara (2.2.0)
5
5
  capybara
6
6
  capybara-mechanize
7
7
  cucumber
@@ -0,0 +1,69 @@
1
+ require 'selenium-webdriver'
2
+
3
+ #
4
+ # Cookie utility methods
5
+ #
6
+ class Capybara::Selenium::Driver
7
+ def cookies
8
+ browser.manage.all_cookies
9
+ end
10
+
11
+ def cookie_named(name)
12
+ browser.manage.cookie_named(name)
13
+ end
14
+
15
+ def delete_cookie(cookie)
16
+ browser.manage.delete_cookie(cookie)
17
+ end
18
+
19
+ def delete_all_cookies
20
+ browser.manage.delete_all_cookies
21
+ end
22
+
23
+ def add_cookie(attribs)
24
+ browser.manage.add_cookie(attribs)
25
+ end
26
+
27
+ def delete_cookies_in_domain(domain)
28
+ browser.manage.delete_cookies_in_domain(domain)
29
+ end
30
+ end
31
+
32
+ module Capybara
33
+ class Session
34
+ ##
35
+ # Get all cookies
36
+ #
37
+ # @return [Array<Hash>] list of cookies
38
+ #
39
+ def cookies
40
+ driver.cookies
41
+ end
42
+
43
+ ##
44
+ # Get the cookie with the given name
45
+ #
46
+ # @param [String] name the name of the cookie
47
+ # @return [Hash, nil] the cookie, or nil if it wasn't found.
48
+ #
49
+ def cookie_named(name)
50
+ driver.cookie_named(name)
51
+ end
52
+
53
+ def delete_cookie(cookie)
54
+ driver.delete_cookie(cookie)
55
+ end
56
+
57
+ def delete_all_cookies
58
+ driver.delete_all_cookies
59
+ end
60
+
61
+ def add_cookie(attribs)
62
+ driver.add_cookie(attribs)
63
+ end
64
+
65
+ def delete_cookies_in_domain(domain)
66
+ driver.delete_cookies_in_domain(domain)
67
+ end
68
+ end
69
+ end
@@ -1,8 +1,8 @@
1
1
  require 'capybara'
2
2
  require 'capybara/cucumber'
3
3
  require 'capybara/mechanize'
4
- #require 'capybara/mechanize/cucumber'
5
4
  require 'selenium-webdriver'
5
+ require 'extensions/capybara-extensions'
6
6
  require 'extensions/capybara-mechanize-extensions'
7
7
 
8
8
  class CapybaraSetup
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FrameworksCapybara
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
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.1.0
4
+ version: 2.2.0
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-11-21 00:00:00.000000000 Z
12
+ date: 2014-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -174,6 +174,7 @@ files:
174
174
  - README.rdoc
175
175
  - Rakefile
176
176
  - frameworks-capybara.gemspec
177
+ - lib/extensions/capybara-extensions.rb
177
178
  - lib/extensions/capybara-mechanize-extensions.rb
178
179
  - lib/frameworks-capybara.rb
179
180
  - lib/frameworks/capybara.rb
@@ -202,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
203
  version: '0'
203
204
  segments:
204
205
  - 0
205
- hash: -2516122325611902665
206
+ hash: -1659617196001302746
206
207
  required_rubygems_version: !ruby/object:Gem::Requirement
207
208
  none: false
208
209
  requirements:
@@ -211,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
212
  version: '0'
212
213
  segments:
213
214
  - 0
214
- hash: -2516122325611902665
215
+ hash: -1659617196001302746
215
216
  requirements: []
216
217
  rubyforge_project:
217
218
  rubygems_version: 1.8.23.2