Skip to content

Instantly share code, notes, and snippets.

@jalama
Last active December 12, 2015 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalama/4692292 to your computer and use it in GitHub Desktop.
Save jalama/4692292 to your computer and use it in GitHub Desktop.
Cucumber set-up
loading env.rb
Feature: Example
Scenario: As a concerned internet citizen, I want to know if example.com is still up # features/example.feature:3
Given Log into site as "test00001" # features/step_definitions/common_steps.rb:21
unexpected response, code=401, content-type="text/html"
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Access Denied (authentication_failed)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your credentials can be verified.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
This is typically caused by an incorrect username and/or password, but could also be caused by network problems.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML> (Selenium::WebDriver::Error::WebDriverError)
./features/step_definitions/common_steps.rb:22:in `/^Log into site as "([^"]*)"$/'
features/example.feature:4:in `Given Log into site as "test00001"'
And I am visiting the homepage # features/step_definitions/common_steps.rb:28
Then I should see a title containing the word "VZWEB" # features/step_definitions/common_steps.rb:32
And I should see a title containing the word "VZWeb |" # features/step_definitions/common_steps.rb:32
And I should not see a title containing the word "Jive" # features/step_definitions/common_steps.rb:32
Scenario: As somebody visiting example.com I want to make sure that the search box is still working # features/example.feature:10
Given Log into site as "test00001" # features/step_definitions/common_steps.rb:21
unexpected response, code=401, content-type="text/html"
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Access Denied (authentication_failed)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your credentials can be verified.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
This is typically caused by an incorrect username and/or password, but could also be caused by network problems.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML> (Selenium::WebDriver::Error::WebDriverError)
./features/step_definitions/common_steps.rb:22:in `/^Log into site as "([^"]*)"$/'
features/example.feature:11:in `Given Log into site as "test00001"'
And I am visiting the homepage # features/step_definitions/common_steps.rb:28
And I search for 'VZWeb' # features/step_definitions/common_steps.rb:40
Then I should see a lot of search results # features/step_definitions/common_steps.rb:48
Scenario: As somebody visiting example.com, I want to make sure that there is no profanity to be found # features/example.feature:16
Given I am visiting the homepage # features/step_definitions/common_steps.rb:28
unexpected response, code=401, content-type="text/html"
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Access Denied (authentication_failed)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your credentials can be verified.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
This is typically caused by an incorrect username and/or password, but could also be caused by network problems.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML> (Selenium::WebDriver::Error::WebDriverError)
./features/step_definitions/common_steps.rb:29:in `/^I am visiting the homepage$/'
features/example.feature:17:in `Given I am visiting the homepage'
And I search for 'poop' # features/step_definitions/common_steps.rb:40
Then I should see no search results # features/step_definitions/common_steps.rb:48
Failing Scenarios:
cucumber features/example.feature:3 # Scenario: As a concerned internet citizen, I want to know if example.com is still up
cucumber features/example.feature:10 # Scenario: As somebody visiting example.com, I want to make sure that the search box is still working
cucumber features/example.feature:16 # Scenario: As somebody visiting example.com, I want to make sure that there is no profanity to be found
3 scenarios (3 failed)
12 steps (3 failed, 9 skipped)
0m34.283s
ruby "1.9.3"
source :rubygems
gem "capybara"
gem "cucumber"
gem "rspec"
gem "sinatra"
gem "benchmark-ips"
gem "thin"
gem "poltergeist", :path => "../gems/poltergeist"
gem "http_parser.rb"
puts "loading env.rb"
require 'rubygems'
require 'bundler/setup'
require 'http_parser.rb'
require 'capybara'
require 'capybara/dsl'
require "capybara/cucumber"
require "capybara/poltergeist"
require "selenium-webdriver"
require "rspec"
Capybara.register_driver :poltergeist do |app|
options = {
js_errors: false
}
Capybara::Poltergeist::Driver.new(app, options)
end
Capybara.default_driver = :poltergeist
Capybara.javascript_driver = :poltergeist
Capybara.app_host = ENV['CUCUMBER_TARGET']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment