Sha256: 6854e52dd33e5fef8b1b3ef8b4a355a587835fb078355b6a86bcc60000389162

Contents?: true

Size: 1.94 KB

Versions: 8

Compression:

Stored size: 1.94 KB

Contents

Then /^"([^"]*)" should be selected for "([^"]*)"$/ do |value_or_text, field|
  is_value = find_field(field).value =~ /#{value_or_text}/
  is_text = field_labeled(field).find(:xpath, ".//option[text() = '#{value_or_text}']").selected?

  (is_value || is_text).should be_true
end

# @javascript only
Given /^I follow "([^"]*)" after "([^"]*)" loads$/ do |link, pending_content|
  wait_until{ !page.find(:css, pending_content).nil? }
  click_link(link)
end

# @javascript only
When /^(?:|I )select "([^"]*)" from "([^"]*)" after "([^"]*)" loads$/ do |value, field, pending_content|
  wait_until{ !page.find(:css, pending_content).nil? }
  select(value, :from => field)
end

# @javascript only
Then /^"([^"]*)" should be selected for "([^"]*)" after "([^"]*)" loads$/ do |value, field, pending_content|
  wait_until{ !page.find(:css, pending_content).nil? }
  step "\"#{value}\" should be selected for \"#{field}\""
end

When /^I accept the (?:popup|confirmation dialog)$/ do
  page.driver.browser.switch_to.alert.accept
end


Then /^"([^"]*)" should not contain option "([^"]*)"$/ do |field, value|
  field_labeled(field).has_no_xpath?(".//option[text() = '#{value}']").should be_true
end


Then /^the page title should contain "([^"]*)"$/ do |text|
    page.find('head title').text.include?(text).should be_true
end

Then /^"([^"]*)" should not be selected for "([^"]*)"$/ do |value, field|
  lambda{field_labeled(field).find(:xpath, ".//option[@selected][contains(string(), '#{value}')]") }.should raise_error
end

Then /^the (\d+)(?:st|nd|rd|th)(?: non-link|) item in the table should be "([^"]+)"$/ do |i, text|
  tables = page.all("table")
  tables.any?{ |table| table.all("tbody tr td")[i.to_i - 1].text.strip == text }.should be_true
end

Then /^the (\d+)(?:st|nd|rd|th)(?: non-link|) item in the table should start with "([^"]+)"$/ do |i, text|
  tables = page.all("table")
  tables.any?{ |table| table.all("tbody tr td")[i.to_i - 1].text.strip =~ /^#{text}/ }.should be_true
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scidea-schools-1.1 features/step_definitions/misc_steps.rb
scidea-schools-1.0.6 features/step_definitions/misc_steps.rb
scidea-schools-1.0.5 features/step_definitions/misc_steps.rb
scidea-schools-1.0.4 features/step_definitions/misc_steps.rb
scidea-schools-1.0.3 features/step_definitions/misc_steps.rb
scidea-schools-1.0.2 features/step_definitions/misc_steps.rb
scidea-schools-1.0.1 features/step_definitions/misc_steps.rb
scidea-schools-1.0.0 features/step_definitions/misc_steps.rb