spec/symbiont/enclosers_spec.rb in symbiont-0.1.6 vs spec/symbiont/enclosers_spec.rb in symbiont-0.1.7
- old
+ new
@@ -13,11 +13,11 @@
web_object.should be_instance_of Symbiont::WebObjects::TextField
end
it "should wait for a condition to be true" do
watir_browser.should_receive(:wait_until).with(5, "some condition")
- watir_definition.wait_for("some condition", 5)
+ watir_definition.wait_for(5, "some condition")
end
it "should handle alert message boxes" do
watir_browser.should_receive(:wd).twice.and_return(watir_browser)
watir_browser.should_receive(:execute_script).twice
@@ -35,8 +35,20 @@
it "should handle prompt message boxes" do
watir_browser.should_receive(:wd).twice.and_return(watir_browser)
watir_browser.should_receive(:execute_script).twice
watir_definition.will_prompt("Question") do
end
+ end
+
+ it "attaches to a window by using the title" do
+ watir_browser.should_receive(:window).with(:title => /Display\ Results/).and_return(watir_browser)
+ watir_browser.should_receive(:use)
+ watir_definition.within_window(title: "Display Results")
+ end
+
+ it "attaches to a window by using the url" do
+ watir_browser.should_receive(:window).with(:url => /results\.html/).and_return(watir_browser)
+ watir_browser.should_receive(:use)
+ watir_definition.within_window(url: "results.html")
end
end
end