Sha256: 158764d2583bcf9ab23ebe277b3ebc9a5b91f64930aaf3085be034a006643284

Contents?: true

Size: 1.36 KB

Versions: 71

Compression:

Stored size: 1.36 KB

Contents

module WithinHelpers
  def with_scope(locator)
    locator ? within(locator) { yield } : yield
  end
end
World(WithinHelpers)

When /^I open the coverage report$/ do
  visit '/'
end

Given /^(?:|I )am on (.+)$/ do |path|
  visit path
end

When /^(?:|I )go to (.+)$/ do |path|
  visit path
end

When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector|
  with_scope(selector) do
    click_button(button)
  end
end

When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector|
  with_scope(selector) do
    click_link(link)
  end
end

Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
  with_scope(selector) do
    page.should have_content(text)
  end
end

Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
  regexp = Regexp.new(regexp)
  with_scope(selector) do
    page.should have_xpath('//*', :text => regexp)
  end
end

Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
  with_scope(selector) do
    page.should have_no_content(text)
  end
end

Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
  regexp = Regexp.new(regexp)
  with_scope(selector) do
    page.should have_no_xpath('//*', :text => regexp)
  end
end

Then /^show me the page$/ do
  save_and_open_page
end

Then /^print the page$/ do
  puts page.body
end

Version data entries

71 entries across 53 versions & 7 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/features/step_definitions/web_steps.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/features/step_definitions/web_steps.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/features/step_definitions/web_steps.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/features/step_definitions/web_steps.rb
simplecov-0.8.2 features/step_definitions/web_steps.rb
simplecov-0.8.1 features/step_definitions/web_steps.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
candlepin-api-0.4.0 bundle/ruby/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
simplecov-0.8.0.pre2 features/step_definitions/web_steps.rb
challah-1.0.0 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
challah-1.0.0.beta3 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
challah-1.0.0.beta2 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
challah-1.0.0.beta vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
simplecov-0.8.0.pre features/step_definitions/web_steps.rb
challah-0.9.1.beta.3 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
devise_sociable-0.1.0 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
challah-0.9.1.beta vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb
challah-0.9.0 vendor/bundle/gems/simplecov-0.7.1/features/step_definitions/web_steps.rb