watir-webdriver 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9407ab3824340922a6ed7724f6f86dde94837cfa
4
+ data.tar.gz: ac0da8d422e29382fa8349a0942b345925d279d0
5
+ SHA512:
6
+ metadata.gz: 691b6c764ab1d227294fd4fcd3d6eb00afbf1d1c878b1cc444359fb27169646a846998c2964716b1e5d6ed047f43a5e6dbab224746a1a410723ff4e1196c080c
7
+ data.tar.gz: 27656d8ffe2229a8a92735406772909b2d7b24ea18df726c0bf0bc5449d1d246bb3aa782fbd6b2b3350b6d9b22a6ff0680c6b023bc8d58ad25b5835eff175814
data/.gitignore CHANGED
@@ -11,4 +11,5 @@ Gemfile.lock
11
11
  *.rbc
12
12
  .rbx/*
13
13
  chromedriver.log
14
- support/html5.html
14
+ support/html5.html
15
+ /doc
@@ -1,10 +1,11 @@
1
1
  rvm:
2
- - 1.9.2
3
2
  - 1.9.3
3
+ - 2.0.0
4
4
  notifications:
5
5
  recipients:
6
6
  - jari.bakken@gmail.com
7
7
  - p0deje@gmail.com
8
+ - jarmo.p@gmail.com
8
9
  irc: "irc.freenode.net#watir"
9
10
  before_script:
10
11
  - support/travis.sh
@@ -15,3 +16,11 @@ env:
15
16
  - WATIR_WEBDRIVER_BROWSER=chrome
16
17
  - WATIR_WEBDRIVER_BROWSER=chrome ALWAYS_LOCATE=false
17
18
  - WATIR_WEBDRIVER_BROWSER=chrome PREFER_CSS=1 SELECTOR_STATS=1
19
+ - WATIR_WEBDRIVER_BROWSER=phantomjs
20
+ - WATIR_WEBDRIVER_BROWSER=phantomjs ALWAYS_LOCATE=false
21
+ - WATIR_WEBDRIVER_BROWSER=phantomjs PREFER_CSS=1 SELECTOR_STATS=1
22
+ matrix:
23
+ allow_failures:
24
+ - env: WATIR_WEBDRIVER_BROWSER=phantomjs
25
+ - env: WATIR_WEBDRIVER_BROWSER=phantomjs ALWAYS_LOCATE=false
26
+ - env: WATIR_WEBDRIVER_BROWSER=phantomjs PREFER_CSS=1 SELECTOR_STATS=1
@@ -0,0 +1 @@
1
+ --load ./lib/yard/handlers/watir.rb
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.6.3
2
+ =====
3
+
4
+ * Always use custom YARD handler (should give full docs on rubydoc.info)
5
+ * Window resizing coerces string arguments
6
+
1
7
  0.6.2
2
8
  =====
3
9
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2012 Jari Bakken
1
+ Copyright (c) 2009-2013 Jari Bakken
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -4,7 +4,11 @@ watir-webdriver
4
4
  Watir implementation built on WebDriver's Ruby bindings.
5
5
  See http://rubyforge.org/pipermail/wtr-development/2009-October/001313.html.
6
6
 
7
+ [![Gem Version](https://badge.fury.io/rb/watir-webdriver.png)](http://badge.fury.io/rb/watir-webdriver)
7
8
  [![Build Status](https://secure.travis-ci.org/watir/watir-webdriver.png)](http://travis-ci.org/watir/watir-webdriver)
9
+ [![Code Climate](https://codeclimate.com/github/watir/watir-webdriver.png)](https://codeclimate.com/github/watir/watir-webdriver)
10
+ [![Dependency Status](https://gemnasium.com/watir/watir-webdriver.png)](https://gemnasium.com/watir/watir-webdriver)
11
+ [![Coverage Status](https://coveralls.io/repos/watir/watir-webdriver/badge.png?branch=master)](https://coveralls.io/r/watir/watir-webdriver)
8
12
 
9
13
  Example
10
14
  -------
@@ -67,4 +71,4 @@ Note on Patches/Pull Requests
67
71
  Copyright
68
72
  ---------
69
73
 
70
- Copyright (c) 2009-2012 Jari Bakken. See LICENSE for details.
74
+ Copyright (c) 2009-2013 Jari Bakken. See LICENSE for details.
data/Rakefile CHANGED
@@ -87,7 +87,6 @@ end # html5
87
87
 
88
88
 
89
89
  require 'yard'
90
- require "yard/handlers/watir"
91
90
  YARD::Rake::YardocTask.new do |task|
92
91
  task.options = %w[--debug] # this is pretty slow, so nice with some output
93
92
  end
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- VERSION = "0.6.2"
3
- end # Watir
2
+ VERSION = "0.6.3"
3
+ end
@@ -26,8 +26,7 @@ module Watir
26
26
  #
27
27
  # @example
28
28
  # size = browser.window.size
29
- # "%sx%s" % [size.width, size.height]
30
- # #=> "1600x1200"
29
+ # [size.width, size.height] #=> [1600, 1200]
31
30
  #
32
31
 
33
32
  def size
@@ -42,8 +41,7 @@ module Watir
42
41
  #
43
42
  # @example
44
43
  # position = browser.window.position
45
- # "%sx%s" % [position.x, position.y]
46
- # #=> "92x76"
44
+ # [position.x, position.y] #=> [92, 76]
47
45
  #
48
46
 
49
47
  def position
@@ -64,7 +62,7 @@ module Watir
64
62
  #
65
63
 
66
64
  def resize_to(width, height)
67
- dimension = Selenium::WebDriver::Dimension.new(width, height)
65
+ dimension = Selenium::WebDriver::Dimension.new(Integer(width), Integer(height))
68
66
  use { @driver.manage.window.size = dimension }
69
67
 
70
68
  dimension
@@ -81,7 +79,7 @@ module Watir
81
79
  #
82
80
 
83
81
  def move_to(x, y)
84
- point = Selenium::WebDriver::Point.new(x, y)
82
+ point = Selenium::WebDriver::Point.new(Integer(x), Integer(y))
85
83
  use { @driver.manage.window.position = point }
86
84
 
87
85
  point
@@ -18,7 +18,7 @@ module YARD
18
18
  attributes = try_eval
19
19
 
20
20
  if attributes.nil?
21
- p :ignoring => statement.source, :in => namespace.to_s
21
+ p :ignoring => statement.source, :in => namespace.to_s if $DEBUG
22
22
  return
23
23
  end
24
24
 
@@ -33,7 +33,7 @@ module YARD
33
33
 
34
34
  def create_attributes(names, return_type)
35
35
  names.each do |attribute_name|
36
- p :adding => "#{namespace}##{attribute_name}"
36
+ p :adding => "#{namespace}##{attribute_name}" if $DEBUG
37
37
  attribute_name = "#{attribute_name}?".to_sym if return_type == "Boolean"
38
38
  register MethodObject.new(namespace, attribute_name, scope) do |o|
39
39
  o.visibility = :public
@@ -45,7 +45,7 @@ describe Watir::Element do
45
45
 
46
46
  describe "#hover" do
47
47
  not_compliant_on [:webdriver, :firefox, :synthesized_events],
48
- [:webdriver, :ie],
48
+ [:webdriver, :internet_explorer],
49
49
  [:webdriver, :iphone],
50
50
  [:webdriver, :safari] do
51
51
  it "should hover over the element" do
@@ -11,7 +11,7 @@ class ImplementationConfig
11
11
  set_guard_proc
12
12
  add_html_routes
13
13
 
14
- WatirSpec.always_use_server = mobile? || ie? || safari? || remote?
14
+ WatirSpec.always_use_server = mobile? || ie? || safari? || phantomjs? || remote?
15
15
  end
16
16
 
17
17
  private
@@ -47,41 +47,55 @@ class ImplementationConfig
47
47
  end
48
48
 
49
49
  def ie?
50
- [:ie, :internet_explorer].include? browser
50
+ [:internet_explorer].include? browser
51
51
  end
52
52
 
53
53
  def safari?
54
54
  browser == :safari
55
55
  end
56
56
 
57
+ def phantomjs?
58
+ browser == :phantomjs
59
+ end
60
+
57
61
  def remote?
58
62
  browser == :remote
59
63
  end
60
64
 
61
65
  def set_guard_proc
62
66
  matching_browser = remote? ? remote_browser : browser
67
+ browser_instance = WatirSpec.new_browser
68
+ browser_version = browser_instance.driver.capabilities.version
69
+ matching_browser_with_version = "#{matching_browser}#{browser_version}".to_sym
63
70
  matching_guards = [
64
71
  :webdriver, # guard only applies to webdriver
65
72
  matching_browser, # guard only applies to this browser
66
- [:webdriver, matching_browser] # guard only applies to this browser on webdriver
73
+ matching_browser_with_version, # guard only applies to this browser with specific version
74
+ [:webdriver, matching_browser], # guard only applies to this browser on webdriver
75
+ [:webdriver, matching_browser_with_version] # guard only applies to this browser with specific version on webdriver
67
76
  ]
68
77
 
69
78
  if native_events?
70
79
  # guard only applies to this browser on webdriver with native events enabled
71
80
  matching_guards << [:webdriver, matching_browser, :native_events]
81
+ matching_guards << [:webdriver, matching_browser_with_version, :native_events]
72
82
  else
73
83
  # guard only applies to this browser on webdriver with native events disabled
74
84
  matching_guards << [:webdriver, matching_browser, :synthesized_events]
85
+ matching_guards << [:webdriver, matching_browser_with_version, :synthesized_events]
75
86
  end
76
87
 
77
88
  if !Selenium::WebDriver::Platform.linux? || ENV['DESKTOP_SESSION']
78
89
  # some specs (i.e. Window#maximize) needs a window manager on linux
79
90
  matching_guards << [:webdriver, matching_browser, :window_manager]
91
+ matching_guards << [:webdriver, matching_browser_with_version, :window_manager]
80
92
  end
81
93
 
82
94
  @imp.guard_proc = lambda { |args|
83
95
  args.any? { |arg| matching_guards.include?(arg) }
84
96
  }
97
+ ensure
98
+ browser_instance.close if browser_instance
85
99
  end
86
100
 
87
101
  def firefox_args
@@ -128,7 +142,7 @@ class ImplementationConfig
128
142
  end
129
143
 
130
144
  def remote_browser
131
- remote_browser = @imp.browser_class.new(*@imp.browser_args)
145
+ remote_browser = WatirSpec.new_browser
132
146
  remote_browser.browser.name
133
147
  ensure
134
148
  remote_browser.close
@@ -145,7 +159,7 @@ class ImplementationConfig
145
159
  end
146
160
 
147
161
  def native_events_by_default?
148
- Selenium::WebDriver::Platform.windows? && [:firefox, :ie].include?(browser)
162
+ Selenium::WebDriver::Platform.windows? && [:firefox, :internet_explorer].include?(browser)
149
163
  end
150
164
 
151
165
  class SelectorListener < Selenium::WebDriver::Support::AbstractEventListener
@@ -2,12 +2,8 @@
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
- if ENV['coverage']
6
- raise "simplecov only works on Ruby 1.9" unless RUBY_VERSION =~ /^1\.9/
7
-
8
- require 'simplecov'
9
- SimpleCov.start { add_filter "spec/" }
10
- end
5
+ require 'coveralls'
6
+ Coveralls.wear!
11
7
 
12
8
  require 'watir-webdriver'
13
9
  require 'locator_spec_helper'
@@ -3,13 +3,23 @@
3
3
  set -e
4
4
  set -x
5
5
 
6
- CHROME_REVISION=142910
6
+ CHROME_REVISION=191150
7
7
  sh -e /etc/init.d/xvfb start && git submodule update --init
8
8
 
9
9
  if [[ "$WATIR_WEBDRIVER_BROWSER" = "chrome" ]]; then
10
10
  sudo apt-get install -y unzip libxss1
11
- curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux/$CHROME_REVISION/chrome-linux.zip"
11
+ curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/$CHROME_REVISION/chrome-linux.zip"
12
12
  unzip chrome-linux.zip
13
- curl -L "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux/$CHROME_REVISION/chrome-linux.test/chromedriver" > chrome-linux/chromedriver
13
+ curl -L "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/$CHROME_REVISION/chrome-linux.test/chromedriver" > chrome-linux/chromedriver
14
14
  chmod +x chrome-linux/chromedriver
15
+ sudo chmod 1777 /dev/shm
16
+ fi
17
+
18
+ if [[ "$WATIR_WEBDRIVER_BROWSER" = "phantomjs" ]]; then
19
+ PHANTOMJS_NAME=phantomjs-1.9.0-linux-x86_64
20
+ curl -L -O "https://phantomjs.googlecode.com/files/$PHANTOMJS_NAME.tar.bz2"
21
+ tar -xvjf $PHANTOMJS_NAME.tar.bz2
22
+ chmod +x $PHANTOMJS_NAME/bin/phantomjs
23
+ sudo cp $PHANTOMJS_NAME/bin/phantomjs /usr/local/phantomjs/bin/phantomjs
24
+ phantomjs --version
15
25
  fi
@@ -26,8 +26,9 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency "webidl", ">= 0.1.5"
27
27
  s.add_development_dependency "sinatra", "~> 1.0"
28
28
  s.add_development_dependency "rake", "~> 0.9.2"
29
- s.add_development_dependency "fuubar", "~> 0.0.6"
29
+ s.add_development_dependency "fuubar"
30
30
  s.add_development_dependency "nokogiri"
31
31
  s.add_development_dependency "activesupport", "~> 3.0" # for pluralization during code generation
32
32
  s.add_development_dependency "pry"
33
+ s.add_development_dependency "coveralls"
33
34
  end
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
5
- prerelease:
4
+ version: 0.6.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jari Bakken
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-07 00:00:00.000000000 Z
11
+ date: 2013-04-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: selenium-webdriver
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 2.18.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.18.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: yard
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,23 +55,20 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: webidl
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: 0.1.5
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: 0.1.5
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: sinatra
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,39 +97,34 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: fuubar
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ~>
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
- version: 0.0.6
103
+ version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ~>
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
- version: 0.0.6
110
+ version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: nokogiri
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: activesupport
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
@@ -150,7 +132,6 @@ dependencies:
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
@@ -158,17 +139,29 @@ dependencies:
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: pry
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ! '>='
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: coveralls
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
164
158
  - !ruby/object:Gem::Version
165
159
  version: '0'
166
160
  type: :development
167
161
  prerelease: false
168
162
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
163
  requirements:
171
- - - ! '>='
164
+ - - '>='
172
165
  - !ruby/object:Gem::Version
173
166
  version: '0'
174
167
  description: WebDriver-backed Watir
@@ -182,6 +175,7 @@ files:
182
175
  - .gitignore
183
176
  - .gitmodules
184
177
  - .travis.yml
178
+ - .yardopts
185
179
  - CHANGES.md
186
180
  - Gemfile
187
181
  - LICENSE
@@ -270,27 +264,26 @@ files:
270
264
  - watir-webdriver.gemspec
271
265
  homepage: http://github.com/watir/watir-webdriver
272
266
  licenses: []
267
+ metadata: {}
273
268
  post_install_message:
274
269
  rdoc_options: []
275
270
  require_paths:
276
271
  - lib
277
272
  required_ruby_version: !ruby/object:Gem::Requirement
278
- none: false
279
273
  requirements:
280
- - - ! '>='
274
+ - - '>='
281
275
  - !ruby/object:Gem::Version
282
276
  version: '0'
283
277
  required_rubygems_version: !ruby/object:Gem::Requirement
284
- none: false
285
278
  requirements:
286
- - - ! '>='
279
+ - - '>='
287
280
  - !ruby/object:Gem::Version
288
281
  version: '0'
289
282
  requirements: []
290
283
  rubyforge_project: watir-webdriver
291
- rubygems_version: 1.8.24
284
+ rubygems_version: 2.0.0
292
285
  signing_key:
293
- specification_version: 3
286
+ specification_version: 4
294
287
  summary: Watir on WebDriver
295
288
  test_files:
296
289
  - spec/browser_spec.rb