Sha256: 67772bf66e0e8057e3e89d9654bbd4c776ad529505f89d32f066a41faba5b267
Contents?: true
Size: 1.58 KB
Versions: 9
Compression:
Stored size: 1.58 KB
Contents
base = File.expand_path(File.dirname(__FILE__) + '/../../..') require base + '/lib/whirlwind' require base + '/elements/demo_elements' Before do @__cucumber_step_mother.delete_images @b = nil end After do puts "BLAH: #{@blah}" @b.close if @b.kind_of?(Watir::Browser) end Given /a supported browser (.+)/ do |browser| @b = browser end Then /the browser is allowed/ do screen_shot Constants::ALLOWED_BROWSERS.should include(@b.to_sym) end Given /an unsupported browser (.+)/ do |browser| screen_shot screen_shot #require 'ruby-debug';debugger @b = browser end Then /the browser is not allowed/ do Constants::ALLOWED_BROWSERS.should_not include(@b) end Given /a user has landed on a (.+)/ do |url| @element_info = HTTP::Validator.run(url) end Then /all resource elements should download with the correct size/ do @element_info.each_pair { |resource, values| values.each { |item| puts "Verifying #{resource} downloaded size #{item[:actual_size]} matches Content-Length #{item[:expected_size]}\n" item[:actual_size].should equal item[:expected_size] } } end Given /I have provided a block to the site with (.+)/ do |browser| Site.browser(:browser => browser) { |b| @b = b } end Then /the result should be the browser instances it returned and available inside of the block/ do @b.should be_a_kind_of(Watir::Browser) end Given /I have not provided a block to the site with (.+)/ do |browser| @b = Site.browser(:browser => browser) end Then /the result should be the browser instances it returned as a variable/ do @b.should be_a_kind_of(Watir::Browser) end
Version data entries
9 entries across 9 versions & 1 rubygems