Sha256: 78f1aeb04859bf635ab2d91a312dd6973b42a4cb827363113e0ee439cbe79303

Contents?: true

Size: 1.72 KB

Versions: 5

Compression:

Stored size: 1.72 KB

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-3.0.0pre6 test_support/features/step_definitions/general_steps.rb
blacklight-3.0.0pre4 test_support/features/step_definitions/general_steps.rb
blacklight-3.0.0pre3 test_support/features/step_definitions/general_steps.rb
blacklight-3.0pre2 test_support/features/step_definitions/general_steps.rb
blacklight-3.0pre1 test_app/features/step_definitions/general_steps.rb