selenium-webdriver 0.1.3.dev → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,9 +1,11 @@
1
- 0.1.3 (???)
1
+ 0.1.3 (2011-02-14)
2
2
  ============
3
3
 
4
- * Screenshot support in the IE and Remote drivers.
5
- * Fixed paths for IE DLLs on Cygwin.
6
4
  * Several crashing bugs fixed in the IE driver.
5
+ * Alert API available through the remote driver.
6
+ * Driver#refresh fixed in the IE driver.
7
+ * Fixed paths for IE DLLs on Cygwin.
8
+ * Screenshot support in the IE and Remote drivers.
7
9
  * Fix #1152 by avoiding IPv6 loopback.
8
10
  * Added Mouse and Keyboard classes, accessible as Driver#{mouse,keyboard}. Considered experimental (IE + HtmlUnit only at the moment).
9
11
  * Automation atoms now used extensively in the IE driver.
@@ -1,7 +1,8 @@
1
+ require "childprocess"
1
2
  require "tmpdir"
2
3
  require "fileutils"
3
4
  require "date"
4
- require "childprocess"
5
+ require 'base64'
5
6
 
6
7
  have_lib = lambda { |lib|
7
8
  begin
@@ -26,26 +26,21 @@ module Selenium
26
26
  end
27
27
 
28
28
  def self.zip(path)
29
- tmp_zip = Tempfile.new("webdriver-zip")
29
+ # can't use Tempfile here since it doesn't support File::BINARY mode on 1.8
30
+ Dir.mktmpdir { |tmp_dir|
31
+ zip_path = File.join(tmp_dir, "webdriver-zip")
30
32
 
31
- begin
32
- zos = Zip::ZipOutputStream.new(tmp_zip.path)
33
+ Zip::ZipFile.open(zip_path, Zip::ZipFile::CREATE) { |zip|
34
+ ::Find.find(path) do |file|
35
+ next if File.directory?(file)
36
+ entry = file.sub("#{path}/", '')
33
37
 
34
- ::Find.find(path) do |file|
35
- next if File.directory?(file)
36
- entry = file.sub("#{path}/", '')
38
+ zip.add entry, file
39
+ end
40
+ }
37
41
 
38
- zos.put_next_entry(entry)
39
- zos << File.read(file)
40
- end
41
-
42
- zos.close
43
- tmp_zip.rewind
44
-
45
- [tmp_zip.read].pack("m")
46
- ensure
47
- tmp_zip.close
48
- end
42
+ File.open(zip_path, "rb") { |io| Base64.encode64 io.read }
43
+ }
49
44
  end
50
45
 
51
46
  end # Zipper
@@ -85,14 +85,15 @@ module Selenium
85
85
  end
86
86
 
87
87
  def self.from_json(json)
88
- zip_file = Tempfile.new("webdriver-profile-duplicate-#{json.hash}")
88
+ data = JSON.parse(json).fetch('zip')
89
89
 
90
- zip_file << JSON.parse(json)['zip'].unpack("m")[0]
91
- zip_file.close
90
+ # can't use Tempfile here since it doesn't support File::BINARY mode on 1.8
91
+ Dir.mktmpdir { |tmp_dir|
92
+ zip_path = File.join(tmp_dir, "webdriver-profile-duplicate-#{json.hash}")
93
+ File.open(zip_path, "wb") { |zip_file| zip_file << Base64.decode64(data) }
92
94
 
93
- new(Zipper.unzip(zip_file.path))
94
- ensure
95
- zip_file.delete if zip_file
95
+ new Zipper.unzip(zip_path)
96
+ }
96
97
  end
97
98
 
98
99
  #
@@ -31,7 +31,7 @@ module Selenium
31
31
 
32
32
  remote_opts = {
33
33
  :url => "http://#{host}:#{@port}",
34
- :desired_capabilities => :firefox
34
+ :desired_capabilities => :internet_explorer
35
35
  }
36
36
 
37
37
  remote_opts.merge!(:http_client => http_client) if http_client
@@ -39,7 +39,7 @@ module Selenium
39
39
  end
40
40
 
41
41
  def stop
42
- return unless session_count == 0
42
+ return if session_count != 0 || @handle.nil?
43
43
  self.class.stop_server @handle
44
44
  @handle = nil
45
45
  end
@@ -43,6 +43,7 @@ module Selenium
43
43
  :platform => :windows
44
44
  }.merge(opts))
