Sha256: 583a4e60d859e3b804944426583bd84454f8156910951f512af17d8edb6df34e

Contents?: true

Size: 1.74 KB

Versions: 30

Compression:

Stored size: 1.74 KB

Contents

# -*- encoding : utf-8 -*-
When /^I follow "([^\"]*)" in "([^\"]*)"$/ do |link, scope|
  within(scope) do
    click_link(link)
  end
end

Then /^I should see a stylesheet/ do
  page.should have_selector("link[rel=stylesheet]")
end

Then /I should see "(.*)" (at least|at most|exactly) (.*) times?$/i do |target, comparator, expected_num|
  actual_num = page.split(target).length - 1
  case comparator
    when "at least"
      actual_num.should >= expected_num.to_i
    when "at most"
      actual_num.should <= expected_num.to_i
    when "exactly"
      actual_num.should == expected_num.to_i
  end
end

Then /I should see a "(.*)" element with "(.*)" = "(.*)" (at least|at most|exactly) (.*) times?$/i do |target, type, selector,comparator, expected_num|
  actual_num = page.all("#{target}[#{type}=\"#{selector}\"]").length
  case comparator
    when "at least"
      actual_num.should >= expected_num.to_i
    when "at most"
      actual_num.should <= expected_num.to_i
    when "exactly"
      actual_num.should == expected_num.to_i
  end
end          

Then /^I (should not|should) see an? "([^\"]*)" element with an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,elem,attribute,value|
  if bool == "should not"
    page.should_not have_selector("#{elem}[#{attribute}=#{value}]")
  else
    page.should have_selector("#{elem}[#{attribute}=#{value}]")
  end
end

Then /^I (should not|should) see an? "([^\"]*)" element with an? "([^\"]*)" attribute of "([^\"]*)" and an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,elem,attribute,value,attribute2,value2|
  if bool == "should not"
    page.should_not have_selector("#{elem}[#{attribute}=#{value}][#{attribute2}=#{value2}]")
  else
    page.should have_selector("#{elem}[#{attribute}=#{value}][#{attribute2}=#{value2}]")
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
blacklight-4.3.0 features/step_definitions/general_steps.rb
blacklight-4.2.2 features/step_definitions/general_steps.rb
blacklight-4.2.1 features/step_definitions/general_steps.rb
blacklight-4.2.0 features/step_definitions/general_steps.rb
blacklight-4.1.0 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.1 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.0 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.0.rc2 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.0.rc1 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.0.pre7 test_support/features/step_definitions/general_steps.rb
blacklight-4.0.0.pre6 test_support/features/step_definitions/general_steps.rb
atrium-0.0.1 test_support/features/step_definitions/general_steps.rb
atrium-0.0.1.alpha test_support/features/step_definitions/general_steps.rb
blacklight-3.4.2 test_support/features/step_definitions/general_steps.rb
blacklight-3.4.1 test_support/features/step_definitions/general_steps.rb
blacklight-3.4.0 test_support/features/step_definitions/general_steps.rb
blacklight-3.3.2 test_support/features/step_definitions/general_steps.rb
blacklight-3.3.1 test_support/features/step_definitions/general_steps.rb
blacklight-3.3.0 test_support/features/step_definitions/general_steps.rb
blacklight-3.2.2 test_support/features/step_definitions/general_steps.rb