Sha256: 7b0cf0d9dd6e5318ea5ed97dda70b4576ee547b486690736c81bc54e5b9341af

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
require 'rspec/expectations';
require 'watir-webdriver-performance'
require 'grid'

Given /^(\d+) users open "([^"]*)"$/ do |quantity, browser|
  params={}
  params[:controller_uri] = "druby://ec2-50-17-154-31.compute-1.amazonaws.com:11235"
  params[:browser] = browser    # type of webdriver browser to spawn
  params[:quantity] = quantity.to_i  # max number of browsers to use
  params[:rampup] = 10          # seconds
  @grid = Grid.new(params)
  @grid.setup
end

Given /^navigate to the portal$/ do
  @grid.iterate {|browser| browser.goto "http://gridinit.com/examples/logon.html" }
end

When /^they enter their credentials$/ do
  @grid.iterate do |browser|
    browser.text_field(:name => "email").set "tim@mahenterprize.com"
    browser.text_field(:name => "password").set "mahsecretz"
    browser.button(:type => "submit").click
  end
end

Then /^they should see their account settings$/ do
  @grid.iterate do |browser|
    browser.text.should =~ /Maybe I should get a real Gridinit account/
  end
end

Then /^the response time should be less than (\d+) seconds$/ do |response_time|
  @grid.iterate do |browser|
    browser.performance.summary[:response_time].should < response_time.to_i * 1000
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grid-0.4.3 examples/cucumber/step_definitions/example_steps.rb
grid-0.4.2 examples/cucumber/step_definitions/example_steps.rb