45
45
  end
46
+ alias_method :ie, :internet_explorer
46
47
 
47
48
  def htmlunit(opts = {})
48
49
  new({
@@ -60,7 +60,10 @@ module Selenium
60
60
  elsif code == 204
61
61
  Response.new(code)
62
62
  else
63
- raise Error::WebDriverError, "unexpected content type: #{content_type.inspect} (#{code})\n#{body}"
63
+ msg = "unexpected response, code=#{code}, content-type=#{content_type.inspect}"
64
+ msg << "\n#{body}" unless body.empty?
65
+
66
+ raise Error::WebDriverError, msg
64
67
  end
65
68
  end
66
69
 
@@ -11,6 +11,11 @@ module Selenium
11
11
 
12
12
  private
13
13
 
14
+ def initialize
15
+ super
16
+ @proxy = nil
17
+ end
18
+
14
19
  def http
15
20
  @http ||= (
16
21
  http = new_http_client
metadata CHANGED
@@ -1,95 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.1.3.dev
4
+ prerelease:
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
- - Jari Bakken
8
+ - Jari Bakken
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-04 00:00:00 +01:00
13
+ date: 2011-02-14 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: json_pure
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
25
- type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rubyzip
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
36
- type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: childprocess
40
- prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 0.1.5
47
- type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: ffi
51
- prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ~>
56
- - !ruby/object:Gem::Version
57
- version: 0.6.3
58
- type: :runtime
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: rspec
62
- prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: "2.0"
69
- type: :development
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: rack
73
- prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ~>
78
- - !ruby/object:Gem::Version
79
- version: "1.0"
80
- type: :development
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: ci_reporter
84
- prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
86
- none: false
87
- requirements:
88
- - - ~>
89
- - !ruby/object:Gem::Version
90
- version: 1.6.2
91
- type: :development
92
- version_requirements: *id007
16
+ - !ruby/object:Gem::Dependency
17
+ name: json_pure
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: childprocess
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 0.1.5
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: ffi
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: 0.6.3
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: rspec
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: "2.0"
69
+ type: :development
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: rack
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: "1.0"
80
+ type: :development
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: ci_reporter
84
+ prerelease: false
85
+ requirement: &id007 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: 1.6.2
91
+ type: :development
92
+ version_requirements: *id007
93
93
  description: WebDriver is a tool for writing automated tests of websites. It aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application.
94
94
  email: jari.bakken@gmail.com
95
95
  executables: []
@@ -99,86 +99,86 @@ extensions: []
99
99
  extra_rdoc_files: []
100
100
 
101
101
  files:
102
- - lib/selenium/client/base.rb
103
- - lib/selenium/client/driver.rb
104
- - lib/selenium/client/errors.rb
105
- - lib/selenium/client/extensions.rb
106
- - lib/selenium/client/idiomatic.rb
107
- - lib/selenium/client/javascript_expression_builder.rb
108
- - lib/selenium/client/javascript_frameworks/jquery.rb
109
- - lib/selenium/client/javascript_frameworks/prototype.rb
110
- - lib/selenium/client/legacy_driver.rb
111
- - lib/selenium/client/protocol.rb
112
- - lib/selenium/client/selenium_helper.rb
113
- - lib/selenium/client.rb
114
- - lib/selenium/rake/server_task.rb
115
- - lib/selenium/server.rb
116
- - lib/selenium/webdriver/android/bridge.rb
117
- - lib/selenium/webdriver/android.rb
118
- - lib/selenium/webdriver/chrome/bridge.rb
119
- - lib/selenium/webdriver/chrome/command_executor.rb
120
- - lib/selenium/webdriver/chrome/extension.zip
121
- - lib/selenium/webdriver/chrome/launcher.rb
122
- - lib/selenium/webdriver/chrome.rb
123
- - lib/selenium/webdriver/common/alert.rb
124
- - lib/selenium/webdriver/common/bridge_helper.rb
125
- - lib/selenium/webdriver/common/core_ext/dir.rb
126
- - lib/selenium/webdriver/common/core_ext/string.rb
127
- - lib/selenium/webdriver/common/driver.rb
128
- - lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb
129
- - lib/selenium/webdriver/common/driver_extensions/rotatable.rb
130
- - lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb
131
- - lib/selenium/webdriver/common/element.rb
132
- - lib/selenium/webdriver/common/error.rb
133
- - lib/selenium/webdriver/common/file_reaper.rb
134
- - lib/selenium/webdriver/common/find.rb
135
- - lib/selenium/webdriver/common/keyboard.rb
136
- - lib/selenium/webdriver/common/keys.rb
137
- - lib/selenium/webdriver/common/mouse.rb
138
- - lib/selenium/webdriver/common/navigation.rb
139
- - lib/selenium/webdriver/common/options.rb
140
- - lib/selenium/webdriver/common/platform.rb
141
- - lib/selenium/webdriver/common/proxy.rb
142
- - lib/selenium/webdriver/common/socket_poller.rb
143
- - lib/selenium/webdriver/common/target_locator.rb
144
- - lib/selenium/webdriver/common/timeouts.rb
145
- - lib/selenium/webdriver/common/wait.rb
146
- - lib/selenium/webdriver/common/zipper.rb
147
- - lib/selenium/webdriver/common.rb
148
- - lib/selenium/webdriver/firefox/binary.rb
149
- - lib/selenium/webdriver/firefox/bridge.rb
150
- - lib/selenium/webdriver/firefox/extension/webdriver.xpi
151
- - lib/selenium/webdriver/firefox/extension.rb
152
- - lib/selenium/webdriver/firefox/launcher.rb
153
- - lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so
154
- - lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so
155
- - lib/selenium/webdriver/firefox/profile.rb
156
- - lib/selenium/webdriver/firefox/profiles_ini.rb
157
- - lib/selenium/webdriver/firefox/socket_lock.rb
158
- - lib/selenium/webdriver/firefox/util.rb
159
- - lib/selenium/webdriver/firefox.rb
160
- - lib/selenium/webdriver/ie/bridge.rb
161
- - lib/selenium/webdriver/ie/native/win32/IEDriver.dll
162
- - lib/selenium/webdriver/ie/native/x64/IEDriver.dll
163
- - lib/selenium/webdriver/ie/server.rb
164
- - lib/selenium/webdriver/ie.rb
165
- - lib/selenium/webdriver/iphone/bridge.rb
166
- - lib/selenium/webdriver/iphone.rb
167
- - lib/selenium/webdriver/remote/bridge.rb
168
- - lib/selenium/webdriver/remote/capabilities.rb
169
- - lib/selenium/webdriver/remote/commands.rb
170
- - lib/selenium/webdriver/remote/http/common.rb
171
- - lib/selenium/webdriver/remote/http/curb.rb
172
- - lib/selenium/webdriver/remote/http/default.rb
173
- - lib/selenium/webdriver/remote/http/persistent.rb
174
- - lib/selenium/webdriver/remote/response.rb
175
- - lib/selenium/webdriver/remote/server_error.rb
176
- - lib/selenium/webdriver/remote.rb
177
- - lib/selenium/webdriver.rb
178
- - lib/selenium-client.rb
179
- - lib/selenium-webdriver.rb
180
- - CHANGES
181
- - README
102
+ - lib/selenium-client.rb
103
+ - lib/selenium-webdriver.rb
104
+ - lib/selenium/client.rb
105
+ - lib/selenium/server.rb
106
+ - lib/selenium/webdriver.rb
107
+ - lib/selenium/client/base.rb
108
+ - lib/selenium/client/driver.rb
109
+ - lib/selenium/client/errors.rb
110
+ - lib/selenium/client/extensions.rb
111
+ - lib/selenium/client/idiomatic.rb
112
+ - lib/selenium/client/javascript_expression_builder.rb
113
+ - lib/selenium/client/legacy_driver.rb
114
+ - lib/selenium/client/protocol.rb
115
+ - lib/selenium/client/selenium_helper.rb
116
+ - lib/selenium/client/javascript_frameworks/jquery.rb
117
+ - lib/selenium/client/javascript_frameworks/prototype.rb
118
+ - lib/selenium/rake/server_task.rb
119
+ - lib/selenium/webdriver/android.rb
120
+ - lib/selenium/webdriver/chrome.rb
121
+ - lib/selenium/webdriver/common.rb
122
+ - lib/selenium/webdriver/firefox.rb
123
+ - lib/selenium/webdriver/ie.rb
124
+ - lib/selenium/webdriver/iphone.rb
125
+ - lib/selenium/webdriver/remote.rb
126
+ - lib/selenium/webdriver/android/bridge.rb
127
+ - lib/selenium/webdriver/chrome/bridge.rb
128
+ - lib/selenium/webdriver/chrome/command_executor.rb
129
+ - lib/selenium/webdriver/chrome/extension.zip
130
+ - lib/selenium/webdriver/chrome/launcher.rb
131
+ - lib/selenium/webdriver/common/alert.rb
132
+ - lib/selenium/webdriver/common/bridge_helper.rb
133
+ - lib/selenium/webdriver/common/driver.rb
134
+ - lib/selenium/webdriver/common/element.rb
135
+ - lib/selenium/webdriver/common/error.rb
136
+ - lib/selenium/webdriver/common/file_reaper.rb
137
+ - lib/selenium/webdriver/common/find.rb
138
+ - lib/selenium/webdriver/common/keyboard.rb
139
+ - lib/selenium/webdriver/common/keys.rb
140
+ - lib/selenium/webdriver/common/mouse.rb
141
+ - lib/selenium/webdriver/common/navigation.rb
142
+ - lib/selenium/webdriver/common/options.rb
143
+ - lib/selenium/webdriver/common/platform.rb
144
+ - lib/selenium/webdriver/common/proxy.rb
145
+ - lib/selenium/webdriver/common/socket_poller.rb
146
+ - lib/selenium/webdriver/common/target_locator.rb
147
+ - lib/selenium/webdriver/common/timeouts.rb
148
+ - lib/selenium/webdriver/common/wait.rb
149
+ - lib/selenium/webdriver/common/zipper.rb
150
+ - lib/selenium/webdriver/common/core_ext/dir.rb
151
+ - lib/selenium/webdriver/common/core_ext/string.rb
152
+ - lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb
153
+ - lib/selenium/webdriver/common/driver_extensions/rotatable.rb
154
+ - lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb
155
+ - lib/selenium/webdriver/firefox/binary.rb
156
+ - lib/selenium/webdriver/firefox/bridge.rb
157
+ - lib/selenium/webdriver/firefox/extension.rb
158
+ - lib/selenium/webdriver/firefox/launcher.rb
159
+ - lib/selenium/webdriver/firefox/profile.rb
160
+ - lib/selenium/webdriver/firefox/profiles_ini.rb
161
+ - lib/selenium/webdriver/firefox/socket_lock.rb
162
+ - lib/selenium/webdriver/firefox/util.rb
163
+ - lib/selenium/webdriver/firefox/extension/webdriver.xpi
164
+ - lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so
165
+ - lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so
166
+ - lib/selenium/webdriver/ie/bridge.rb
167
+ - lib/selenium/webdriver/ie/server.rb
168
+ - lib/selenium/webdriver/ie/native/win32/IEDriver.dll
169
+ - lib/selenium/webdriver/ie/native/x64/IEDriver.dll
170
+ - lib/selenium/webdriver/iphone/bridge.rb
171
+ - lib/selenium/webdriver/remote/bridge.rb
172
+ - lib/selenium/webdriver/remote/capabilities.rb
173
+ - lib/selenium/webdriver/remote/commands.rb
174
+ - lib/selenium/webdriver/remote/response.rb
175
+ - lib/selenium/webdriver/remote/server_error.rb
176
+ - lib/selenium/webdriver/remote/http/common.rb
177
+ - lib/selenium/webdriver/remote/http/curb.rb
178
+ - lib/selenium/webdriver/remote/http/default.rb
179
+ - lib/selenium/webdriver/remote/http/persistent.rb
180
+ - CHANGES
181
+ - README
182
182
  has_rdoc: true
183
183
  homepage: http://selenium.googlecode.com
184
184
  licenses: []
@@ -187,23 +187,23 @@ post_install_message:
187
187
  rdoc_options: []
188
188
 
189
189
  require_paths:
190
- - lib
190
+ - lib
191
191
  required_ruby_version: !ruby/object:Gem::Requirement
192
192
  none: false
193
193
  requirements:
194
- - - ">="
195
- - !ruby/object:Gem::Version
196
- version: "0"
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: "0"
197
197
  required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  none: false
199
199
  requirements:
200
- - - ">"
201
- - !ruby/object:Gem::Version
202
- version: 1.3.1
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: "0"
203
203
  requirements: []
204
204
 
205
205
  rubyforge_project:
206
- rubygems_version: 1.5.0
206
+ rubygems_version: 1.4.1
207
207
  signing_key:
208
208
  specification_version: 3
209
209
  summary: The next generation developer focused tool for automated testing of webapps