-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
82 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
# Capybara settings (not covered by Rails system tests) | ||
|
||
# Use a hostname accessible from the outside world | ||
# (Required for running tests in Docker) | ||
Capybara.server_host = `hostname`.strip&.downcase || "0.0.0.0" | ||
Capybara.app_host = "http://#{Capybara.server_host}" | ||
|
||
# Don't wait too long in `have_xyz` matchers | ||
Capybara.default_max_wait_time = 2 | ||
|
||
# Normalizes whitespaces when using `has_text?` and similar matchers | ||
Capybara.default_normalize_ws = true | ||
|
||
# Where to store artifacts (e.g. screenshots, downloaded files, etc.) | ||
Capybara.save_path = ENV.fetch("CAPYBARA_ARTIFACTS", "./tmp/capybara") | ||
|
||
Capybara.singleton_class.prepend(Module.new do | ||
attr_accessor :last_used_session | ||
|
||
def using_session(name, &block) | ||
self.last_used_session = name | ||
super | ||
ensure | ||
self.last_used_session = nil | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module SessionHelpers | ||
def within_session(...) | ||
Capybara.using_session(...) | ||
end | ||
|
||
def mark_all_banners_as_read! | ||
page.driver.set_cookie "show_banners", "N" | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.include SessionHelpers, type: :system | ||
|
||
config.before(type: :system) do | ||
mark_all_banners_as_read! | ||
end | ||
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
# system/support/ files contain system tests configurations and helpers | ||
Dir[File.join(__dir__, "system/support/**/*.rb")].sort.each { |file| require file } |