Sha256: fbee63144db6b905469f0f036077260796091a2dbb659bf808c5b43af54d8c9f

Contents?: true

Size: 1.37 KB

Versions: 14

Compression:

Stored size: 1.37 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
    expect(page).to have_content(text)
  end
end

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

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

Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
  regexp = Regexp.new(regexp)
  with_scope(selector) do
    expect(page).to 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

14 entries across 11 versions & 3 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.7 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.6 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.5 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.4 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.2 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
tdiary-5.0.1 vendor/bundle/gems/simplecov-0.9.2/features/step_definitions/web_steps.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/simplecov-0.9.0/features/step_definitions/web_steps.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/simplecov-0.9.0/features/step_definitions/web_steps.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/simplecov-0.9.0/features/step_definitions/web_steps.rb
simplecov-0.9.2 features/step_definitions/web_steps.rb
simplecov-0.9.1 features/step_definitions/web_steps.rb
simplecov-0.9.0 features/step_definitions/web_steps.rb