Given(/^(\w+|I'm|a user) (?:on|visit(?:s)?) the ([A-Za-z\-_\/\?\@\=\.\&0-9]*) page$/) do |name, url|
  @context.visit_page(url, name)
end

Given("the {string} page exists") do |string|
  @context.create_page_from_configuration(string)
end

Given(/^the Blog Settings object exists$/) do
  @context.create_blog_settings!
end

When(/^(?:he )?enters (\w+) login credentials$/) do |credential_type|
  @context.enter_login_credentials(credential_type)
end

When(/^(?:he )?enters (\w+) support login credentials$/) do |credential_type|
  @context.enter_support_login_credentials(credential_type)
end

Then(/^(?:.*) should see "(.*?)"$/) do |text|
  @context.expect_content_on_page(text)
end

Then(/^(?:.*) should not see "(.+)"$/) do |text|
  @context.expect_content_not_on_page(text)
end

When(/^(?:.*)click(?:s)? the "(.*?)" button$/) do |button_text|
  @context.click_a_tag(button_text)
end

When(/^takes a break$/) do
  sleep 5
end

Then("I take a snapshot of {string} page") do |name|
  @context.percy_snapshot(name)
end
