watir-webdriver 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1f54118bae04cf0d3fa63789d3e497c44598568
4
- data.tar.gz: 577b5480be284ed6fb2872faf741e5dc657fe81f
3
+ metadata.gz: a322877b0c96368348e29e32226bac91b8b36b75
4
+ data.tar.gz: 775b4abdc05e2c96ce2097dab57fcd4304b5b5b6
5
5
  SHA512:
6
- metadata.gz: 720bbaa5c0629b2dbd845b336b9870d1cf48bc659ee3c5bd2ed7e83104d65141c80da02f327f6d0cb68a515ce534629a3c772a7454dc9a4faff201a10ece6866
7
- data.tar.gz: d3d4c44c25c95ba661ed233c9c11f2b032019a45b89c7aa61352ea56d9da2c06b7e45a6636f39b813ef7058e20c1d55c1b5114cb0920b46c392dc97327763b45
6
+ metadata.gz: 0b32874e38997f2162fae6c1bca220a4c7c39d926574f45c10773a3dba5fac00d9a7904dace123af818f61a611ce2dccb2f387f0ac12dd27f37b9add27743217
7
+ data.tar.gz: 0bf9c9e31e1c14f0b7c749154b269666619d242c47c211349941c8af523ffdf049210c665cac1867527c4862eae542f60751e6868c00044244ee01c44893534f
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.9.3 (2016-07-31)
2
+
3
+ * Fix warning message for untyped text field (#434)
4
+
1
5
  ### 0.9.2 (2016-07-29)
2
6
 
3
7
  * Massive reorganization and refactoring of element locators (#392)
data/Rakefile CHANGED
@@ -126,31 +126,36 @@ namespace :spec do
126
126
  require 'selenium-webdriver'
127
127
 
128
128
  desc 'Run specs in all browsers'
129
- task all_browsers: [:chrome,
130
- :firefox,
131
- :phantomjs,
132
- :remote_chrome,
133
- :remote_firefox,
134
- :remote_phantomjs,
135
- (:safari if Selenium::WebDriver::Platform.os == :macosx),
136
- (:remote_safari if Selenium::WebDriver::Platform.os == :macosx),
137
- (:ie if Selenium::WebDriver::Platform.os == :windows),
138
- (:remote_ie if Selenium::WebDriver::Platform.os == :windows),
139
- (:edge if Selenium::WebDriver::Platform.os == :windows),
140
- (:remote_edge if Selenium::WebDriver::Platform.os == :windows)].compact
129
+ task all_browsers: [:browsers, :remote_browsers]
130
+
131
+ desc 'Run specs locally for all browsers'
132
+ task browsers: [:chrome,
133
+ :firefox,
134
+ :phantomjs,
135
+ (:safari if Selenium::WebDriver::Platform.os == :macosx),
136
+ (:ie if Selenium::WebDriver::Platform.os == :windows),
137
+ (:edge if Selenium::WebDriver::Platform.os == :windows)].compact
138
+
139
+ desc 'Run specs remotely for all browsers'
140
+ task remote_browsers: [:remote_chrome,
141
+ :remote_firefox,
142
+ :remote_phantomjs,
143
+ (:remote_safari if Selenium::WebDriver::Platform.os == :macosx),
144
+ (:remote_ie if Selenium::WebDriver::Platform.os == :windows),
145
+ (:remote_edge if Selenium::WebDriver::Platform.os == :windows)].compact
141
146
 
142
147
  %w(firefox marionette chrome safari phantomjs ie edge).each do |browser|
143
148
  desc "Run specs in #{browser}"
144
149
  task browser do
145
150
  ENV['WATIR_WEBDRIVER_BROWSER'] = browser
146
- Rake::Task['spec'].execute
151
+ Rake::Task[:spec].execute
147
152
  end
148
153
 
149
154
  desc "Run specs in Remote #{browser}"
150
155
  task "remote_#{browser}" do
151
156
  ENV['WATIR_WEBDRIVER_BROWSER'] = 'remote'
152
157
  ENV['REMOTE_BROWSER'] = browser
153
- Rake::Task['spec'].execute
158
+ Rake::Task[:spec].execute
154
159
  end
155
160
  end
156
161
  end
@@ -32,7 +32,9 @@ module Watir
32
32
  element = super
33
33
 
34
34
  if element && !Watir::TextField::NON_TEXT_TYPES.include?(element.attribute(:type))
35
- warn "Locating textareas with '#text_field' is deprecated. Please, use '#textarea' method instead."
35
+ if element.tag_name.downcase == 'textarea'
36
+ warn "Locating textareas with '#text_field' is deprecated. Please, use '#textarea' method instead."
37
+ end
36
38
  element
37
39
  end
38
40
  end
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- VERSION = '0.9.2'
2
+ VERSION = '0.9.3'
3
3
  end
@@ -69,7 +69,6 @@ describe Watir::Locators::Element::Locator do
69
69
  end
70
70
  end
71
71
 
72
-
73
72
  describe "with special cased selectors" do
74
73
  it "normalizes space for :text" do
75
74
  expect_one :xpath, ".//div[normalize-space()='foo']"
@@ -114,4 +114,21 @@ describe Watir::Element do
114
114
  end
115
115
  end
116
116
  end
117
+
118
+ # TODO - Can remove when decide issue #295
119
+ describe "warnings" do
120
+ it "does not return a warning if using text_field for an unspecified text input" do
121
+ browser.goto(WatirSpec.url_for("forms_with_input_elements.html"))
122
+ expect do
123
+ browser.text_field(id: "new_user_first_name").exists?
124
+ end.to_not output.to_stderr
125
+ end
126
+
127
+ it "returns a warning if using text_field for textarea" do
128
+ browser.goto(WatirSpec.url_for("forms_with_input_elements.html"))
129
+ expect do
130
+ browser.text_field(id: "create_user_comment").exists?
131
+ end.to output.to_stderr
132
+ end
133
+ end
117
134
  end
@@ -21,10 +21,10 @@ class ImplementationConfig
21
21
  require 'selenium/server'
22
22
 
23
23
  @server ||= Selenium::Server.new(remote_server_jar,
24
- :port => Selenium::WebDriver::PortProber.above(4444),
25
- :log => !!$DEBUG,
26
- :background => true,
27
- :timeout => 60)
24
+ port: Selenium::WebDriver::PortProber.above(4444),
25
+ log: !!$DEBUG,
26
+ background: true,
27
+ timeout: 60)
28
28
 
29
29
  @server.start
30
30
  at_exit { @server.stop }
@@ -50,23 +50,21 @@ class ImplementationConfig
50
50
 
51
51
  def set_browser_args
52
52
  args = case browser
53
- when :firefox
54
- firefox_args
55
53
  when :chrome
56
54
  chrome_args
57
55
  when :remote
58
56
  remote_args
59
57
  else
60
- [browser, {}]
58
+ {}
61
59
  end
62
60
 
63
61
  if ENV['SELECTOR_STATS']
64
62
  listener = SelectorListener.new
65
- args.last.merge!(listener: listener)
63
+ args.merge!(listener: listener)
66
64
  at_exit { listener.report }
67
65
  end
68
66
 
69
- @imp.browser_args = args
67
+ @imp.browser_args = [browser, args]
70
68
  end
71
69
 
72
70
  def mobile?
@@ -124,14 +122,8 @@ class ImplementationConfig
124
122
  browser_instance.close if browser_instance
125
123
  end
126
124
 
127
- def firefox_args
128
- [:firefox, {}]
129
- end
130
-
131
125
  def chrome_args
132
- opts = {
133
- args: ["--disable-translate"]
134
- }
126
+ opts = {args: ["--disable-translate"]}
135
127
 
136
128
  if url = ENV['WATIR_WEBDRIVER_CHROME_SERVER']
137
129
  opts[:url] = url
@@ -149,14 +141,13 @@ class ImplementationConfig
149
141
  opts[:args] << "--no-sandbox" # https://github.com/travis-ci/travis-ci/issues/938
150
142
  end
151
143
 
152
- [:chrome, opts]
144
+ opts
153
145
  end
154
146
 
155
147
  def remote_args
156
148
  url = ENV["REMOTE_SERVER_URL"] || "http://127.0.0.1:#{@server.port}/wd/hub"
157
- remote_browser_name = ENV['REMOTE_BROWSER'].to_sym
158
- caps = Selenium::WebDriver::Remote::Capabilities.send(remote_browser_name)
159
- [:remote, {url: url, desired_capabilities: caps}]
149
+ caps = Selenium::WebDriver::Remote::Capabilities.send(remote_browser)
150
+ {url: url, desired_capabilities: caps}
160
151
  end
161
152
 
162
153
  def add_html_routes
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.add_dependency "selenium-webdriver", ">= 2.46.2"
24
24
 
25
- s.add_development_dependency "rspec", "~> 2.6"
25
+ s.add_development_dependency "rspec", "~> 3.0"
26
26
  s.add_development_dependency "yard", "> 0.8.2.1"
27
27
  s.add_development_dependency "webidl", ">= 0.1.5"
28
28
  s.add_development_dependency "sinatra", "~> 1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.6'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.6'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: yard
43
43
  requirement: !ruby/object:Gem::Requirement