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 +4 -4
- data/CHANGES.md +4 -0
- data/Rakefile +19 -14
- data/lib/watir-webdriver/locators/text_field/locator.rb +3 -1
- data/lib/watir-webdriver/version.rb +1 -1
- data/spec/element_locator_spec.rb +0 -1
- data/spec/element_spec.rb +17 -0
- data/spec/implementation.rb +11 -20
- data/watir-webdriver.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a322877b0c96368348e29e32226bac91b8b36b75
|
4
|
+
data.tar.gz: 775b4abdc05e2c96ce2097dab57fcd4304b5b5b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b32874e38997f2162fae6c1bca220a4c7c39d926574f45c10773a3dba5fac00d9a7904dace123af818f61a611ce2dccb2f387f0ac12dd27f37b9add27743217
|
7
|
+
data.tar.gz: 0bf9c9e31e1c14f0b7c749154b269666619d242c47c211349941c8af523ffdf049210c665cac1867527c4862eae542f60751e6868c00044244ee01c44893534f
|
data/CHANGES.md
CHANGED
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: [:
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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[
|
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[
|
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
|
-
|
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
|
data/spec/element_spec.rb
CHANGED
@@ -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
|
data/spec/implementation.rb
CHANGED
@@ -21,10 +21,10 @@ class ImplementationConfig
|
|
21
21
|
require 'selenium/server'
|
22
22
|
|
23
23
|
@server ||= Selenium::Server.new(remote_server_jar,
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
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
|
-
|
58
|
+
{}
|
61
59
|
end
|
62
60
|
|
63
61
|
if ENV['SELECTOR_STATS']
|
64
62
|
listener = SelectorListener.new
|
65
|
-
args.
|
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
|
-
|
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
|
-
|
158
|
-
caps
|
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
|
data/watir-webdriver.gemspec
CHANGED
@@ -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", "~>
|
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.
|
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-
|
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: '
|
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: '
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|