spec/mock_app.rb in fluent-0.1.0 vs spec/mock_app.rb in fluent-0.2.0
- old
+ new
@@ -1,14 +1,31 @@
require 'watir-webdriver'
+require 'selenium-webdriver'
def mock_browser_for_watir
watir_browser = double('watir')
watir_browser.stub(:is_a?).with(Watir::Browser).and_return(true)
+ watir_browser.stub(:is_a?).with(Selenium::WebDriver::Driver).and_return(false)
watir_browser
end
+def mock_browser_for_selenium
+ selenium_browser = double('selenium')
+ selenium_browser.stub(:is_a?).with(Watir::Browser).and_return(false)
+ selenium_browser.stub(:is_a?).with(Selenium::WebDriver::Driver).and_return(true)
+ selenium_browser
+end
+
class TestDefinition
include Fluent
url_is 'http://localhost:4567'
title_is 'Test App'
+
+ look_for :name
+
+ text_field :name, id: 'name'
+
+ within_frame(id: 'frame') do |frame|
+ text_field :framedName, id: 'framedName', frame: frame
+ end
end
\ No newline at end of file