watir-webdriver 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ rdoc
8
8
  .yardoc
9
9
  Gemfile.lock
10
10
  .rvmrc
11
+ *.rbc
@@ -0,0 +1,8 @@
1
+ rvm:
2
+ - 1.9.2
3
+ notifications:
4
+ recipients:
5
+ - jari.bakken@gmail.com
6
+ irc: "irc.freenode.net#watir"
7
+ before_script:
8
+ - git submodule update --init
data/Rakefile CHANGED
@@ -4,8 +4,9 @@ Bundler::GemHelper.install_tasks
4
4
 
5
5
  require 'rspec/core/rake_task'
6
6
  RSpec::Core::RakeTask.new(:spec) do |spec|
7
- spec.ruby_opts = "-I lib:spec"
8
- spec.pattern = 'spec/**/*_spec.rb'
7
+ spec.ruby_opts = "-I lib:spec"
8
+ spec.rspec_opts = %w[--color --require fuubar --format Fuubar]
9
+ spec.pattern = 'spec/**/*_spec.rb'
9
10
  end
10
11
 
11
12
  namespace :spec do
@@ -14,10 +15,11 @@ namespace :spec do
14
15
  spec.pattern = 'spec/**/*_spec.rb'
15
16
  spec.rspec_opts = "--format html --out #{ENV["SPEC_REPORT"] || "specs.html"}"
16
17
  end
17
-
18
18
  end
19
19
 
20
- task :spec
20
+ task :default => :spec
21
+
22
+
21
23
 
22
24
  task :lib do
23
25
  $LOAD_PATH.unshift(File.expand_path("lib", File.dirname(__FILE__)))
@@ -86,8 +88,6 @@ namespace :html5 do
86
88
  task :update => [:download, :generate, :overwrite]
87
89
  end # html5
88
90
 
89
- task :default => :spec
90
-
91
91
  begin
92
92
  require 'yard'
93
93
  Rake::Task[:lib].invoke
@@ -56,7 +56,7 @@ module Watir
56
56
  #
57
57
 
58
58
  def goto(uri)
59
- uri = "http://#{uri}" unless uri == "about:blank" || uri.include?("://")
59
+ uri = "http://#{uri}" unless uri =~ URI.regexp
60
60
 
61
61
  @driver.navigate.to uri
62
62
  run_checkers
@@ -71,22 +71,22 @@ module Watir
71
71
  def double_click
72
72
  assert_exists
73
73
 
74
- unless driver.respond_to?(:mouse)
75
- raise NotImplementedError, "need support in WebDriver"
74
+ unless driver.kind_of? WebDriver::DriverExtensions::HasInputDevices
75
+ raise NotImplementedError, "Element#double_click is not supported by this driver"
76
76
  end
77
77
 
78
- driver.mouse.double_click @element
78
+ driver.action.double_click(@element).perform
79
79
  run_checkers
80
80
  end
81
81
 
82
82
  def right_click
83
83
  assert_exists
84
84
 
85
- unless driver.respond_to?(:mouse)
86
- raise NotImplementedError, "need support in WebDriver"
85
+ unless driver.kind_of? WebDriver::DriverExtensions::HasInputDevices
86
+ raise NotImplementedError, "Element#context_click is not supported by this driver"
87
87
  end
88
88
 
89
- driver.mouse.context_click @element
89
+ driver.action.context_click(@element).perform
90
90
  run_checkers
91
91
  end
92
92
 
@@ -1,7 +1,7 @@
1
1
  module Watir
2
2
  class TextFieldLocator < ElementLocator
3
3
 
4
- NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden url datetime date month week time datetime-local range color]
4
+ NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden datetime date month week time datetime-local range color]
5
5
  # TODO: better way of finding input text fields?
6
6
  NEGATIVE_TYPE_EXPR = NON_TEXT_TYPES.map { |t| "@type!=#{t.inspect}" }.join(" and ")
