Sha256: 2ba8d3e559f877c4b57ae2d46ade43d6f930989ad629607ce42568a88e37c538

Contents?: true

Size: 1.4 KB

Versions: 50

Compression:

Stored size: 1.4 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 # rubocop:disable Lint/Debugger
end

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

Version data entries

50 entries across 50 versions & 14 rubygems

Version Path
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/simplecov-0.10.0/features/step_definitions/web_steps.rb
simplecov-0.10.0 features/step_definitions/web_steps.rb