watir-webdriver 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -8,4 +8,5 @@ rdoc
8
8
  .yardoc
9
9
  Gemfile.lock
10
10
  .rvmrc
11
- *.rbc
11
+ *.rbc
12
+ .rbx/*
data/.travis.yml CHANGED
@@ -1,8 +1,12 @@
1
1
  rvm:
2
2
  - 1.9.2
3
+ - 1.9.3
3
4
  notifications:
4
5
  recipients:
5
6
  - jari.bakken@gmail.com
6
7
  irc: "irc.freenode.net#watir"
7
- before_script:
8
- - git submodule update --init
8
+ before_script:
9
+ - support/travis.sh
10
+ env:
11
+ - WATIR_WEBDRIVER_BROWSER=firefox
12
+ - WATIR_WEBDRIVER_BROWSER=chrome
data/README.md CHANGED
@@ -4,6 +4,8 @@ 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
+ [![Build Status](https://secure.travis-ci.org/jarib/watir-webdriver.png)](http://travis-ci.org/jarib/watir-webdriver)
8
+
7
9
  API docs
8
10
  --------
9
11
 
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -116,7 +116,7 @@ module Watir
116
116
  handle = if @selector.has_key?(:index)
117
117
  @driver.window_handles[Integer(@selector[:index])]
118
118
  else
119
- @driver.window_handles.find { |handle| matches?(handle) }
119
+ @driver.window_handles.find { |wh| matches?(wh) }
120
120
  end
121
121
 
122
122
  handle or raise Exception::NoMatchingWindowFoundException, @selector.inspect
@@ -129,6 +129,9 @@ module Watir
129
129
 
130
130
  matches_title && matches_url
131
131
  }
132
+ rescue Selenium::WebDriver::Error::NoSuchWindowError, Selenium::WebDriver::Error::NoSuchDriverError
133
+ # the window may disappear while we're iterating.
134
+ false
132
135
  end
133
136
 
134
137
  end # Window
data/spec/browser_spec.rb CHANGED
@@ -66,14 +66,12 @@ describe Watir::Browser do
66
66
  end
67
67
  end
68
68
 
69
- not_compliant_on [:webdriver, :chrome] do
70
- it "raises an error when trying to interact with a closed browser" do
71
- b = WatirSpec.new_browser
72
- b.goto(WatirSpec.files + "/definition_lists.html")
73
- b.close
69
+ it "raises an error when trying to interact with a closed browser" do
70
+ b = WatirSpec.new_browser
71
+ b.goto(WatirSpec.files + "/definition_lists.html")
72
+ b.close
74
73
 
75
- lambda { b.dl(:id => "experience-list").id }.should raise_error(Error, "browser was closed")
76
- end
74
+ lambda { b.dl(:id => "experience-list").id }.should raise_error(Error, "browser was closed")
77
75
  end
78
76
 
79
77
  describe "#wait_while" do
data/spec/html/wait.html CHANGED
@@ -23,6 +23,6 @@
23
23
  <div id="bar" style="display:none;" onclick='this.innerHTML = "changed"'>bar</div>
24
24
  <a id="show_bar" href="#" onclick="setTimeoutDisplay('bar', 'block', 500);">show bar</a>
25
25
  <a id="hide_foo" href="#" onclick="setTimeoutDisplay('foo', 'none', 500);">hide foo</a>
26
- <a id="remove_foo" href="#" onclick="setTimeoutRemove('foo', 500);">remove foo</a>
26
+ <a id="remove_foo" href="#" onclick="setTimeoutRemove('foo', 1000);">remove foo</a>
27
27
  </body>
28
28
  </html>
data/spec/spec_helper.rb CHANGED
@@ -20,10 +20,9 @@ include Watir::Exception
20
20
  WEBDRIVER_SELECTORS = [:class, :class_name, :css, :id, :name, :tag_name, :xpath]
21
21
 
22
22
  if ENV['TRAVIS']
23
- require 'headless'
24
- display = Headless.new
25
- display.start
23
+ ENV['DISPLAY'] = ":99.0"
24
+ end
26
25
 
27
- pid = Process.pid
28
- at_exit { display.stop if Process.pid == pid }
26
+ if Selenium::WebDriver::Platform.linux? && ENV['DISPLAY'].nil?
27
+ raise "DISPLAY not set"
29
28
  end
data/spec/wait_spec.rb CHANGED
@@ -93,16 +93,11 @@ describe Watir::Element do
93
93
  end
94
94
 
95
95
  describe "#wait_while_present" do
96
- it "invokes subsequent methods after waiting until the element's disappearance" do
96
+ it "waits until the element disappears" do
97
97
  browser.a(:id, 'hide_foo').click
98
98
  browser.div(:id, 'foo').wait_while_present(1)
99
99
  end
100
100
 
101
- it "invokes subsequent methods after waiting until the element's removal" do
102
- browser.a(:id, 'remove_foo').click
103
- browser.div(:id, 'foo').wait_while_present(1)
104
- end
105
-
106
101
  it "times out" do
107
102
  lambda do
108
103
  browser.div(:id, 'foo').wait_while_present(1)
data/support/travis.sh ADDED
@@ -0,0 +1,14 @@
1
+ #/bin/sh
2
+
3
+ sh -e /etc/init.d/xvfb start && git submodule update --init || exit 1
4
+
5
+ if [[ "$WATIR_WEBDRIVER_BROWSER" = "chrome" ]]; then
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'
8
+ sudo apt-get update
9
+ sudo apt-get -y install google-chrome-unstable unzip
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/102682/chrome-linux.test/chromedriver > /usr/bin/chromedriver'
12
+ sudo chmod +x /usr/bin/chromedriver
13
+ fi
14
+
@@ -21,11 +21,10 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency "selenium-webdriver", '>= 0.2.2'
23
23
 
24
- s.add_development_dependency "rspec", "~> 2.3.0"
24
+ s.add_development_dependency "rspec", "~> 2.6"
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
28
  s.add_development_dependency "rake", "~> 0.9.2"
30
29
  s.add_development_dependency "fuubar", "~> 0.0.6"
31
30
  s.add_development_dependency "nokogiri"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-23 00:00:00.000000000Z
12
+ date: 2011-10-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &2166058680 !ruby/object:Gem::Requirement
16
+ requirement: &2169429060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: 0.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2166058680
24
+ version_requirements: *2169429060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &2166057780 !ruby/object:Gem::Requirement
27
+ requirement: &2169428560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 2.3.0
32
+ version: '2.6'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2166057780
35
+ version_requirements: *2169428560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: yard
38
- requirement: &2166057120 !ruby/object:Gem::Requirement
38
+ requirement: &2169427520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.6'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2166057120
46
+ version_requirements: *2169427520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webidl
49
- requirement: &2166056540 !ruby/object:Gem::Requirement
49
+ requirement: &2169426200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.1.1
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2166056540
57
+ version_requirements: *2169426200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sinatra
60
- requirement: &2166055760 !ruby/object:Gem::Requirement
60
+ requirement: &2169412600 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,21 +65,10 @@ dependencies:
65
65
  version: '1.0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2166055760
69
- - !ruby/object:Gem::Dependency
70
- name: headless
71
- requirement: &2166054120 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- version: '0.2'
77
- type: :development
78
- prerelease: false
79
- version_requirements: *2166054120
68
+ version_requirements: *2169412600
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: rake
82
- requirement: &2166052140 !ruby/object:Gem::Requirement
71
+ requirement: &2169411380 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
74
  - - ~>
@@ -87,10 +76,10 @@ dependencies:
87
76
  version: 0.9.2
88
77
  type: :development
89
78
  prerelease: false
90
- version_requirements: *2166052140
79
+ version_requirements: *2169411380
91
80
  - !ruby/object:Gem::Dependency
92
81
  name: fuubar
93
- requirement: &2166051540 !ruby/object:Gem::Requirement
82
+ requirement: &2169410480 !ruby/object:Gem::Requirement
94
83
  none: false
95
84
  requirements:
96
85
  - - ~>
@@ -98,10 +87,10 @@ dependencies:
98
87
  version: 0.0.6
99
88
  type: :development
100
89
  prerelease: false
101
- version_requirements: *2166051540
90
+ version_requirements: *2169410480
102
91
  - !ruby/object:Gem::Dependency
103
92
  name: nokogiri
104
- requirement: &2166044680 !ruby/object:Gem::Requirement
93
+ requirement: &2169409940 !ruby/object:Gem::Requirement
105
94
  none: false
106
95
  requirements:
107
96
  - - ! '>='
@@ -109,10 +98,10 @@ dependencies:
109
98
  version: '0'
110
99
  type: :development
111
100
  prerelease: false
112
- version_requirements: *2166044680
101
+ version_requirements: *2169409940
113
102
  - !ruby/object:Gem::Dependency
114
103
  name: activesupport
115
- requirement: &2166043680 !ruby/object:Gem::Requirement
104
+ requirement: &2169409400 !ruby/object:Gem::Requirement
116
105
  none: false
117
106
  requirements:
118
107
  - - ~>
@@ -120,7 +109,7 @@ dependencies:
120
109
  version: 2.3.5
121
110
  type: :development
122
111
  prerelease: false
123
- version_requirements: *2166043680
112
+ version_requirements: *2169409400
124
113
  description: WebDriver-backed Watir
125
114
  email:
126
115
  - jari.bakken@gmail.com
@@ -205,6 +194,7 @@ files:
205
194
  - spec/special_chars_spec.rb
206
195
  - spec/wait_spec.rb
207
196
  - support/html5.html
197
+ - support/travis.sh
208
198
  - watir-webdriver.gemspec
209
199
  homepage: http://github.com/jarib/watir-webdriver
210
200
  licenses: []