7
7
 
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -9,7 +9,7 @@ WatirSpec.implementation do |imp|
9
9
  imp.browser_args = [browser]
10
10
 
11
11
  imp.guard_proc = lambda { |args|
12
- args.any? { |arg| arg == name || arg == [name, browser] }
12
+ args.any? { |arg| arg == name || arg == browser || arg == [name, browser]}
13
13
  }
14
14
  end
15
15
 
@@ -19,3 +19,11 @@ include Watir::Exception
19
19
 
20
20
  WEBDRIVER_SELECTORS = [:class, :class_name, :css, :id, :name, :tag_name, :xpath]
21
21
 
22
+ if ENV['TRAVIS']
23
+ require 'headless'
24
+ display = Headless.new
25
+ display.start
26
+
27
+ pid = Process.pid
28
+ at_exit { display.stop if Process.pid == pid }
29
+ end
@@ -25,6 +25,9 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "yard", "~> 0.6"
26
26
  s.add_development_dependency "webidl", ">= 0.1.1"
27
27
  s.add_development_dependency "sinatra", "~> 1.0"
28
+ s.add_development_dependency "headless", "~> 0.2"
29
+ s.add_development_dependency "rake", "~> 0.9.2"
30
+ s.add_development_dependency "fuubar", "~> 0.0.6"
28
31
  s.add_development_dependency "nokogiri"
29
32
  s.add_development_dependency "activesupport", "~> 2.3.5" # for pluralization during code generation
30
33
  end
metadata CHANGED
@@ -1,103 +1,191 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 3
10
+ version: 0.3.3
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jari Bakken
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-08-18 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-09-08 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: selenium-webdriver
16
- requirement: &2156945600 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 19
29
+ segments:
30
+ - 0
31
+ - 2
32
+ - 2
21
33
  version: 0.2.2
22
34
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2156945600
25
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
26
37
  name: rspec
27
- requirement: &2156944980 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
41
+ requirements:
30
42
  - - ~>
31
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 2
47
+ - 3
48
+ - 0
32
49
  version: 2.3.0
33
50
  type: :development
34
- prerelease: false
35
- version_requirements: *2156944980
36
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
37
53
  name: yard
38
- requirement: &2156944340 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
39
56
  none: false
40
- requirements:
57
+ requirements:
41
58
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '0.6'
59
+ - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 0
63
+ - 6
64
+ version: "0.6"
44
65
  type: :development
45
- prerelease: false
46
- version_requirements: *2156944340
47
- - !ruby/object:Gem::Dependency
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
48
68
  name: webidl
49
- requirement: &2156943720 !ruby/object:Gem::Requirement
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
50
71
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 25
76
+ segments:
77
+ - 0
78
+ - 1
79
+ - 1
54
80
  version: 0.1.1
55
81
  type: :development
56
- prerelease: false
57
- version_requirements: *2156943720
58
- - !ruby/object:Gem::Dependency
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
59
84
  name: sinatra
60
- requirement: &2156943120 !ruby/object:Gem::Requirement
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
61
87
  none: false
62
- requirements:
88
+ requirements:
63
89
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '1.0'
90
+ - !ruby/object:Gem::Version
91
+ hash: 15
92
+ segments:
93
+ - 1
94
+ - 0
95
+ version: "1.0"
66
96
  type: :development
97
+ version_requirements: *id005
98
+ - !ruby/object:Gem::Dependency
99
+ name: headless
67
100
  prerelease: false
