unittests/setup/watir-unittest.rb in commonwatir-1.8.0.rc1 vs unittests/setup/watir-unittest.rb in commonwatir-1.8.0
- old
+ new
@@ -10,10 +10,11 @@
def uses_page page # only works with IE
new_url = self.class.html_root + page
browser.goto new_url unless browser.url == new_url
end
def browser
- $browser
+ return $browser if $browser && $browser.exists?
+ $browser = Watir::Browser.new
end
def assert_class element, klass
assert_match(Regexp.new(klass, Regexp::IGNORECASE), element.class.to_s, "element class should be #{klass}; got #{element.class}")
end