jarib-celerity 0.0.5.2 → 0.0.5.4
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/lib/celerity/browser.rb
CHANGED
@@ -46,21 +46,14 @@ module Celerity
|
|
46
46
|
|
47
47
|
@render_type = opts.delete(:render) || :html
|
48
48
|
@charset = opts.delete(:charset) || "UTF-8"
|
49
|
-
@proxy = opts.delete(:proxy) || nil
|
50
49
|
self.log_level = opts.delete(:log_level) || :warning
|
51
50
|
|
52
51
|
@last_url, @page = nil
|
53
52
|
@error_checkers = []
|
54
53
|
@browser = self # for Container#browser
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
else ::HtmlUnit::BrowserVersion::INTERNET_EXPLORER_7_0
|
59
|
-
end
|
60
|
-
|
61
|
-
@webclient = ::HtmlUnit::WebClient.new(browser)
|
62
|
-
|
63
|
-
configure_webclient(opts)
|
55
|
+
setup_webclient(opts)
|
56
|
+
|
64
57
|
raise ArgumentError, "unknown option #{opts.inspect}" unless opts.empty?
|
65
58
|
find_viewer
|
66
59
|
end
|
@@ -297,7 +290,7 @@ module Celerity
|
|
297
290
|
|
298
291
|
# Allows you to temporarily switch to HtmlUnit's NicelyResynchronizingAjaxController to resynchronize ajax calls.
|
299
292
|
#
|
300
|
-
# @browser.
|
293
|
+
# @browser.resynchronized do |b|
|
301
294
|
# b.link(:id, 'load_fancy_ajax_stuff').click
|
302
295
|
# end
|
303
296
|
#
|
@@ -396,17 +389,23 @@ module Celerity
|
|
396
389
|
|
397
390
|
# Configure the webclient according to the options given to #new.
|
398
391
|
# @see initialize
|
399
|
-
def
|
392
|
+
def setup_webclient(opts)
|
393
|
+
browser = case opts.delete(:browser)
|
394
|
+
when :firefox then ::HtmlUnit::BrowserVersion::FIREFOX_2
|
395
|
+
else ::HtmlUnit::BrowserVersion::INTERNET_EXPLORER_7_0
|
396
|
+
end
|
397
|
+
|
398
|
+
if proxy = opts.delete(:proxy)
|
399
|
+
phost, pport = proxy.split(":")
|
400
|
+
@webclient = ::HtmlUnit::WebClient.new(browser, phost, pport.to_i)
|
401
|
+
else
|
402
|
+
@webclient = ::HtmlUnit::WebClient.new(browser)
|
403
|
+
end
|
404
|
+
|
400
405
|
@webclient.throwExceptionOnScriptError = false unless opts.delete(:javascript_exceptions)
|
401
406
|
@webclient.throwExceptionOnFailingStatusCode = false unless opts.delete(:status_code_exceptions)
|
402
407
|
@webclient.cssEnabled = false unless opts.delete(:css)
|
403
408
|
@webclient.useInsecureSSL = opts.delete(:secure_ssl) == false
|
404
|
-
|
405
|
-
if @proxy
|
406
|
-
phost, pport = @proxy.split(":")
|
407
|
-
@webclient.proxyHost = phost
|
408
|
-
@webclient.proxyPort = pport.to_i
|
409
|
-
end
|
410
409
|
@webclient.setAjaxController(::HtmlUnit::NicelyResynchronizingAjaxController.new) if opts.delete(:resynchronize)
|
411
410
|
end
|
412
411
|
|
@@ -77,13 +77,13 @@ module Celerity
|
|
77
77
|
def find_by_id(what)
|
78
78
|
case what
|
79
79
|
when Regexp
|
80
|
-
elements_by_tag_names.find { |elem| elem.
|
80
|
+
elements_by_tag_names.find { |elem| elem.getId =~ what }
|
81
81
|
when String
|
82
82
|
obj = @object.getHtmlElementById(what)
|
83
83
|
return obj if @tags.include?(obj.getTagName)
|
84
84
|
|
85
85
|
$stderr.puts "warning: multiple elements with identical id? (#{what.inspect})" if $VERBOSE
|
86
|
-
elements_by_tag_names.find { |elem| elem.
|
86
|
+
elements_by_tag_names.find { |elem| elem.getId == what }
|
87
87
|
else
|
88
88
|
raise TypeError, "expected String or Regexp, got #{what.inspect}:#{what.class}"
|
89
89
|
end
|
Binary file
|
Binary file
|
data/lib/celerity/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jarib-celerity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.5.
|
4
|
+
version: 0.0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-02-
|
14
|
+
date: 2009-02-04 00:00:00 -08:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- History.txt
|
38
38
|
- lib
|
39
39
|
- lib/celerity
|
40
|
+
- lib/celerity.rb
|
40
41
|
- lib/celerity/browser.rb
|
41
42
|
- lib/celerity/clickable_element.rb
|
42
43
|
- lib/celerity/collections.rb
|
@@ -68,6 +69,7 @@ files:
|
|
68
69
|
- lib/celerity/extra
|
69
70
|
- lib/celerity/extra/method_generator.rb
|
70
71
|
- lib/celerity/htmlunit
|
72
|
+
- lib/celerity/htmlunit.rb
|
71
73
|
- lib/celerity/htmlunit/commons-codec-1.3.jar
|
72
74
|
- lib/celerity/htmlunit/commons-collections-3.2.1.jar
|
73
75
|
- lib/celerity/htmlunit/commons-httpclient-3.1.jar
|
@@ -75,7 +77,7 @@ files:
|
|
75
77
|
- lib/celerity/htmlunit/commons-lang-2.4.jar
|
76
78
|
- lib/celerity/htmlunit/commons-logging-1.1.1.jar
|
77
79
|
- lib/celerity/htmlunit/cssparser-0.9.5.jar
|
78
|
-
- lib/celerity/htmlunit/htmlunit-2.
|
80
|
+
- lib/celerity/htmlunit/htmlunit-2.5-SNAPSHOT.jar
|
79
81
|
- lib/celerity/htmlunit/htmlunit-core-js-2.4.jar
|
80
82
|
- lib/celerity/htmlunit/nekohtml-1.9.11.jar
|
81
83
|
- lib/celerity/htmlunit/sac-1.3.jar
|
@@ -83,7 +85,6 @@ files:
|
|
83
85
|
- lib/celerity/htmlunit/xalan-2.7.1.jar
|
84
86
|
- lib/celerity/htmlunit/xercesImpl-2.8.1.jar
|
85
87
|
- lib/celerity/htmlunit/xml-apis-1.3.04.jar
|
86
|
-
- lib/celerity/htmlunit.rb
|
87
88
|
- lib/celerity/identifier.rb
|
88
89
|
- lib/celerity/input_element.rb
|
89
90
|
- lib/celerity/listener.rb
|
@@ -92,7 +93,6 @@ files:
|
|
92
93
|
- lib/celerity/util.rb
|
93
94
|
- lib/celerity/version.rb
|
94
95
|
- lib/celerity/watir_compatibility.rb
|
95
|
-
- lib/celerity.rb
|
96
96
|
- License.txt
|
97
97
|
- Rakefile
|
98
98
|
- README.txt
|
Binary file
|