68
- version_requirements: *2156943120
69
- - !ruby/object:Gem::Dependency
70
- name: nokogiri
71
- requirement: &2156942580 !ruby/object:Gem::Requirement
101
+ requirement: &id006 !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ~>
105
+ - !ruby/object:Gem::Version
106
+ hash: 15
107
+ segments:
108
+ - 0
109
+ - 2
110
+ version: "0.2"
111
+ type: :development
112
+ version_requirements: *id006
113
+ - !ruby/object:Gem::Dependency
114
+ name: rake
115
+ prerelease: false
116
+ requirement: &id007 !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ~>
120
+ - !ruby/object:Gem::Version
121
+ hash: 63
122
+ segments:
123
+ - 0
124
+ - 9
125
+ - 2
126
+ version: 0.9.2
127
+ type: :development
128
+ version_requirements: *id007
129
+ - !ruby/object:Gem::Dependency
130
+ name: fuubar
131
+ prerelease: false
132
+ requirement: &id008 !ruby/object:Gem::Requirement
72
133
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
134
+ requirements:
135
+ - - ~>
136
+ - !ruby/object:Gem::Version
137
+ hash: 19
138
+ segments:
139
+ - 0
140
+ - 0
141
+ - 6
142
+ version: 0.0.6
77
143
  type: :development
144
+ version_requirements: *id008
145
+ - !ruby/object:Gem::Dependency
146
+ name: nokogiri
78
147
  prerelease: false
79
- version_requirements: *2156942580
80
- - !ruby/object:Gem::Dependency
148
+ requirement: &id009 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ hash: 3
154
+ segments:
155
+ - 0
156
+ version: "0"
157
+ type: :development
158
+ version_requirements: *id009
159
+ - !ruby/object:Gem::Dependency
81
160
  name: activesupport
82
- requirement: &2156941880 !ruby/object:Gem::Requirement
161
+ prerelease: false
162
+ requirement: &id010 !ruby/object:Gem::Requirement
83
163
  none: false
84
- requirements:
164
+ requirements:
85
165
  - - ~>
86
- - !ruby/object:Gem::Version
166
+ - !ruby/object:Gem::Version
167
+ hash: 9
168
+ segments:
169
+ - 2
170
+ - 3
171
+ - 5
87
172
  version: 2.3.5
88
173
  type: :development
89
- prerelease: false
90
- version_requirements: *2156941880
174
+ version_requirements: *id010
91
175
  description: WebDriver-backed Watir
92
- email:
176
+ email:
93
177
  - jari.bakken@gmail.com
94
178
  executables: []
179
+
95
180
  extensions: []
181
+
96
182
  extra_rdoc_files: []
97
- files:
183
+
184
+ files:
98
185
  - .document
99
186
  - .gitignore
100
187
  - .gitmodules
188
+ - .travis.yml
101
189
  - Gemfile
102
190
  - LICENSE
103
191
  - README.md
@@ -174,29 +262,38 @@ files:
174
262
  - watir-webdriver.gemspec
175
263
  homepage: http://github.com/jarib/watir-webdriver
176
264
  licenses: []
265
+
177
266
  post_install_message:
178
267
  rdoc_options: []
179
- require_paths:
268
+
269
+ require_paths:
180
270
  - lib
181
- required_ruby_version: !ruby/object:Gem::Requirement
271
+ required_ruby_version: !ruby/object:Gem::Requirement
182
272
  none: false
183
- requirements:
184
- - - ! '>='
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- required_rubygems_version: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - ">="
275
+ - !ruby/object:Gem::Version
276
+ hash: 3
277
+ segments:
278
+ - 0
279
+ version: "0"
280
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
281
  none: false
189
- requirements:
190
- - - ! '>='
191
- - !ruby/object:Gem::Version
192
- version: '0'
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ hash: 3
286
+ segments:
287
+ - 0
288
+ version: "0"
193
289
  requirements: []
290
+
194
291
  rubyforge_project: watir-webdriver
195
- rubygems_version: 1.8.8
292
+ rubygems_version: 1.8.9
196
293
  signing_key:
197
294
  specification_version: 3
198
295
  summary: Watir on WebDriver
199
- test_files:
296
+ test_files:
200
297
  - spec/alert_spec.rb
201
298
  - spec/browser_spec.rb
202
299
  - spec/container_spec.rb