celerity 0.8.9.pre → 0.8.9

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.
@@ -2,4 +2,4 @@
2
2
  :major: 0
3
3
  :minor: 8
4
4
  :patch: 9
5
- :build: pre
5
+ :build:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{celerity}
8
- s.version = "0.8.9.pre"
8
+ s.version = "0.8.9"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jari Bakken", "T. Alexander Lystad", "Knut Johannes Dahle"]
12
- s.date = %q{2011-03-27}
12
+ s.date = %q{2011-03-28}
13
13
  s.description = %q{Celerity is a JRuby wrapper around HtmlUnit – a headless Java browser with JavaScript support. It provides a simple API for programmatic navigation through web applications. Celerity provides a superset of Watir's API.}
14
14
  s.email = %q{jari.bakken@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
- "HISTORY",
21
20
  "LICENSE",
22
21
  "README.rdoc",
23
22
  "Rakefile",
@@ -46,6 +46,7 @@ module Celerity
46
46
  # @option opts :secure_ssl [Boolean] (true) Enable/disable secure SSL. Enabled by default.
47
47
  # @option opts :status_code_exceptions [Boolean] (false) Raise exceptions on failing status codes (404 etc.). Disabled by default.
48
48
  # @option opts :user_agent [String] Override the User-Agent set by the :browser option
49
+ # @option opts :default_wait [Integer] The default number of seconds to wait when Browser#wait is called.
49
50
  # @option opts :viewer [String, false] ("127.0.0.1:6429") Connect to a CelerityViewer if available.
50
51
  #
51
52
  # @return [Celerity::Browser] An instance of the browser.
@@ -87,13 +88,16 @@ module Celerity
87
88
  # Goto the given URL
88
89
  #
89
90
  # @param [String] uri The url.
91
+ # @param [Hash] (optional) a Hash of HTTP headers to use for the request.
92
+ #
90
93
  # @return [String] The url.
91
94
  #
92
95
 
93
- def goto(uri)
96
+ def goto(uri, headers = nil)
94
97
  uri = "http://#{uri}" unless uri =~ %r{://}
95
98
 
96
99
  request = HtmlUnit::WebRequestSettings.new(::Java::JavaNet::URL.new(uri))
100
+ request.set_additional_headers(headers) if headers
97
101
  request.setCharset(@charset)
98
102
 
99
103
  rescue_status_code_exception do
@@ -276,10 +280,9 @@ module Celerity
276
280
  #
277
281
  # Wait for javascript jobs to finish
278
282
  #
279
-
280
- def wait
283
+ def wait(sec = @default_wait)
281
284
  assert_exists
282
- @webclient.waitForBackgroundJavaScript(10000);
285
+ @webclient.waitForBackgroundJavaScript(sec * 1000);
283
286
  end
284
287
 
285
288
  #
@@ -860,6 +863,8 @@ module Celerity
860
863
  self.refresh_handler = opts.delete(:refresh_handler) if opts[:refresh_handler]
861
864
  self.cache_limit = opts.delete(:cache_limit) if opts[:cache_limit]
862
865
 
866
+ @default_wait = Integer(opts.delete(:default_wait) || 10)
867
+
863
868
  if opts.delete(:resynchronize)
864
869
  controller = ::HtmlUnit::NicelyResynchronizingAjaxController.new
865
870
  @webclient.setAjaxController controller
@@ -1,3 +1,3 @@
1
1
  module Celerity
2
- VERSION = "0.8.9.pre"
2
+ VERSION = "0.8.9"
3
3
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celerity
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.8.9.pre
4
+ prerelease:
5
+ version: 0.8.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jari Bakken
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-03-27 00:00:00 +00:00
15
+ date: 2011-03-28 00:00:00 -07:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -69,7 +69,6 @@ extra_rdoc_files:
69
69
  - LICENSE
70
70
  - README.rdoc
71
71
  files:
72
- - HISTORY
73
72
  - LICENSE
74
73
  - README.rdoc
75
74
  - Rakefile
@@ -162,9 +161,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
161
  required_rubygems_version: !ruby/object:Gem::Requirement
163
162
  none: false
164
163
  requirements:
165
- - - ">"
164
+ - - ">="
166
165
  - !ruby/object:Gem::Version
167
- version: 1.3.1
166
+ version: "0"
168
167
  requirements: []
169
168
 
170
169
  rubyforge_project: celerity
data/HISTORY DELETED
@@ -1,111 +0,0 @@
1
- == 0.0.7 2009-09-04
2
- * :firefox (Firefox 2) is now the default browser, :firefox3 support added.
3
- * Avoid huge Java backtraces on FailingHttpStatusCodeException
4
- * Browser#log_level= sets the log level for more HtmlUnit packages
5
- * Default log level is now :off
6
- * ClickableElement#click_and_attach inherits options from parent browser
7
- * Allow searching by XPath in frames.
8
- * Fix bug with scripts in body onload.
9
- * Nicer API for Browser#debug_web_connection
10
- * Fix bug in Browser#element_by_xpath(s) and Element#method_missing
11
- * Fix bug when selecting empty SelectList options
12
- * Fix issue when using multiple attributes to locate elements on a page with non-unique IDs.
13
- * Nicer #inspect methods on some objects
14
- * Improved IPC with viewers
15
- * Methods added:
16
- - Browser#clear_cache
17
- - Browser#confirm
18
- - Browser#css=
19
- - Browser#ignore_pattern=
20
- - Browser#javascript_excepetion=
21
- - Browser#secure_ssl=
22
- - Browser#status
23
- - Browser#status_code
24
- - Browser#status_code_exceptions=
25
- - Celerity.index_offset=
26
- - ClickableElement#download
27
- - Element#fire_event
28
- - Element#javascript_object
29
- * New constructor options:
30
- - :javascript_enabled => true, false
31
- - :viewer => true, false, String
32
- - :refresh_handler => :immediate, :waiting, :threaded
33
- * Features removed:
34
- - Celerity::MethodGenerator
35
- * Most of the spec suite moved to the WatirSpec project
36
-
37
- == 0.0.6 2009-03-19
38
- * Support for meta, strong, dl, dt, dd, and em HTML elements.
39
- * Update to HtmlUnit 2.5-SNAPSHOT.
40
- * New options for Browser#new: :proxy, :charset, :render, :log_level
41
- * Methods added:
42
- - Browser#add_cookie
43
- - Browser#asynchronized
44
- - Browser#add_listener
45
- - Browser#content_type
46
- - Browser#cookies
47
- - Browser#debug_web_connection
48
- - Browser#focused_element
49
- - Browser#io
50
- - Browser#remove_cookie
51
- - Browser#response_headers
52
- - Browser#wait
53
- - Browser#xml
54
- - Browser#{element,elements}_by_xpath
55
- - ClickableElement#{double,right}_click
56
- - ElementCollection#{first,last}
57
- * Methods removed:
58
- - Browser#show_*
59
- * Methods renamed:
60
- - SelectList#get_all_contents => SelectList#options
61
- - SelectList#get_selected_items => selected_options
62
- - SelectList#clear_selection => SelectList#clear
63
- * Add support for finding elements by their corresponding <label>.
64
- * Recognize buttons of type image, reset, submit.
65
- * Proxy support (see Browser.new)
66
- * Lots of refactorings, bug fixes and minor enhancements.
67
-
68
- Thanks to Hirobumi Hama, Kamal Fariz Mahyuddin and Thomas Marek for contributions in this release.
69
-
70
- == 0.0.4 2008-08-18
71
- * Minor enhancements
72
- * Update HtmlUnit to 2.2
73
- * New methods: Element#focus, Element#parent, Table#child_row, Table#child_cell, TableRow#child_cell
74
- * Rename Celerity::IE -> Celerity::Browser (but Celerity::IE still points to the class)
75
- * Add Celerity::Browser.new(:browser => :firefox) to use HtmlUnit's Firefox mode.
76
- * Make it easier to run the spec suite against other implementations.
77
- * Bugfixes:
78
- - Image#click
79
- - Finding elements by id could give weird errors if multiple elements had the same id.
80
- - If getElementById returns an element with the wrong tag name, output a warning and find the correct element by iteration instead.
81
- - Browser#goto regexp
82
- - Frames (collection) support
83
-
84
- == 0.0.3 2008-05-26
85
- * 3 major enhancements:
86
- * Added support for <ul>, <ol>, <thead>, <tfoot>, <h1>, <h2>, <h3>, <h4>, <h5> and <h6> elements
87
- * Better support for <tbody>, <tr> and <option> elements. They are now accessible from the top level in the same way as every other element, meaning you can do ie.option(:id, 'some_id'), or ie.row(:index, 1).
88
- * Better HTTPS support
89
- * 8 minor enhancements:
90
- * Improved CelerityViewer
91
- * Watir-like show methods (IE#show_divs, IE#show_tables, etc.)
92
- * All HTML elements now has a default how parameter, see http://celerity.rubyforge.org/wiki/wiki.pl?ListOfSupportedHtmlElementsAndTheirDefaultHowParameter
93
- * Raketask cleanup
94
- * Separated out Watir compatibility specific stuff
95
- * Form#submit implemented
96
- * Updated ATTRIBUTES constants for all element classes
97
- * TextField#type bug fixed
98
-
99
- == 0.0.2 2008-05-15
100
- * 3 major enhancements:
101
- * Support for multiple how => what conditions
102
- * Fixed performance issue with collections
103
- * Specs will now run on Windows
104
- * 3 minor enhancements:
105
- * Benchmark scripts
106
- * Method generator
107
- * Fixed multi-byte characters issue for text fields
108
-
109
- == 0.0.1 2008-05-07
110
- * 1 major enhancement:
111
- * Initial release