Sha256: e70bcb5f2287e216dde856de99f3931723387eb1188b4dc2338ee14244ea9614

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluent-0.4.0 spec/mock_app.rb
fluent-0.3.0 spec/mock_app.rb
fluent-0.2.0 spec/mock_app.rb