Remove Percy (#8915)
We are no longer using the Percy service, so this code is not required anymore. Removes the percy agent, the gem, and all references to Percy.snapshot and percy: true.
This commit is contained in:
parent
80f648c837
commit
d2ef01ecc2
45 changed files with 55 additions and 966 deletions
1
Gemfile
1
Gemfile
|
|
@ -153,7 +153,6 @@ group :test do
|
|||
gem "exifr", ">= 1.3.6" # EXIF Reader is a module to read EXIF from JPEG and TIFF images
|
||||
gem "factory_bot_rails", "~> 6.0" # factory_bot is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies
|
||||
gem "launchy", "~> 2.5" # Launchy is helper class for launching cross-platform applications in a fire and forget manner.
|
||||
gem "percy-capybara", "~> 4.2.0" # A tool for visual testing
|
||||
gem "pundit-matchers", "~> 1.6" # A set of RSpec matchers for testing Pundit authorisation policies
|
||||
gem "rspec-retry", "~> 0.6" # retry intermittently failing rspec examples
|
||||
gem "ruby-prof", "~> 1.4", require: false # ruby-prof is a fast code profiler for Ruby
|
||||
|
|
|
|||
|
|
@ -553,7 +553,6 @@ GEM
|
|||
parser (2.7.1.4)
|
||||
ast (~> 2.4.1)
|
||||
patron (0.13.3)
|
||||
percy-capybara (4.2.0)
|
||||
pg (1.2.3)
|
||||
polyamorous (2.3.2)
|
||||
activerecord (>= 5.2.1)
|
||||
|
|
@ -966,7 +965,6 @@ DEPENDENCIES
|
|||
omniauth-github (~> 1.3)
|
||||
omniauth-twitter (~> 1.4)
|
||||
patron (~> 0.13.3)
|
||||
percy-capybara (~> 4.2.0)
|
||||
pg (~> 1.2)
|
||||
pry (~> 0.13)
|
||||
pry-byebug (~> 3.8)
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ We use the following testing tools:
|
|||
for testing Preact components
|
||||
- [**SimpleCov**](https://github.com/colszowka/simplecov) for tracking overall
|
||||
test coverage on the backend
|
||||
- [**Percy**](https://percy.io/) for visual regression testing. Currently
|
||||
inactive.
|
||||
|
||||
We strive to provide tests for each pull request that adds new features or fixes
|
||||
a bug. Ideally, we test the functionality of the frontend and the backed.
|
||||
|
|
|
|||
|
|
@ -33,15 +33,3 @@ helping to ensure your patch fixes the bug.
|
|||
[acceptance_tests]: /tests/acceptance-tests/
|
||||
[integration_tests]: /tests/integration-tests/
|
||||
[ci]: /deployment/
|
||||
|
||||
# [Percy](https://percy.io/)
|
||||
|
||||
Percy is a tool that can be used to do visual regression testing. Percy renders
|
||||
and compares snapshots across browsers and screens to detect, highlight, and
|
||||
group visual differences. This allows users to quickly find visual regression issues. Currently,
|
||||
**Percy is inactive in our test suite** due to some integration issues. We are
|
||||
not sure if we will try to reimplement it in the future so for now we have
|
||||
decided to leave the code as is. You will notice `Percy.snapshot` being called
|
||||
in multiple tests. That method has been stubbed in our `rails_helper.rb` file to ensure that
|
||||
we don't waste resources taking snapshots. You will also notice some specs that
|
||||
only take Percy snapshots have been commented out.
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@
|
|||
},
|
||||
"homepage": "https://github.com/thepracticaldev/dev.to#readme",
|
||||
"devDependencies": {
|
||||
"@percy/agent": "^0.26.9",
|
||||
"@stoplight/spectral": "5.4.0",
|
||||
"@storybook/addon-a11y": "^5.3.19",
|
||||
"@storybook/addon-actions": "^5.3.19",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
|
|||
|
||||
# Add additional requires below this line. Rails is not loaded until this point!
|
||||
|
||||
require "percy"
|
||||
require "pundit/matchers"
|
||||
require "pundit/rspec"
|
||||
require "webmock/rspec"
|
||||
|
|
@ -166,9 +165,6 @@ RSpec.configure do |config|
|
|||
"Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
|
||||
"User-Agent" => "Ruby"
|
||||
}).to_return(status: 200, body: "", headers: {})
|
||||
# Prevent Percy.snapshot from trying to hit the agent while not in use
|
||||
|
||||
allow(Percy).to receive(:snapshot)
|
||||
end
|
||||
|
||||
config.after do
|
||||
|
|
@ -193,16 +189,4 @@ RSpec.configure do |config|
|
|||
config.filter_rails_from_backtrace!
|
||||
# arbitrary gems may also be filtered via:
|
||||
# config.filter_gems_from_backtrace("gem name")
|
||||
|
||||
# Explicitly set a seed and time to ensure deterministic Percy snapshots.
|
||||
# config.around(:each, percy: true) do |example|
|
||||
# Timecop.freeze("2020-05-13T10:00:00Z")
|
||||
# prev_random_seed = Faker::Config.random
|
||||
# Faker::Config.random = Random.new(42)
|
||||
|
||||
# example.run
|
||||
|
||||
# Faker::Config.random = prev_random_seed
|
||||
# Timecop.return
|
||||
# end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,17 +8,15 @@ RSpec.describe "Admin dashboard is presented", type: :system do
|
|||
|
||||
after { Bullet.raise = true }
|
||||
|
||||
it "loads the admin dashboard articles view", js: true, percy: true do
|
||||
it "loads the admin dashboard articles view", js: true do
|
||||
sign_in admin
|
||||
visit "/admin"
|
||||
Percy.snapshot(page, name: "Admin dashboard: renders articles")
|
||||
expect(page).to have_content("Articles")
|
||||
end
|
||||
|
||||
it "loads the admin dashboard podcasts view", js: true, percy: true do
|
||||
it "loads the admin dashboard podcasts view", js: true do
|
||||
sign_in admin
|
||||
visit "/admin/podcasts"
|
||||
Percy.snapshot(page, name: "Admin dashboard: renders podcasts")
|
||||
expect(page).to have_content("Podcast Episodes")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -11,19 +11,15 @@ RSpec.describe "Views an article", type: :system do
|
|||
visit "/#{user.username}/#{article.slug}/mod"
|
||||
end
|
||||
|
||||
it "shows an article", js: true, percy: true do
|
||||
it "shows an article", js: true do
|
||||
visit "/#{user.username}/#{article.slug}"
|
||||
|
||||
Percy.snapshot(page, name: "Moderators: renders an article")
|
||||
|
||||
expect(page).to have_content(article.title)
|
||||
end
|
||||
|
||||
it "lets moderators visit /mod", js: true, percy: true do
|
||||
it "lets moderators visit /mod", js: true do
|
||||
visit "/#{user.username}/#{article.slug}/mod"
|
||||
|
||||
Percy.snapshot(page, name: "Moderators: renders /mod")
|
||||
|
||||
expect(page).to have_content("Moderate: #{article.title}")
|
||||
expect(page).to have_selector('button[data-category="thumbsdown"][data-reactable-type="Article"]')
|
||||
expect(page).to have_selector('button[data-category="vomit"][data-reactable-type="Article"]')
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@ RSpec.describe "Creating an article with the editor", type: :system do
|
|||
sign_in user
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
visit new_path
|
||||
fill_in "article_body_markdown", with: template
|
||||
click_button "Save changes"
|
||||
Percy.snapshot(page, name: "Creating an article: shows the title")
|
||||
end
|
||||
|
||||
it "creates a new article", js: true, retry: 3 do
|
||||
visit new_path
|
||||
fill_in "article_body_markdown", with: template
|
||||
|
|
|
|||
|
|
@ -10,12 +10,6 @@ RSpec.describe "Deleting Article", type: :system do
|
|||
click_on "DELETE"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
# Take snapshot before confirming deletion
|
||||
Percy.snapshot(page, name: "Article: confirm deletion")
|
||||
end
|
||||
|
||||
it "author of article deletes own article", js: true do
|
||||
click_on "DELETE" # This is for confirming deletion
|
||||
expect(page).to have_text("Write your first post now")
|
||||
|
|
|
|||
|
|
@ -9,14 +9,6 @@ RSpec.describe "Editing with an editor", type: :system, js: true do
|
|||
sign_in user
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page when user previews their changes", percy: true do
|
||||
visit "/#{user.username}/#{article.slug}/edit"
|
||||
fill_in "article_body_markdown", with: template.gsub("Suspendisse", "Yooo")
|
||||
click_button("Preview")
|
||||
Percy.snapshot(page, name: "Editing an article: shows the title")
|
||||
end
|
||||
|
||||
it "user previews their changes" do
|
||||
visit "/#{user.username}/#{article.slug}/edit"
|
||||
fill_in "article_body_markdown", with: template.gsub("Suspendisse", "Yooo")
|
||||
|
|
@ -37,12 +29,4 @@ RSpec.describe "Editing with an editor", type: :system, js: true do
|
|||
click_button("Save changes")
|
||||
expect(page).to have_text("Unpublished Post.")
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page when user unpublishes their post", percy: true do
|
||||
visit "/#{user.username}/#{article.slug}/edit"
|
||||
fill_in "article_body_markdown", with: template.gsub("true", "false")
|
||||
click_button("Save changes")
|
||||
Percy.snapshot(page, name: "Editing an article: shows when unpublished")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,17 +11,15 @@ RSpec.describe "Views an article", type: :system do
|
|||
sign_in user
|
||||
end
|
||||
|
||||
it "shows an article", js: true, percy: true do
|
||||
it "shows an article", js: true do
|
||||
visit article.path
|
||||
Percy.snapshot(page, name: "Article: renders")
|
||||
expect(page).to have_content(article.title)
|
||||
end
|
||||
|
||||
it "shows comments", js: true, percy: true do
|
||||
it "shows comments", js: true do
|
||||
create_list(:comment, 3, commentable: article)
|
||||
|
||||
visit article.path
|
||||
Percy.snapshot(page, name: "Article: shows comments")
|
||||
expect(page).to have_selector(".single-comment-node", visible: :visible, count: 3)
|
||||
end
|
||||
|
||||
|
|
@ -70,12 +68,6 @@ RSpec.describe "Views an article", type: :system do
|
|||
let(:crossposted_article) { create(:article) }
|
||||
let(:article2) { create(:article) }
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the articles in ascending order considering crossposted_at", js: true, percy: true do
|
||||
visit article1.path
|
||||
Percy.snapshot(page, name: "Articles: renders crossposted articles")
|
||||
end
|
||||
|
||||
# rubocop:disable RSpec/ExampleLength
|
||||
it "lists the articles in ascending order considering crossposted_at" do
|
||||
article1.update_columns(
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ RSpec.describe "Viewing an article stats", type: :system, js: true do
|
|||
let(:user) { create(:user) }
|
||||
let(:article) { create(:article, user: user) }
|
||||
|
||||
it "shows stats for pro users by clicking on the stats button", percy: true do
|
||||
it "shows stats for pro users by clicking on the stats button" do
|
||||
path = "/#{user.username}/#{article.slug}/stats"
|
||||
allow(user).to receive(:pro?).and_return(true)
|
||||
sign_in user
|
||||
visit path
|
||||
|
||||
Percy.snapshot(page, name: "Article: renders stats")
|
||||
|
||||
expect(page).to have_current_path(path)
|
||||
expect(page).to have_selector(".summary-stats")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ RSpec.describe "User visits articles by tag", type: :system do
|
|||
context "when 2 articles" do
|
||||
before { visit "/t/javascript" }
|
||||
|
||||
it "shows the header", js: true, percy: true, stub_elasticsearch: true do
|
||||
Percy.snapshot(page, name: "Tags: logged out user")
|
||||
|
||||
it "shows the header", js: true, stub_elasticsearch: true do
|
||||
within("h1") { expect(page).to have_text("javascript") }
|
||||
end
|
||||
|
||||
|
|
@ -73,7 +71,6 @@ RSpec.describe "User visits articles by tag", type: :system do
|
|||
end
|
||||
|
||||
it "shows the following button", js: true, stub_elasticsearch: true do
|
||||
# TODO: Add Percy snapshot?
|
||||
wait_for_javascript
|
||||
|
||||
within("h1") { expect(page).to have_button("Following") }
|
||||
|
|
|
|||
|
|
@ -123,11 +123,6 @@ RSpec.describe "User visits articles by timeframe", type: :system do
|
|||
context "when viewing articles for month" do
|
||||
before { visit "/top/month" }
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Articles: /top/month")
|
||||
end
|
||||
|
||||
it "shows correct articles", :aggregate_failures do
|
||||
shows_correct_articles_count_via_xpath(2)
|
||||
shows_main_article
|
||||
|
|
@ -176,11 +171,6 @@ RSpec.describe "User visits articles by timeframe", type: :system do
|
|||
context "when viewing articles for latest" do
|
||||
before { visit "/latest" }
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Articles: /latest")
|
||||
end
|
||||
|
||||
it "shows correct articles", :aggregate_failures do
|
||||
shows_correct_articles_count_via_xpath(4)
|
||||
shows_main_article
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ RSpec.describe "Deleting Comment", type: :system, js: true do
|
|||
end
|
||||
|
||||
it "works" do
|
||||
# TODO: Add Percy snapshot?
|
||||
visit "/"
|
||||
visit comment.path + "/delete_confirm"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@ RSpec.describe "Editing A Comment", type: :system, js: true do
|
|||
end
|
||||
|
||||
context "when user edits comment on the bottom of the article" do
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
visit article.path.to_s
|
||||
Percy.snapshot(page, name: "Edit comment: renders")
|
||||
end
|
||||
|
||||
it "updates" do
|
||||
visit article.path.to_s
|
||||
wait_for_javascript
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ RSpec.describe "Creating Comment", type: :system, js: true do
|
|||
end
|
||||
|
||||
it "User fills out comment box normally" do
|
||||
# TODO: Add Percy snapshot?
|
||||
visit article.path.to_s
|
||||
wait_for_javascript
|
||||
|
||||
|
|
@ -100,7 +99,7 @@ RSpec.describe "Creating Comment", type: :system, js: true do
|
|||
expect(page).to have_no_css("div.file-upload-error")
|
||||
end
|
||||
|
||||
it "User attaches a large image", percy: true do
|
||||
it "User attaches a large image" do
|
||||
visit article.path.to_s
|
||||
|
||||
reduce_max_file_size = 'document.querySelector("#image-upload-main").setAttribute("data-max-file-size-mb", "0")'
|
||||
|
|
@ -113,8 +112,6 @@ RSpec.describe "Creating Comment", type: :system, js: true do
|
|||
visible: :hidden,
|
||||
)
|
||||
|
||||
Percy.snapshot(page, name: "Image: upload error")
|
||||
|
||||
expect(page).to have_css("div.file-upload-error")
|
||||
expect(page).to have_css(
|
||||
"div.file-upload-error",
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@ RSpec.describe "Viewing a comment", type: :system, js: true do
|
|||
end
|
||||
|
||||
context "when showing the date" do
|
||||
it "shows the readable publish date", percy: true do
|
||||
Percy.snapshot(page, name: "Comment: can render")
|
||||
|
||||
it "shows the readable publish date" do
|
||||
expect(page).to have_selector(".comment-date time", text: "Mar 4")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@ RSpec.describe "Visiting article comments", type: :system, js: true do
|
|||
expect(page).to have_selector(".comment-deep-1", visible: :visible, count: 3)
|
||||
end
|
||||
|
||||
it "displays grandchild comments", percy: true do
|
||||
Percy.snapshot(page, name: "Comment: /:article/comments nested comments")
|
||||
|
||||
it "displays grandchild comments" do
|
||||
expect(page).to have_selector("#comment-node-#{grandchild_comment.id}.comment-deep-2", visible: :visible, count: 1)
|
||||
end
|
||||
end
|
||||
|
|
@ -43,9 +41,7 @@ RSpec.describe "Visiting article comments", type: :system, js: true do
|
|||
expect(page).to have_selector(".comment-deep-1", visible: :visible, count: 2)
|
||||
end
|
||||
|
||||
it "displays grandchild comments", percy: true do
|
||||
Percy.snapshot(page, name: "Comment: /:article/comments/:comment_id nested comments")
|
||||
|
||||
it "displays grandchild comments" do
|
||||
expect(page).to have_selector("#comment-node-#{grandchild_comment.id}.comment-deep-2", visible: :visible, count: 1)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ RSpec.describe "viewing podcast comments", type: :system, js: true do
|
|||
visit "/#{podcast.slug}/#{podcast_episode.slug}/comments"
|
||||
end
|
||||
|
||||
it "renders comment", percy: true do
|
||||
Percy.snapshot(page, name: "Comment: /:podcast_slug/:podcast_episode_slug/comments")
|
||||
|
||||
it "renders comment" do
|
||||
expect(page).to have_content(comment.body_html)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -22,11 +22,6 @@ RSpec.describe "Infinite scroll on dashboard", type: :system, js: true do
|
|||
visit "/dashboard/user_followers?per_page=#{default_per_page}"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Homepage: /dashboard/user_followers?per_page= infinite scroll")
|
||||
end
|
||||
|
||||
it "scrolls through all users" do
|
||||
page.execute_script("window.scrollTo(0, 100000)")
|
||||
page.assert_selector('div[id^="follows"]', count: total_records)
|
||||
|
|
@ -69,11 +64,6 @@ RSpec.describe "Infinite scroll on dashboard", type: :system, js: true do
|
|||
visit dashboard_following_users_path(per_page: default_per_page)
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Homepage: /dashboard/following_users infinite scroll")
|
||||
end
|
||||
|
||||
it "scrolls through all users" do
|
||||
page.execute_script("window.scrollTo(0, 100000)")
|
||||
page.assert_selector('div[id^="follows"]', count: total_records)
|
||||
|
|
@ -89,11 +79,6 @@ RSpec.describe "Infinite scroll on dashboard", type: :system, js: true do
|
|||
visit dashboard_following_organizations_path(per_page: default_per_page)
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Homepage: /dashboard/following_organizations infinite scroll")
|
||||
end
|
||||
|
||||
it "scrolls through all users" do
|
||||
page.execute_script("window.scrollTo(0, 100000)")
|
||||
page.assert_selector('div[id^="follows"]', count: total_records)
|
||||
|
|
|
|||
|
|
@ -6,12 +6,6 @@ RSpec.describe "User visits a homepage", type: :system do
|
|||
before { create(:tag, name: "webdev") }
|
||||
|
||||
context "when user hasn't logged in" do
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
visit "/"
|
||||
Percy.snapshot(page, name: "Visits homepage: logged out user")
|
||||
end
|
||||
|
||||
it "shows the sign-in block" do
|
||||
visit "/"
|
||||
within ".signin-cta-widget" do
|
||||
|
|
@ -47,12 +41,6 @@ RSpec.describe "User visits a homepage", type: :system do
|
|||
sign_in(user)
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
visit "/"
|
||||
Percy.snapshot(page, name: "Visits homepage: logged in user")
|
||||
end
|
||||
|
||||
it "offers to follow tags", js: true do
|
||||
visit "/"
|
||||
|
||||
|
|
|
|||
|
|
@ -25,11 +25,6 @@ RSpec.describe "Admin awards badges", type: :system do
|
|||
visit "/internal/badges"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Admin: /internal/badges")
|
||||
end
|
||||
|
||||
it "loads the view" do
|
||||
expect(page).to have_content("Badges")
|
||||
end
|
||||
|
|
@ -58,11 +53,9 @@ RSpec.describe "Admin awards badges", type: :system do
|
|||
end
|
||||
end
|
||||
|
||||
it "does not award badges if no badge is selected", js: true, percy: true do
|
||||
it "does not award badges if no badge is selected", js: true do
|
||||
expect { award_no_badges }.to change { user.badges.count }.by(0)
|
||||
|
||||
Percy.snapshot(page, name: "Admin: /internal/badges error")
|
||||
|
||||
expect(page).to have_content("Please choose a badge to award")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,11 +38,6 @@ RSpec.describe "Admin bans user", type: :system do
|
|||
expect(page).to have_content("User has been updated")
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Admin: /internal/users/:user_id/edit")
|
||||
end
|
||||
|
||||
it "checks that the user is warned, has a note, and privileges are removed" do
|
||||
user.add_role :trusted
|
||||
add_tag_moderator_role
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@ RSpec.describe "Admin creates new event", type: :system do
|
|||
expect(page).to have_content("Create New Event")
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Admin: /internal/events shows published events")
|
||||
end
|
||||
|
||||
it "loads published events on /events" do
|
||||
create_and_publish_event
|
||||
visit "/events"
|
||||
|
|
|
|||
|
|
@ -14,11 +14,6 @@ RSpec.describe "Admin manages reports", type: :system do
|
|||
visit internal_feedback_messages_path
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Admin: /internal/feedback_messages")
|
||||
end
|
||||
|
||||
it "loads the view" do
|
||||
expect(page).to have_content("Feedback Messages")
|
||||
expect(page).to have_content("Suspicious Activity")
|
||||
|
|
@ -35,14 +30,6 @@ RSpec.describe "Admin manages reports", type: :system do
|
|||
clear_search_boxes
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page when searching reports", js: true, percy: true do
|
||||
fill_in "q_reporter_username_cont", with: user.username.to_s
|
||||
click_on "Search"
|
||||
|
||||
Percy.snapshot(page, name: "Admin: /internal/feedback_messages search")
|
||||
end
|
||||
|
||||
it "searches reports" do
|
||||
fill_in "q_reporter_username_cont", with: user.username.to_s
|
||||
click_on "Search"
|
||||
|
|
@ -57,14 +44,6 @@ RSpec.describe "Admin manages reports", type: :system do
|
|||
expect(page).to have_css("#edit_feedback_message_#{feedback_message3.id}")
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page when filtering", js: true, percy: true do
|
||||
select "Invalid", from: "q[status_eq]"
|
||||
click_on "Search"
|
||||
|
||||
Percy.snapshot(page, name: "Admin: /internal/feedback_messages filter")
|
||||
end
|
||||
|
||||
it "filters by reports by status" do
|
||||
select "Invalid", from: "q[status_eq]"
|
||||
click_on "Search"
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ RSpec.describe "Link on tags for post in notifications", type: :system do
|
|||
visit "/dashboard"
|
||||
end
|
||||
|
||||
it "shows the sign-with page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Logged out user: sign-in page")
|
||||
it "shows the sign-with page", js: true do
|
||||
expect(page).to have_content(/Sign In With/i, count: 2)
|
||||
end
|
||||
end
|
||||
|
|
@ -24,10 +23,8 @@ RSpec.describe "Link on tags for post in notifications", type: :system do
|
|||
sign_in article.user
|
||||
end
|
||||
|
||||
it "shows articles", js: true, percy: true do
|
||||
it "shows articles", js: true do
|
||||
visit "/dashboard"
|
||||
|
||||
Percy.snapshot(page, name: "Logged in user: dashboard")
|
||||
expect(page).to have_selector(".spec__dashboard-story", count: 1)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ RSpec.describe "User leaves an organization", type: :system do
|
|||
end
|
||||
|
||||
context "when user visits member organization settings" do
|
||||
it "shows the leave oranization button", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Settings: /settings/organization/:organization_id")
|
||||
|
||||
it "shows the leave oranization button", js: true do
|
||||
expect(page).to have_button("Leave Organization")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -32,15 +32,6 @@ RSpec.describe "Organization setting page(/settings/organization)", type: :syste
|
|||
)
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
visit "/settings/organization"
|
||||
fill_in_org_form
|
||||
click_button "Create Organization"
|
||||
|
||||
Percy.snapshot(page, name: "Settings: /settings/organization create organization")
|
||||
end
|
||||
|
||||
it "user creates an organization" do
|
||||
visit "/settings/organization"
|
||||
fill_in_org_form
|
||||
|
|
|
|||
|
|
@ -36,11 +36,9 @@ RSpec.describe "Organization index", type: :system do
|
|||
end
|
||||
|
||||
context "when more articles" do
|
||||
it "visits ok", js: true, percy: true, stub_elasticsearch: true do
|
||||
it "visits ok", js: true, stub_elasticsearch: true do
|
||||
create_list(:article, 3, organization: organization)
|
||||
visit "/#{organization.slug}"
|
||||
|
||||
Percy.snapshot(page, name: "Organization: /:organization_slug renders when user is not following org")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ RSpec.describe "User visits podcast show page", type: :system do
|
|||
let(:podcast_episode) { create(:podcast_episode, podcast_id: podcast.id) }
|
||||
let(:single_quote_episode) { create(:podcast_episode, title: "What's up doc?!") }
|
||||
|
||||
it "they see the content of the hero", js: true, percy: true, retry: 3 do
|
||||
it "they see the content of the hero", js: true, retry: 3 do
|
||||
visit podcast_episode.path.to_s
|
||||
|
||||
Percy.snapshot(page, name: "Podcast: /:podcast_slug/:episode_slug renders")
|
||||
|
||||
expect(page).to have_text(podcast_episode.title)
|
||||
expect(page).to have_css ".record"
|
||||
expect(page).not_to have_css ".published-at"
|
||||
|
|
@ -41,12 +39,10 @@ RSpec.describe "User visits podcast show page", type: :system do
|
|||
end
|
||||
|
||||
context "when episode may not be playable" do
|
||||
it "displays status when episode is not reachable by https", js: true, percy: true do
|
||||
it "displays status when episode is not reachable by https", js: true do
|
||||
podcast_episode = create(:podcast_episode, https: false)
|
||||
visit podcast_episode.path.to_s
|
||||
|
||||
Percy.snapshot(page, name: "Podcast: /:podcast_slug/:episode_slug renders when not reachable by https")
|
||||
|
||||
expect(page).to have_text(I18n.t("podcasts.statuses.unplayable"))
|
||||
expect(page).to have_text("Click here to download")
|
||||
end
|
||||
|
|
@ -78,11 +74,9 @@ RSpec.describe "User visits podcast show page", type: :system do
|
|||
let(:comment) { create(:comment, user_id: user.id, commentable: podcast_episode) }
|
||||
let!(:comment2) { create(:comment, user_id: user.id, commentable: podcast_episode, parent: comment) }
|
||||
|
||||
it "sees the comments", js: true, percy: true do
|
||||
it "sees the comments", js: true do
|
||||
visit podcast_episode.path.to_s
|
||||
|
||||
Percy.snapshot(page, name: "Podcast: /:podcast_slug/:episode_slug renders with comments")
|
||||
|
||||
expect(page).to have_selector(".comment-deep-0#comment-node-#{comment.id}", visible: :visible, count: 1)
|
||||
expect(page).to have_selector(".comment-deep-1#comment-node-#{comment2.id}", visible: :visible, count: 1)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ RSpec.describe "User visits a podcast page", type: :system do
|
|||
end
|
||||
end
|
||||
|
||||
it "displays podcast episodes", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Podcast: /:podcast_slug renders")
|
||||
|
||||
it "displays podcast episodes", js: true do
|
||||
expect(page).to have_selector("div.single-article", visible: :visible, count: 2)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ RSpec.describe "User visits /pod page", type: :system do
|
|||
|
||||
before { visit "/pod" }
|
||||
|
||||
it "displays the podcasts", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Podcast: /pod renders")
|
||||
|
||||
it "displays the podcasts", js: true do
|
||||
within "#articles-list" do
|
||||
expect(page).to have_link(nil, href: podcast_episode1.path)
|
||||
expect(page).to have_link(nil, href: podcast_episode2.path)
|
||||
|
|
|
|||
|
|
@ -23,13 +23,6 @@ RSpec.describe "User edits their integrations", type: :system, js: true do
|
|||
visit "/settings"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
click_link "Integrations"
|
||||
|
||||
Percy.snapshot(page, name: "Settings: /settings renders integrations")
|
||||
end
|
||||
|
||||
it "has connect-to-stackbit prompt" do
|
||||
click_link "Integrations"
|
||||
|
||||
|
|
|
|||
|
|
@ -11,17 +11,6 @@ RSpec.describe "User uses response templates settings", type: :system do
|
|||
end
|
||||
|
||||
context "when user has a response template already" do
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
visit "/settings/response-templates"
|
||||
|
||||
Percy.snapshot(page, name: "Settings: /response-templates renders")
|
||||
|
||||
click_link "Edit"
|
||||
|
||||
Percy.snapshot(page, name: "Settings: /response-templates can edit")
|
||||
end
|
||||
|
||||
it "can go to the edit page of the response template", js: true do
|
||||
visit "/settings/response-templates"
|
||||
click_link "Edit"
|
||||
|
|
@ -29,14 +18,6 @@ RSpec.describe "User uses response templates settings", type: :system do
|
|||
expect(page).to have_current_path "/settings/response-templates/#{response_template.id}", ignore_query: true
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page when deleting a response template", js: true, percy: true do
|
||||
visit "/settings/response-templates"
|
||||
accept_confirm { click_button "Remove" }
|
||||
|
||||
Percy.snapshot(page, name: "Settings: /response-templates can delete")
|
||||
end
|
||||
|
||||
it "shows the proper message when deleting a reponse template", js: true do
|
||||
visit "/settings/response-templates"
|
||||
accept_confirm { click_button "Remove" }
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ RSpec.describe "User comments", type: :system do
|
|||
end
|
||||
end
|
||||
|
||||
it "shows user's comments", js: true, percy: true, stub_elasticsearch: true do
|
||||
Percy.snapshot(page, name: "Comments: /:user_id/comments renders")
|
||||
|
||||
it "shows user's comments", js: true, stub_elasticsearch: true do
|
||||
within("#substories div.index-comments") do
|
||||
expect(page).to have_content("All 2 Comments")
|
||||
expect(page).to have_link(nil, href: comment.path)
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ RSpec.describe "User index", type: :system, stub_elasticsearch: true do
|
|||
context "when 1 article" do
|
||||
before { visit "/user3000" }
|
||||
|
||||
it "shows the header", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "User: /:user_id renders")
|
||||
|
||||
it "shows the header", js: true do
|
||||
within("h1") { expect(page).to have_content(user.name) }
|
||||
within(".profile-details") do
|
||||
expect(page).to have_button("Follow")
|
||||
|
|
@ -68,11 +66,6 @@ RSpec.describe "User index", type: :system, stub_elasticsearch: true do
|
|||
visit "/user3000"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "User: /:user_id renders with organization membership")
|
||||
end
|
||||
|
||||
it "shows organizations", js: true do
|
||||
Capybara.current_session.driver.browser.manage.window.resize_to(1920, 1080)
|
||||
expect(page).to have_css("#sidebar-wrapper-right h4", text: "organizations")
|
||||
|
|
@ -85,11 +78,6 @@ RSpec.describe "User index", type: :system, stub_elasticsearch: true do
|
|||
visit "/user3000"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "User: /:user_id for logged in user's own profile")
|
||||
end
|
||||
|
||||
it "shows the header", js: true do
|
||||
within("h1") { expect(page).to have_content(user.name) }
|
||||
within(".profile-details") do
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ RSpec.describe "Looking For Work", type: :system do
|
|||
visit "/settings"
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", js: true, percy: true do
|
||||
Percy.snapshot(page, name: "Logged in user: settings page")
|
||||
end
|
||||
|
||||
it "user selects looking for work and autofollows hiring tag", js: true do
|
||||
page.check "Looking for work"
|
||||
sidekiq_perform_enqueued_jobs do
|
||||
|
|
|
|||
|
|
@ -33,11 +33,6 @@ RSpec.describe "Using the editor", type: :system do
|
|||
page.evaluate_script("window.onbeforeunload = function(){}")
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Using the editor: preview an article")
|
||||
end
|
||||
|
||||
it "fills out form with rich content and click preview" do
|
||||
article_body = find("div.crayons-article__body")["innerHTML"]
|
||||
article_body.gsub!(/"https:\/\/res\.cloudinary\.com\/.{1,}"/, "cloudinary_link")
|
||||
|
|
@ -47,13 +42,6 @@ RSpec.describe "Using the editor", type: :system do
|
|||
end
|
||||
|
||||
describe "Submitting an article", js: true do
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
fill_markdown_with(read_from_file(raw_text))
|
||||
find("button", text: /\ASave changes\z/).click
|
||||
Percy.snapshot(page, name: "Using the editor: submit an article")
|
||||
end
|
||||
|
||||
it "fill out form and submit" do
|
||||
fill_markdown_with(read_from_file(raw_text))
|
||||
find("button", text: /\ASave changes\z/).click
|
||||
|
|
@ -77,11 +65,6 @@ RSpec.describe "Using the editor", type: :system do
|
|||
find("button", text: /\ASave changes\z/).click
|
||||
end
|
||||
|
||||
# TODO: Uncomment this spec when we decide to use percy again
|
||||
xit "renders the page", percy: true do
|
||||
Percy.snapshot(page, name: "Using the editor: publishing an article without a title")
|
||||
end
|
||||
|
||||
it "shows a message that the title cannot be blank" do
|
||||
expect(page).to have_text(/title: can't be blank/)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,11 +11,9 @@ RSpec.describe "Reading list", type: :system do
|
|||
context "when large reading list" do
|
||||
before { create_list(:reading_reaction, 46, user: user) }
|
||||
|
||||
it "shows the large reading list", js: true, percy: true do
|
||||
it "shows the large reading list", js: true do
|
||||
visit "/readinglist"
|
||||
|
||||
Percy.snapshot(page, name: "Viewing a reading list: shows a large list")
|
||||
|
||||
expect(page).to have_selector("#reading-list", visible: :visible)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,20 +7,16 @@ RSpec.describe "Views an article", type: :system, js: true do
|
|||
let!(:comment) { create(:comment, commentable: article) }
|
||||
let!(:child_comment) { create(:comment, parent: comment, commentable: article) }
|
||||
|
||||
it "shows all comments", percy: true do
|
||||
it "shows all comments" do
|
||||
create(:comment, commentable: article)
|
||||
visit "#{article.path}/comments"
|
||||
|
||||
Percy.snapshot(page, name: "Viewing an article: shows all comments")
|
||||
|
||||
expect(page).to have_selector(".single-comment-node", visible: :visible, count: 3)
|
||||
end
|
||||
|
||||
it "shows a thread", percy: true do
|
||||
it "shows a thread" do
|
||||
visit "#{article.path}/comments/#{comment.id_code_generated}"
|
||||
|
||||
Percy.snapshot(page, name: "Viewing an article: shows a thread")
|
||||
|
||||
expect(page).to have_selector(".single-comment-node", visible: :visible, count: 2)
|
||||
expect(page).to have_selector(".comment-deep-0#comment-node-#{comment.id}", visible: :visible, count: 1)
|
||||
expect(page).to have_selector(".comment-deep-1#comment-node-#{child_comment.id}", visible: :visible, count: 1)
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ RSpec.describe "User visits the videos page", type: :system do
|
|||
before { visit "/videos" }
|
||||
|
||||
describe "meta tags" do
|
||||
it "contains the qualified community name in og:site_name", js: true, percy: true do
|
||||
it "contains the qualified community name in og:site_name", js: true do
|
||||
selector = "meta[property='og:site_name'][content='#{community_qualified_name}']"
|
||||
|
||||
Percy.snapshot(page, name: "Videos: /videos renders")
|
||||
|
||||
expect(page).to have_selector(selector, visible: :hidden)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
BIN
vendor/cache/percy-capybara-4.2.0.gem
vendored
BIN
vendor/cache/percy-capybara-4.2.0.gem
vendored
Binary file not shown.
Loading…
Add table
Reference in a new issue