spec/watirspec/browser_spec.rb in watir-webdriver-0.0.7 vs spec/watirspec/browser_spec.rb in watir-webdriver-0.0.8

- old
+ new

@@ -7,14 +7,16 @@ it "returns true if we are at a page" do browser.goto(WatirSpec.files + "/non_control_elements.html") browser.should exist end - it "returns false after Browser#close" do - b = WatirSpec.new_browser - b.close - b.should_not exist + bug "http://github.com/jarib/watir-webdriver/issues/issue/29", [:webdriver, :ie] do + it "returns false after Browser#close" do + b = WatirSpec.new_browser + b.close + b.should_not exist + end end end # this should be rewritten - the actual string returned varies alot between implementations describe "#html" do @@ -77,11 +79,11 @@ browser.goto(WatirSpec.host + "/non_control_elements.html") browser.url.should == WatirSpec.host + "/non_control_elements.html" end end - not_compliant_on [:webdriver, :ie] do # hang? + bug "http://github.com/jarib/watirspec/issues/issue/8" [:webdriver, :ie], [:webdriver, :chrome] do describe ".start" do it "goes to the given URL and return an instance of itself" do browser = WatirSpec.implementation.browser_class.start("#{WatirSpec.files}/non_control_elements.html") browser.should be_instance_of(WatirSpec.implementation.browser_class) browser.title.should == "Non-control elements" @@ -156,48 +158,48 @@ urls = [ "#{WatirSpec.host}/non_control_elements.html", "#{WatirSpec.host}/tables.html", "#{WatirSpec.host}/forms_with_input_elements.html", "#{WatirSpec.host}/definition_lists.html" ].map do |page| - browser.goto page - browser.url - end + browser.goto page + browser.url + end 3.times { browser.back } browser.url.should == urls.first 2.times { browser.forward } browser.url.should == urls[2] end end describe "#element_by_xpath" do - before :each do - browser.goto(WatirSpec.files + "/forms_with_input_elements.html") - end - - it "finds submit buttons matching the given xpath" do - browser.element_by_xpath("//input[@type='submit']").should exist - end - - it "finds reset buttons matching the given xpath" do - browser.element_by_xpath("//input[@type='reset']").should exist - end - - it "finds image buttons matching the given xpath" do - browser.element_by_xpath("//input[@type='image']").should exist - end - - it "finds the element matching the given xpath" do - browser.element_by_xpath("//input[@type='password']").should exist - end - - it "will not find elements that doesn't exist" do - e = browser.element_by_xpath("//input[@type='foobar']") - e.should_not exist - lambda { e.text }.should raise_error(UnknownObjectException) - end - end - + before :each do + browser.goto(WatirSpec.files + "/forms_with_input_elements.html") + end + + it "finds submit buttons matching the given xpath" do + browser.element_by_xpath("//input[@type='submit']").should exist + end + + it "finds reset buttons matching the given xpath" do + browser.element_by_xpath("//input[@type='reset']").should exist + end + + it "finds image buttons matching the given xpath" do + browser.element_by_xpath("//input[@type='image']").should exist + end + + it "finds the element matching the given xpath" do + browser.element_by_xpath("//input[@type='password']").should exist + end + + it "will not find elements that doesn't exist" do + e = browser.element_by_xpath("//input[@type='foobar']") + e.should_not exist + lambda { e.text }.should raise_error(UnknownObjectException) + end + end + describe "#elements_by_xpath" do before :each do browser.goto(WatirSpec.files + "/forms_with_input_elements.html") end