watir-webdriver 0.3.9 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
rvm:
|
2
2
|
- 1.9.2
|
3
|
+
- 1.9.3
|
3
4
|
notifications:
|
4
5
|
recipients:
|
5
6
|
- jari.bakken@gmail.com
|
@@ -9,7 +10,7 @@ before_script:
|
|
9
10
|
env:
|
10
11
|
- WATIR_WEBDRIVER_BROWSER=firefox
|
11
12
|
- WATIR_WEBDRIVER_BROWSER=firefox ALWAYS_LOCATE=false
|
13
|
+
# - WATIR_WEBDRIVER_BROWSER=chrome
|
14
|
+
# - WATIR_WEBDRIVER_BROWSER=chrome ALWAYS_LOCATE=false
|
12
15
|
# - WATIR_WEBDRIVER_BROWSER=firefox NATIVE_EVENTS=true
|
13
|
-
- WATIR_WEBDRIVER_BROWSER=chrome
|
14
|
-
- WATIR_WEBDRIVER_BROWSER=chrome ALWAYS_LOCATE=false
|
15
16
|
# - WATIR_WEBDRIVER_BROWSER=chrome NATIVE_EVENTS=true
|
data/lib/watir-webdriver.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'selenium-webdriver'
|
3
|
-
require 'json'
|
4
3
|
|
5
4
|
require 'watir-webdriver/version'
|
6
5
|
require 'watir-webdriver/wait'
|
@@ -81,10 +80,3 @@ require 'watir-webdriver/elements/table_cell'
|
|
81
80
|
require 'watir-webdriver/elements/table_section'
|
82
81
|
|
83
82
|
Watir.tag_to_class.freeze
|
84
|
-
|
85
|
-
# undefine deprecated methods to use them for Element attributes
|
86
|
-
class Object
|
87
|
-
undef_method :id if method_defined? "id"
|
88
|
-
undef_method :type if method_defined? "type"
|
89
|
-
end
|
90
|
-
|
@@ -39,6 +39,13 @@ module Watir
|
|
39
39
|
|
40
40
|
private
|
41
41
|
|
42
|
+
def self.extended(klass)
|
43
|
+
klass.class_eval do
|
44
|
+
# undefine deprecated methods to use them for Element attributes
|
45
|
+
[:id, :type].each { |m| undef_method m if method_defined? m }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
42
49
|
def define_attribute(type, name)
|
43
50
|
method_name = method_name_for(type, name)
|
44
51
|
attribute_name = attribute_for_method(name)
|
@@ -53,7 +53,7 @@ module Watir
|
|
53
53
|
#
|
54
54
|
|
55
55
|
def prompt(answer, &blk)
|
56
|
-
execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{answer
|
56
|
+
execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{MultiJson.encode answer}; }"
|
57
57
|
yield
|
58
58
|
result = execute_script "return window.__lastWatirPrompt"
|
59
59
|
|
@@ -8,6 +8,8 @@ module Watir
|
|
8
8
|
#
|
9
9
|
|
10
10
|
def element_by_xpath(xpath)
|
11
|
+
warn 'element_by_xpath is deprecated and replaced by .element(:xpath, ...)'
|
12
|
+
|
11
13
|
e = wd.find_element(:xpath, xpath)
|
12
14
|
Watir.element_class_for(e.tag_name.downcase).new(self, :element => e)
|
13
15
|
rescue WebDriver::Error::NoSuchElementError
|
@@ -19,11 +21,13 @@ module Watir
|
|
19
21
|
#
|
20
22
|
|
21
23
|
def elements_by_xpath(xpath)
|
24
|
+
warn 'elements_by_xpath is deprecated and replaced by .elements(:xpath, ...)'
|
25
|
+
|
22
26
|
wd.find_elements(:xpath, xpath).map do |e|
|
23
27
|
Watir.element_class_for(e.tag_name.downcase).new(self, :element => e)
|
24
28
|
end
|
25
29
|
end
|
26
|
-
|
30
|
+
|
27
31
|
def self.escape(value)
|
28
32
|
if value.include? "'"
|
29
33
|
parts = value.split("'", -1).map { |part| "'#{part}'" }
|
data/support/travis.sh
CHANGED
@@ -4,11 +4,11 @@ sh -e /etc/init.d/xvfb start && git submodule update --init || exit 1
|
|
4
4
|
|
5
5
|
if [[ "$WATIR_WEBDRIVER_BROWSER" = "chrome" ]]; then
|
6
6
|
curl -L https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
7
|
-
sudo -s 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list'
|
7
|
+
sudo -s 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
8
8
|
sudo apt-get update
|
9
9
|
sudo apt-get -y install google-chrome-unstable unzip
|
10
10
|
# curl -k http://chromium.googlecode.com/files/chromedriver_linux32_14.0.836.0.zip | sudo -s 'funzip > /usr/bin/chromedriver'
|
11
|
-
sudo -s 'curl -L http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux/
|
11
|
+
sudo -s 'curl -L http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux/109799/chrome-linux.test/chromedriver > /usr/bin/chromedriver'
|
12
12
|
sudo chmod +x /usr/bin/chromedriver
|
13
13
|
fi
|
14
14
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jari Bakken
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-12-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: selenium-webdriver
|
@@ -296,3 +296,4 @@ test_files:
|
|
296
296
|
- spec/spec_helper.rb
|
297
297
|
- spec/special_chars_spec.rb
|
298
298
|
- spec/wait_spec.rb
|
299
|
+
has_rdoc:
|