Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Update to clear page cache before each test run
Browse files Browse the repository at this point in the history
This protects against potential cache polution from other tests that was
previously observed with Whitehall. As such we have switched these to
use the old method rather than the workaround
  • Loading branch information
RyanMacG committed Feb 21, 2018
1 parent 3db2a20 commit 3d1ec25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
=end

config.add_setting :reload_page_wait_time, default: 60

config.before(:each) do
page.driver.clear_memory_cache
end
end

Capybara.configure do |config|
Expand Down
2 changes: 1 addition & 1 deletion spec/whitehall/publishing_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def then_i_can_view_it_on_gov_uk
def and_it_is_displayed_on_the_publication_finder
publication_finder = find('a', text: "Publications", match: :first)[:href]
reload_url_until_match(publication_finder, :has_text?, title)
click_link("Publications", match: :first)
visit(publication_finder)

expect_rendering_application("whitehall")
expect(page).to have_content(title)
Expand Down
2 changes: 1 addition & 1 deletion spec/whitehall/updating_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def then_i_can_view_the_updated_content_on_gov_uk
def and_it_is_updated_on_the_publication_finder
publication_finder = find('a', text: "Publications", match: :first)[:href]
reload_url_until_match(publication_finder, :has_text?, updated_title)
click_link("Publications", match: :first)
visit(publication_finder)

expect_rendering_application("whitehall")
expect(page).to have_content(updated_title)
Expand Down

0 comments on commit 3d1ec25

Please sign in to comment.