Skip to content

Commit

Permalink
Migrate to new percy dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbergja committed Nov 22, 2023
1 parent 00f04be commit 059740e
Show file tree
Hide file tree
Showing 11 changed files with 686 additions and 2,039 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ group :test do
gem "capybara", ">= 2.15"
gem "capybara-screenshot"
gem "factory_bot_rails", "~> 4.8", require: false
gem "percy-capybara", "~> 4.0.0"
gem "percy-capybara", "~> 5.0.0"
gem "rails-controller-testing"
gem "rspec_junit_formatter"
gem "selenium-webdriver"
Expand Down
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ GEM
parallel (1.22.1)
parser (3.1.3.0)
ast (~> 2.4.1)
percy-capybara (4.0.2)
percy-capybara (5.0.0)
capybara (>= 3)
pg (1.3.5)
pry (0.12.2)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -438,7 +439,7 @@ DEPENDENCIES
net-ldap
omniauth-cas
omniauth-rails_csrf_protection (~> 0.1)
percy-capybara (~> 4.0.0)
percy-capybara (~> 5.0.0)
pg
pry
pry-byebug
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.23.4",
"@babel/preset-env": "^7.23.3",
"@percy/agent": "^0.19.1",
"@happy-dom/jest-environment": "^12.10.3",
"@percy/cli": "^1.27.4",
"@vue/test-utils": "^1.0.0-beta.25",
"babel-core": "^7.0.0-bridge",
"babel-plugin-dynamic-import-node": "^2.3.3",
Expand All @@ -27,8 +28,7 @@
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^5.1.0",
"jest": "^28.1.2",
"@happy-dom/jest-environment": "^12.10.3",
"jest": "^29.7.0",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^9.3.0",
"sass": "^1.69.5",
Expand Down Expand Up @@ -61,5 +61,8 @@
"setupFilesAfterEnv": [
"./app/javascript/test/setup.js"
]
},
"resolutions": {
"jackspeak": "2.1.1"
}
}
4 changes: 2 additions & 2 deletions spec/features/delegate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
assert_selector "a", text: "My Delegates", count: 1

click_on "Delegations"
Percy.snapshot(page, name: "Delegations - Show", widths: [375, 768, 1440])
page.percy_snapshot("Delegations - Show", widths: [375, 768, 1440])

assert_selector ".lux-card-header", text: /^Schmo, Joe*/, count: 1
assert_selector ".lux-card-header a", count: 1
Expand Down Expand Up @@ -60,7 +60,7 @@
assert_selector "a", text: "My Delegates", count: 1

click_on "Delegations"
Percy.snapshot(page, name: "Delegations - Show", widths: [375, 768, 1440])
page.percy_snapshot("Delegations - Show", widths: [375, 768, 1440])

assert_selector ".lux-card-header", text: /^Schmo, Joe*/, count: 1
assert_selector ".lux-card-header a", count: 1
Expand Down
2 changes: 1 addition & 1 deletion spec/features/my_approval_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
event_requests: [event_request])

visit "/my_approval_requests"
Percy.snapshot(page, name: "My Approval Requests - Show", widths: [375, 768, 1440])
page.percy_snapshot("My Approval Requests - Show", widths: [375, 768, 1440])
assert_selector ".my-request .lux-card", count: Request.count

select_drop_down(menu: "#request-type-menu", item: "Travel")
Expand Down
2 changes: 1 addition & 1 deletion spec/features/my_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
travel_category: "professional_development", start_date: Date.parse("2020-05-21"), end_date: Date.parse("2020-05-23"), event_requests: [event_request3])

visit "/my_requests"
Percy.snapshot(page, name: "My Requests - Show", widths: [375, 768, 1440])
page.percy_snapshot("My Requests - Show", widths: [375, 768, 1440])
assert_selector ".my-request .lux-card", count: Request.count

select_drop_down(menu: "#status-menu", item: "Approved")
Expand Down
4 changes: 2 additions & 2 deletions spec/features/new_absence_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
tomorrow = Date.parse("2019-10-23")
js_date_format = "%m/%d/%Y"
fill_in "absence_request_date", with: "#{today.strftime(js_date_format)} - #{tomorrow.strftime(js_date_format)}"
Percy.snapshot(page, name: "Leave Request - New", widths: [375, 768, 1440])
page.percy_snapshot("Leave Request - New", widths: [375, 768, 1440])
click_on "Submit Request"

expect(page).to have_content "Sick Leave"
expect(page).to have_content "Total Hours\n21.75"
expect(page).to have_content "Pending"
Percy.snapshot(page, name: "Leave Request - Show", widths: [375, 768, 1440])
page.percy_snapshot("Leave Request - Show", widths: [375, 768, 1440])

# Approve in the background
Request.last.approve!(agent: staff_profile.supervisor)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/new_travel_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
all("input[id^='travel_request_estimates_recurrence_']")[1].fill_in with: "3"
all("input[id^='travel_request_estimates_amount_']")[1].fill_in with: "30"
expect(page).to have_content "130.00"
Percy.snapshot(page, name: "Travel Request - New", widths: [375, 768, 1440])
page.percy_snapshot("Travel Request - New", widths: [375, 768, 1440])
click_on "Submit Request"

expect(page).to have_content "Super Event's Are Us 2019, A Place To Be (10/01/2019 to 10/03/2019)"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
click_on "Requests"
click_on "Reports"

Percy.snapshot(page, name: "Reports - show", widths: [375, 768, 1440])
page.percy_snapshot("Reports - show", widths: [375, 768, 1440])
assert_selector ".my-request tr", count: Request.count # header row included in count
expect(page).to have_content "Wow 2020, Location (05/21/2020 to 05/23/2020) May 21, 2020 May 23, 2020 Approved Pat Doe ITIMS In-person October 20, 2019 150.00"
expect(page).to have_content "Best Event Ever 2020, Location (10/21/2020 to 10/23/2020) October 20, 2020 October 23, 2012 Approved Pat Doe ITIMS"
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require "devise"
require Rails.root.join("spec", "support", "capybara_selenium.rb")
require Rails.root.join("spec", "support", "mailer.rb")
require "percy"
require "percy/capybara"
require "capybara/rspec"

# Requires supporting ruby files with custom matchers and macros, etc, in
Expand Down
Loading

0 comments on commit 059740e

Please sign in to comment.