Skip to content

Commit

Permalink
clean up testing
Browse files Browse the repository at this point in the history
  • Loading branch information
chadbrokaw committed Dec 12, 2023
1 parent 09ea03e commit e63d4f1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions spec/javascript/support/puppeteer/consts.js
Expand Up @@ -49,5 +49,7 @@ export const DECLINE_TO_STATE = 'Decline to state'

// Change to false to see tests running on browser locally
export const HEADLESS = true
// Change to true to see devtools, only works if HEADLESS is false since you need to open up a Chromium browser
export const DEVTOOLS = false
// Change to false to fall back to including css
export const REMOVECSS = process.env.E2E_REMOVE_CSS || true
6 changes: 4 additions & 2 deletions spec/javascript/utils/SetupBrowserAndPage.js
@@ -1,6 +1,6 @@
import puppeteer from 'puppeteer'

import { HEADLESS, REMOVECSS } from '../support/puppeteer/consts'
import { HEADLESS, REMOVECSS, DEVTOOLS } from '../support/puppeteer/consts'

const IgnoreImageAndCSSLoad = async (page) => {
await page.setRequestInterception(true)
Expand All @@ -23,7 +23,9 @@ const SetupBrowser = async () => {
const browser = await puppeteer.launch({
headless: HEADLESS,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
slowMo: 100
timeout: 0,
// slowMo: 100,
devtools: DEVTOOLS
})
return browser
}
Expand Down
14 changes: 14 additions & 0 deletions spec/support/vcr_setup.rb
Expand Up @@ -6,6 +6,16 @@
config.cassette_library_dir = 'spec/vcr'
config.hook_into :webmock

# The below code can be used to re-record a specific casette. Replace the cassette name with the one you want to re-record.
# config.default_cassette_options = {
# record: :once
# }
# config.before_record do |interaction|
# if interaction.cassette.name == 'api/v1/short-form/show/non_lease_up_application'
# interaction.cassette.record_mode = :all
# end
# end

# Look for instances of these protected values showing up in our VCR requests
# and filter them out with e.g. "<<SALESFORCE_USERNAME>>".
%w[
Expand Down Expand Up @@ -49,6 +59,10 @@
h['Authorization'].first.split('OAuth ').last if h['Authorization']&.first
end

# config.default_cassette_options = {
# record: :all
# }

# This can be used to manipulate the response before saving
# config.before_record do |interaction|
# end
Expand Down

0 comments on commit e63d4f1

Please sign in to comment.