watir-webdriver 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,11 +19,34 @@ require 'watir-webdriver/browser'
19
19
  module Watir
20
20
  include Selenium
21
21
 
22
+ @always_locate = true
23
+
22
24
  class << self
25
+ def always_locate?
26
+ @always_locate
27
+ end
28
+
29
+ #
30
+ # Whether or not Watir should cache element references or always re-locate an Element on use.
31
+ # Defaults to true.
32
+ #
33
+
34
+ def always_locate=(bool)
35
+ @always_locate = bool
36
+ end
37
+
38
+ #
39
+ # @api private
40
+ #
41
+
23
42
  def tag_to_class
24
43
  @tag_to_class ||= {}
25
44
  end
26
45
 
46
+ #
47
+ # @api private
48
+ #
49
+
27
50
  def element_class_for(tag_name)
28
51
  tag_to_class[tag_name.to_sym] || HTMLElement
29
52
  end
@@ -238,7 +238,11 @@ module Watir
238
238
  protected
239
239
 
240
240
  def assert_exists
241
- @element ||= (@selector[:element] || locate)
241
+ if @element and not Watir.always_locate?
242
+ return
243
+ end
244
+
245
+ @element = (@selector[:element] || locate)
242
246
 
243
247
  unless @element
244
248
  raise UnknownObjectException, "unable to locate element, using #{selector_string}"
@@ -19,6 +19,7 @@ module Watir
19
19
  end
20
20
 
21
21
  @element = nil # we need to re-locate every time
22
+
22
23
  super
23
24
  end
24
25
 
@@ -1,3 +1,3 @@
1
1
  module Watir
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,100 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.0
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.3.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Jari Bakken
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-02 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-08-13 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
15
17
  name: selenium-webdriver
16
- requirement: &2164747440 !ruby/object:Gem::Requirement
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
17
20
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
21
24
  version: 0.2.2
22
25
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2164747440
25
- - !ruby/object:Gem::Dependency
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
26
28
  name: rspec
27
- requirement: &2164746940 !ruby/object:Gem::Requirement
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
28
31
  none: false
29
- requirements:
32
+ requirements:
30
33
  - - ~>
31
- - !ruby/object:Gem::Version
34
+ - !ruby/object:Gem::Version
32
35
  version: 2.3.0
33
36
  type: :development
34
- prerelease: false
35
- version_requirements: *2164746940
36
- - !ruby/object:Gem::Dependency
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
37
39
  name: yard
38
- requirement: &2164746460 !ruby/object:Gem::Requirement
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
39
42
  none: false
40
- requirements:
43
+ requirements:
41
44
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '0.6'
45
+ - !ruby/object:Gem::Version
46
+ version: "0.6"
44
47
  type: :development
45
- prerelease: false
46
- version_requirements: *2164746460
47
- - !ruby/object:Gem::Dependency
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
48
50
  name: webidl
49
- requirement: &2164746000 !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
50
53
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
54
57
  version: 0.1.1
55
58
  type: :development
56
- prerelease: false
57
- version_requirements: *2164746000
58
- - !ruby/object:Gem::Dependency
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
59
61
  name: sinatra
60
- requirement: &2164745540 !ruby/object:Gem::Requirement
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
61
64
  none: false
62
- requirements:
65
+ requirements:
63
66
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '1.0'
67
+ - !ruby/object:Gem::Version
68
+ version: "1.0"
66
69
  type: :development
67
- prerelease: false
68
- version_requirements: *2164745540
69
- - !ruby/object:Gem::Dependency
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
70
72
  name: nokogiri
71
- requirement: &2164745160 !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
72
75
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
77
80
  type: :development
78
- prerelease: false
79
- version_requirements: *2164745160
80
- - !ruby/object:Gem::Dependency
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
81
83
  name: activesupport
82
- requirement: &2164744620 !ruby/object:Gem::Requirement
84
+ prerelease: false
85
+ requirement: &id007 !ruby/object:Gem::Requirement
83
86
  none: false
84
- requirements:
87
+ requirements:
85
88
  - - ~>
86
- - !ruby/object:Gem::Version
89
+ - !ruby/object:Gem::Version
87
90
  version: 2.3.5
88
91
  type: :development
89
- prerelease: false
90
- version_requirements: *2164744620
92
+ version_requirements: *id007
91
93
  description: WebDriver-backed Watir
92
- email:
94
+ email:
93
95
  - jari.bakken@gmail.com
94
96
  executables: []
97
+
95
98
  extensions: []
99
+
96
100
  extra_rdoc_files: []
97
- files:
101
+
102
+ files:
98
103
  - .document
99
104
  - .gitignore
100
105
  - .gitmodules
@@ -172,31 +177,35 @@ files:
172
177
  - spec/wait_spec.rb
173
178
  - support/html5.html
174
179
  - watir-webdriver.gemspec
180
+ has_rdoc: true
175
181
  homepage: http://github.com/jarib/watir-webdriver
176
182
  licenses: []
183
+
177
184
  post_install_message:
178
185
  rdoc_options: []
179
- require_paths:
186
+
187
+ require_paths:
180
188
  - lib
181
- required_ruby_version: !ruby/object:Gem::Requirement
189
+ required_ruby_version: !ruby/object:Gem::Requirement
182
190
  none: false
183
- requirements:
184
- - - ! '>='
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- required_rubygems_version: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: "0"
195
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
196
  none: false
189
- requirements:
190
- - - ! '>='
191
- - !ruby/object:Gem::Version
192
- version: '0'
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: "0"
193
201
  requirements: []
202
+
194
203
  rubyforge_project: watir-webdriver
195
- rubygems_version: 1.8.6
204
+ rubygems_version: 1.5.3
196
205
  signing_key:
197
206
  specification_version: 3
198
207
  summary: Watir on WebDriver
199
- test_files:
208
+ test_files:
200
209
  - spec/alert_spec.rb
201
210
  - spec/browser_spec.rb
202
211
  - spec/container_spec.rb