-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capybara instructions: https://docs.percy.io/docs/capybara
- Loading branch information
1 parent
b4e44b9
commit cd4858f
Showing
10 changed files
with
1,776 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
/.idea | ||
/spec/test_app/tmp/ | ||
/spec/test_app/log/ | ||
/node_modules | ||
yarn-debug.log* | ||
.yarn-integrity |
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,5 @@ | ||
{ | ||
"devDependencies": { | ||
"@percy/agent": "^0.1.17" | ||
} | ||
} |
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,17 @@ | ||
module ExamplesHelper | ||
def each_example | ||
example_files = Dir.glob File.expand_path("../../app/views/examples/**/*.html.erb", __dir__) | ||
|
||
example_files.each do |example_file| | ||
example_filepath = example_file.match(/app\/views\/examples\/(.*)\.html.erb/)[1] | ||
example_path = File.dirname(example_filepath) + "/" + File.basename(example_filepath).sub(/^_/, "") | ||
example_viewpath = "/cfa/styleguide/examples/#{example_path}" | ||
|
||
yield(example_path, example_viewpath, example_file) | ||
end | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.extend ExamplesHelper, type: :system | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "percy" | ||
|
||
module PercySnapshot | ||
def percy_snapshot(name) | ||
if ENV["PERCY_TOKEN"].present? | ||
Percy.snapshot(page, name: name) | ||
end | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.include PercySnapshot, type: :system | ||
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
Oops, something went wrong.