Sha256: b5b8c070b1a992db73d050cd20b16b41125ad3eb73af499aada171573ccdfd2e

Contents?: true

Size: 975 Bytes

Versions: 3

Compression:

Stored size: 975 Bytes

Contents

Given /^I (?:open|visit|go to) the (.+\s?page)(.*)$/ do |page_name, args|
  $page_model = PageModels.create(page_name, args)
  $page_model.open!
  $page_model._verify!
end

Given /^I (?:try to|attempt to|fail to) (?:open|visit|go to) the (.+\s?page)(.*)$/ do |page_name, args|
  $page_model = PageModels.create(page_name, args)
  $page_model.open!
end

Then /^I should (?:see|be on) the (.+\s?page)(.*)$/ do |page_name, args|
  $page_model = PageModels.create(page_name, args)
  $page_model = self.page  
  $page_model._verify!
end

at_exit do
  driver = PageModels::Configuration.instance.driver
  driver.close if driver.class.to_s == "Watir::Browser"
end

module PageModels
  module PageModelMethodDelegation
    def method_missing(name, *args, &block)
      if $page_model && $page_model.respond_to?(name)
        $page_model.send(name, *args, &block) 
      else
        super(name, *args, &block)
      end
    end
  end
end
World(PageModels::PageModelMethodDelegation)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pagemodels-0.2.3 lib/page_models/integration/cucumber.rb
pagemodels-0.2.2 lib/page_models/integration/cucumber.rb
pagemodels-0.2.1 lib/page_models/integration/cucumber.rb