Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from alphagov/revert-234-fix-smokey-tests
Revert "Restore Poltergeist and fix Smokey tests"
- Loading branch information
Showing
31 changed files
with
193 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
Feature: Private Frontend | ||
|
||
@normal | ||
Scenario: check private frontend requires auth | ||
Background: | ||
Given I am testing "private-frontend" | ||
And I am not an authenticated user | ||
When I try to request "/" | ||
|
||
@normal | ||
Scenario: check private frontend requires auth | ||
When I try to visit "/" | ||
Then I should get a 401 status code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
require 'json' | ||
|
||
Then /^JSON is returned$/ do | ||
JSON.parse(@response.body).class.should == Hash | ||
Then /^I should see a consistent JSON format for the path "([^"]*)"$/ do |path| | ||
json = get_request "#{@host}#{path}", cache_bust: @bypass_varnish | ||
json = JSON.parse(json) | ||
assert json["england-and-wales"] | ||
assert json["england-and-wales"]["events"] | ||
assert json["england-and-wales"]["events"].length | ||
result = json["england-and-wales"]["events"].first | ||
assert result["title"] | ||
assert result["date"] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
Given /^I cannot see the logout button$/ do | ||
page.has_selector?("#logout").should == false | ||
Given /^I am testing in an EFG context$/ do | ||
# Not sure if there is a better way to do this? | ||
page.driver.browser.agent.add_auth(efg_base_url, ENV['AUTH_USERNAME'], ENV['AUTH_PASSWORD']) | ||
end | ||
|
||
When /^I try to access the list of lenders$/ do | ||
visit_path "#{efg_base_url}/lenders" | ||
visit "#{efg_base_url}/lenders" | ||
end | ||
|
||
When /^I try to login as a valid EFG user$/ do | ||
assert ENV["EFG_USERNAME"] && ENV["EFG_PASSWORD"], "Please ensure that the EFG user credentials are available in the environment" | ||
|
||
# Need to do it this way to comply with CSRF protection | ||
visit_path "#{efg_base_url}/users/sign_in" | ||
visit "#{efg_base_url}/users/sign_in" | ||
fill_in "Username", :with => ENV["EFG_USERNAME"] | ||
fill_in "Password", :with =>ENV["EFG_PASSWORD"] | ||
click_button "Sign In" | ||
end | ||
|
||
When /^I visit the EFG home page$/ do | ||
visit_path "#{efg_base_url}" | ||
visit "#{efg_base_url}" | ||
end | ||
|
||
Then /^I should be on the EFG home page$/ do | ||
page.has_selector?("#user_username").should == true | ||
page.has_selector?("#user_password").should == true | ||
page.has_selector?("#user_username").should == true # username input field | ||
page.has_selector?("#user_password").should == true # password input field | ||
end | ||
|
||
Then /^I should be on the EFG post-login page$/ do | ||
page.has_selector?("#logout").should == true | ||
page.has_selector?(".alert-success").should == true # Signed in successfully message | ||
page.has_selector?("#welcome_message").should == true # Welcome back, first_name | ||
page.has_selector?("#logout").should == true # page has a logout link | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Then /^I should see an input field to search$/ do | ||
page.body.should have_field('keywords') | ||
@response.body.should have_field('keywords') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
When /^I click on the section "(.*?)"$/ do |section_name| | ||
link_href = Nokogiri::HTML.parse(page.body).at_xpath("//h3[text()='#{section_name}']/../@href") | ||
link_href = Nokogiri::HTML.parse(@response.body).at_xpath("//h3[text()='#{section_name}']/../@href") | ||
link_href.should_not == nil | ||
step "I visit \"#{link_href.value}\"" | ||
end | ||
|
||
Then /^I should see an input field for postcode$/ do | ||
page.body.should have_field('postcode') | ||
@response.body.should have_field('postcode') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
When /^I login to Licensify$/ do | ||
visit_path "https://licensify-admin.#{ENV['GOVUK_APP_DOMAIN']}/login" | ||
visit "https://licensify-admin.#{ENV['GOVUK_APP_DOMAIN']}/login" | ||
click_button 'Login' | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.