Sha256: 6fed4e9bd1ddf5d047795539f837d4b18d60805ea0cc995abdc1ababf5c5f74d

Contents?: true

Size: 793 Bytes

Versions: 10

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'
require 'page-object/page_factory'

class FactoryTestPageObject
  include PageObject
  page_url "http://google.com"
end

class TestWorld
  include PageObject::PageFactory

  attr_accessor :browser
end

describe PageObject::PageFactory do
  before(:each) do
    @world = TestWorld.new
    @world.browser = mock_watir_browser
  end

  it "should create a new page object and execute a block" do
    @world.browser.should_not_receive(:goto)
    @world.on_page FactoryTestPageObject do |page|
      page.should be_instance_of FactoryTestPageObject
    end
  end

  it "should create and visit a new page" do
    @world.browser.should_receive(:goto)
    @world.visit_page FactoryTestPageObject do |page|
      page.should be_instance_of FactoryTestPageObject
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
page-object-0.4.1 spec/page-object/page_factory_spec.rb
page-object-0.4.0 spec/page-object/page_factory_spec.rb
page-object-0.3.2 spec/page-object/page_factory_spec.rb
page-object-0.3.1 spec/page-object/page_factory_spec.rb
page-object-0.3.0 spec/page-object/page_factory_spec.rb
page-object-0.2.5 spec/page-object/page_factory_spec.rb
page-object-0.2.4 spec/page-object/page_factory_spec.rb
page-object-0.2.3 spec/page-object/page_factory_spec.rb
page-object-0.2.2 spec/page-object/page_factory_spec.rb
page-object-0.2.1 spec/page-object/page_factory_spec.rb