diff --git a/README.md b/README.md index e97feecce..15ded682b 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,9 @@ If you'll be using VS Code, be sure to: - `yarn test:ci` - run all unit and integration tests in CI mode - `yarn test:e2e` - run all e2e tests with Playwright UI mode. - `yarn test:e2e:headless` - run all e2e tests headlessly. +- `yarn test:e2e:snapshot` - run all e2e tests with snapshot testing. +- `yarn test:e2e:snapshot-update` - update all snapshots. +- `yarn test:e2e:snapshot-update ` - update snapshots for specific tests. Example: `yarn test:e2e:snapshot-update e2e/pages/shared-lending-platform/UserProfile*` - `yarn format` - format all files with Prettier. - `yarn lint` - runs TypeScript, ESLint and Stylelint. - `yarn validate` - runs `lint`, `test:ci` and `test:e2e`. diff --git a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts index 0d32914e2..be84c348c 100644 --- a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts +++ b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts @@ -1,17 +1,18 @@ import { expect } from '@playwright/test'; -import { test } from '../../../fixtures/testFixture'; -import { controlUnicode } from '../../../utils/unicodeConstants'; -import { - assertTextInput, - assertSelectInput, -} from '../../../utils/inputValidators'; import { DefaultInputCharLimit, - PhoneInputCharLimit, EmailInputCharLimit, + PhoneInputCharLimit, ZipInputCharLimit, } from 'utils/constants'; +import { test } from '../../../fixtures/testFixture'; +import { + assertSelectInput, + assertTextInput, +} from '../../../utils/inputValidators'; import { clickContinueNext } from '../../../utils/navigation.utils'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; +import { controlUnicode } from '../../../utils/unicodeConstants'; test('Point of Contact: Checking for form errors based on user input', async ({ page, @@ -24,6 +25,7 @@ test('Point of Contact: Checking for form errors based on user input', async ({ await expect( page.locator('#FilingDetailsFormErrors div').first(), ).toBeVisible(); + await checkSnapshot(page); }); await test.step('Point of Contact: Check the first and last names for invalid input', async () => { @@ -45,6 +47,7 @@ test('Point of Contact: Checking for form errors based on user input', async ({ await expect(page.locator('#FilingDetailsFormErrors')).toContainText( 'The last name must not contain invalid characters', ); + await checkSnapshot(page); }); }); @@ -59,6 +62,7 @@ test('Point of Contact: Checking for unicode tolerance based on user input', asy await expect( page.locator('#FilingDetailsFormErrors div').first(), ).toBeVisible(); + await checkSnapshot(page); }); await test.step('Point of Contact: Check the first and last names for invalid input', async () => { @@ -173,5 +177,6 @@ test('Point of Contact: Checking for unicode tolerance based on user input', asy await expect(page.locator('form')).toContainText( 'You must enter a valid ZIP code.', ); + await checkSnapshot(page); }); }); diff --git a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png new file mode 100644 index 000000000..423284a40 Binary files /dev/null and b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png new file mode 100644 index 000000000..2e73e575e Binary files /dev/null and b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-1-chromium-darwin.png b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-1-chromium-darwin.png new file mode 100644 index 000000000..423284a40 Binary files /dev/null and b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-2-chromium-darwin.png b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-2-chromium-darwin.png new file mode 100644 index 000000000..76f5bb2ab Binary files /dev/null and b/e2e/pages/filing-app/filing-details/checkPocFormErrors.spec.ts-snapshots/Point-of-Contact-Checking-for-unicode-tolerance-based-on-user-input-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts b/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts index 0029bd220..330af8488 100644 --- a/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts +++ b/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts @@ -1,4 +1,5 @@ import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { verifyRedirects } from './_shared'; const testLabel = 'Filing step routing (Errors: Logic)'; @@ -24,5 +25,6 @@ test( testLabel, userShouldNotAccess, }); + await checkSnapshot(page); }, ); diff --git a/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts-snapshots/Filing-step-routing-Errors-Logic-1-chromium-darwin.png b/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts-snapshots/Filing-step-routing-Errors-Logic-1-chromium-darwin.png new file mode 100644 index 000000000..f3b37d6af Binary files /dev/null and b/e2e/pages/filing-app/filing-step-routing/errorsLogic.spec.ts-snapshots/Filing-step-routing-Errors-Logic-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts b/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts index 1c3071cda..08b6da380 100644 --- a/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts +++ b/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts @@ -1,4 +1,5 @@ import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { verifyRedirects } from './_shared'; const testLabel = 'Filing step routing (Errors: Syntax)'; @@ -29,5 +30,6 @@ test( testLabel, userShouldNotAccess, }); + await checkSnapshot(page); }, ); diff --git a/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts-snapshots/Filing-step-routing-Errors-Syntax-1-chromium-darwin.png b/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts-snapshots/Filing-step-routing-Errors-Syntax-1-chromium-darwin.png new file mode 100644 index 000000000..8a5b46223 Binary files /dev/null and b/e2e/pages/filing-app/filing-step-routing/errorsSyntax.spec.ts-snapshots/Filing-step-routing-Errors-Syntax-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts b/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts index f5ea7d920..db29b96c4 100644 --- a/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts +++ b/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts @@ -1,4 +1,5 @@ import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { verifyRedirects } from './_shared'; const testLabel = 'Filing step routing (Upload)'; @@ -22,4 +23,5 @@ test(testLabel, async ({ page, navigateToUploadFile }) => { testLabel, userShouldNotAccess, }); + await checkSnapshot(page); }); diff --git a/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts-snapshots/Filing-step-routing-Upload-1-chromium-darwin.png b/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts-snapshots/Filing-step-routing-Upload-1-chromium-darwin.png new file mode 100644 index 000000000..819d705da Binary files /dev/null and b/e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts-snapshots/Filing-step-routing-Upload-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts b/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts index a3b90b695..95f04bf79 100644 --- a/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts +++ b/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts @@ -1,4 +1,5 @@ import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { verifyRedirects } from './_shared'; const testLabel = 'Filing step routing (Point of Contact)'; @@ -22,4 +23,5 @@ test(testLabel, async ({ page, navigateToProvideFilingDetails }) => { page, test, }); + await checkSnapshot(page); }); diff --git a/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts-snapshots/Filing-step-routing-Point-of-Contact-1-chromium-darwin.png b/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts-snapshots/Filing-step-routing-Point-of-Contact-1-chromium-darwin.png new file mode 100644 index 000000000..e385990bc Binary files /dev/null and b/e2e/pages/filing-app/filing-step-routing/pointOfContact.spec.ts-snapshots/Filing-step-routing-Point-of-Contact-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts b/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts index fc6e8b847..40c7260b2 100644 --- a/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts +++ b/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts @@ -1,4 +1,5 @@ import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { verifyRedirects } from './_shared'; const testLabel = 'Filing step routing (Warnings)'; @@ -24,5 +25,6 @@ test( testLabel, userShouldNotAccess, }); + await checkSnapshot(page); }, ); diff --git a/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts-snapshots/Filing-step-routing-Warnings-1-chromium-darwin.png b/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts-snapshots/Filing-step-routing-Warnings-1-chromium-darwin.png new file mode 100644 index 000000000..22689c883 Binary files /dev/null and b/e2e/pages/filing-app/filing-step-routing/warnings.spec.ts-snapshots/Filing-step-routing-Warnings-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts b/e2e/pages/filing-app/formAlerts.spec.ts index 03056fffa..f21524373 100644 --- a/e2e/pages/filing-app/formAlerts.spec.ts +++ b/e2e/pages/filing-app/formAlerts.spec.ts @@ -1,8 +1,9 @@ import { expect } from '@playwright/test'; import { test } from '../../fixtures/testFixture'; import pointOfContactJson from '../../test-data/point-of-contact/point-of-contact-data-1.json'; -import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile'; import { clickContinue, clickContinueNext } from '../../utils/navigation.utils'; +import { checkSnapshot } from '../../utils/snapshotTesting'; +import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile'; test('Form Alerts', async ({ page, @@ -14,6 +15,7 @@ test('Form Alerts', async ({ await expect(page.locator('h1'), 'h1 is correct').toContainText( 'Provide type of financial institution', ); + await checkSnapshot(page); // Submit Incomplete form await test.step('Submit Incomplete form', async () => { @@ -29,6 +31,7 @@ test('Form Alerts', async ({ 'There was a problem updating your type of financial institution', ); }); + await checkSnapshot(page); }); // Submit Completed Form @@ -37,6 +40,7 @@ test('Form Alerts', async ({ await page.getByText('Bank or savings association').check(); }); await clickContinue(test, page); + await checkSnapshot(page); }); }); @@ -54,6 +58,7 @@ test('Form Alerts', async ({ // Continue to next page await clickContinueNext(test, page); + await checkSnapshot(page); }); // Resolve errors (syntax) page @@ -76,6 +81,7 @@ test('Form Alerts', async ({ await test.step('Click: Upload new file', async () => { await page.getByRole('link', { name: 'Upload a new file' }).click(); }); + await checkSnapshot(page); }); // Upload file with logic errors @@ -92,6 +98,7 @@ test('Form Alerts', async ({ }); // Continue to next page + await checkSnapshot(page); await clickContinueNext(test, page); }); @@ -104,6 +111,7 @@ test('Form Alerts', async ({ page.locator('.m-notification__success'), 'Success message is visible', ).toContainText('Your register contains no syntax errors'); + await checkSnapshot(page); await clickContinue(test, page); }); @@ -125,6 +133,7 @@ test('Form Alerts', async ({ ).toContainText( 'You must resolve all errors to continue to the next step.', ); + await checkSnapshot(page); await test.step('Click: Upload new file', async () => { await page.getByRole('link', { name: 'Upload a new file' }).click(); }); @@ -141,6 +150,7 @@ test('Form Alerts', async ({ filePath: '../test-data/sample-sblar-files/logic-warnings_small.csv', resultMessage: ResultUploadMessage.warning, }); + await checkSnapshot(page); await clickContinueNext(test, page); }); @@ -153,6 +163,7 @@ test('Form Alerts', async ({ page.locator('.m-notification__success'), 'Success message is visible', ).toContainText('Your register contains no syntax errors'); + await checkSnapshot(page); await clickContinue(test, page); }); @@ -165,6 +176,7 @@ test('Form Alerts', async ({ page.locator('.m-notification__success'), 'Success message is visible', ).toContainText('Your register contains no logic errors'); + await checkSnapshot(page); await clickContinueNext(test, page); }); @@ -173,6 +185,7 @@ test('Form Alerts', async ({ await expect(page.locator('h1'), 'h1 is correct').toContainText( 'Review warnings', ); + await checkSnapshot(page); await clickContinueNext(test, page); await expect( page.locator('#error-header-alert'), @@ -183,6 +196,7 @@ test('Form Alerts', async ({ await test.step('Click: Verify checkbox', async () => { await page.getByText('I verify the accuracy of').check(); }); + await checkSnapshot(page); await clickContinueNext(test, page); }); @@ -191,6 +205,7 @@ test('Form Alerts', async ({ await expect(page.locator('h1'), 'h1 is correct').toContainText( 'Provide filing details', ); + await checkSnapshot(page); // Submit Incomplete form await test.step('Submit Incomplete form', async () => { @@ -201,6 +216,7 @@ test('Form Alerts', async ({ ).toContainText( 'There was a problem updating your filing detailsIndicate your voluntary reporter statusEnter the first name of the point of contactEnter the last name of the point of contactEnter the phone number of the point of contactEnter the email address of the point of contactEnter the street address of the point of contactEnter the city of the point of contactSelect the state or territory of the point of contactEnter the ZIP code of the point of contact', ); + await checkSnapshot(page); }); // Submit Completed form @@ -218,6 +234,7 @@ test('Form Alerts', async ({ await page.getByLabel('City').fill('Utah (U'); await page.selectOption('select#state', 'UT'); await page.getByLabel('Zip code').fill('55555'); + await checkSnapshot(page); }); }); @@ -230,5 +247,6 @@ test('Form Alerts', async ({ await expect(page.locator('h1'), 'h1 is correct').toContainText( 'Sign and submit', ); + await checkSnapshot(page); }); }); diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-1-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-1-chromium-darwin.png new file mode 100644 index 000000000..e0293ee48 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-10-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-10-chromium-darwin.png new file mode 100644 index 000000000..21ee04ea3 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-10-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-11-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-11-chromium-darwin.png new file mode 100644 index 000000000..b00f7cde8 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-11-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-12-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-12-chromium-darwin.png new file mode 100644 index 000000000..0c154d485 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-12-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-13-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-13-chromium-darwin.png new file mode 100644 index 000000000..de1608a5b Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-13-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-14-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-14-chromium-darwin.png new file mode 100644 index 000000000..72d38c92a Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-14-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-15-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-15-chromium-darwin.png new file mode 100644 index 000000000..98ca2bc42 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-15-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-16-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-16-chromium-darwin.png new file mode 100644 index 000000000..4e03da93c Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-16-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-17-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-17-chromium-darwin.png new file mode 100644 index 000000000..86a5a3444 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-17-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-2-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-2-chromium-darwin.png new file mode 100644 index 000000000..cbe1065bb Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-3-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-3-chromium-darwin.png new file mode 100644 index 000000000..7b90cce21 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-3-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-4-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-4-chromium-darwin.png new file mode 100644 index 000000000..72c7b26fe Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-4-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-5-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-5-chromium-darwin.png new file mode 100644 index 000000000..7eeb0a6a6 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-5-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-6-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-6-chromium-darwin.png new file mode 100644 index 000000000..5ab1fffe4 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-6-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-7-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-7-chromium-darwin.png new file mode 100644 index 000000000..21ee04ea3 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-7-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-8-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-8-chromium-darwin.png new file mode 100644 index 000000000..2364d1443 Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-8-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-9-chromium-darwin.png b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-9-chromium-darwin.png new file mode 100644 index 000000000..c972b1eea Binary files /dev/null and b/e2e/pages/filing-app/formAlerts.spec.ts-snapshots/Form-Alerts-9-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts b/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts index 59f2acd07..678a5c123 100644 --- a/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts +++ b/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts @@ -1,5 +1,6 @@ import { expect } from '@playwright/test'; import { test } from '../../../fixtures/testFixture'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; test('Sign and submit: complete filing flow with only warnings', async ({ page, @@ -13,5 +14,6 @@ test('Sign and submit: complete filing flow with only warnings', async ({ 'Congratulations! You have reached the end of the beta filing process.', ), ).toBeVisible(); + await checkSnapshot(page); }); }); diff --git a/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts-snapshots/Sign-and-submit-complete-filing-flow-with-only-warnings-1-chromium-darwin.png b/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts-snapshots/Sign-and-submit-complete-filing-flow-with-only-warnings-1-chromium-darwin.png new file mode 100644 index 000000000..8e2f2f082 Binary files /dev/null and b/e2e/pages/filing-app/sign-and-submit/completeFilingFlowWithOnlyWarnings.spec.ts-snapshots/Sign-and-submit-complete-filing-flow-with-only-warnings-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts b/e2e/pages/filing-app/unavailableApis.spec.ts index ef4829af2..82b824043 100644 --- a/e2e/pages/filing-app/unavailableApis.spec.ts +++ b/e2e/pages/filing-app/unavailableApis.spec.ts @@ -1,8 +1,9 @@ import { expect } from '@playwright/test'; import { test } from '../../fixtures/testFixture'; import { blockApi, verifyApiBlockThenUnblock } from '../../utils/blockApi'; -import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile'; import { clickContinue, clickContinueNext } from '../../utils/navigation.utils'; +import { checkSnapshot } from '../../utils/snapshotTesting'; +import { ResultUploadMessage, uploadFile } from '../../utils/uploadFile'; test('Blocking API Calls - Error Boundaries', async ({ page, @@ -91,6 +92,7 @@ test('Blocking API Calls - Error Boundaries', async ({ page.locator('#main .m-notification__error'), 'Error Alert is visible', ).toBeVisible(); + await checkSnapshot(page); }); // Unblock API Call diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-1-chromium-darwin.png b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-1-chromium-darwin.png new file mode 100644 index 000000000..60f7046e2 Binary files /dev/null and b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-2-chromium-darwin.png b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-2-chromium-darwin.png new file mode 100644 index 000000000..418bedd61 Binary files /dev/null and b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-3-chromium-darwin.png b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-3-chromium-darwin.png new file mode 100644 index 000000000..813e652e4 Binary files /dev/null and b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-3-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-4-chromium-darwin.png b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-4-chromium-darwin.png new file mode 100644 index 000000000..2dadd527a Binary files /dev/null and b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-4-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-5-chromium-darwin.png b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-5-chromium-darwin.png new file mode 100644 index 000000000..0cb622ea0 Binary files /dev/null and b/e2e/pages/filing-app/unavailableApis.spec.ts-snapshots/Blocking-API-Calls---Error-Boundaries-5-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts index 41dc9543b..1d807aaef 100644 --- a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts +++ b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts @@ -1,11 +1,12 @@ import { expect } from '@playwright/test'; import { test } from '../../../fixtures/testFixture'; -import { ResultUploadMessage, uploadFile } from '../../../utils/uploadFile'; -import { verifyDownloadableReport } from '../../../utils/verifyDownloadableReport'; import { clickContinue, clickContinueNext, } from '../../../utils/navigation.utils'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; +import { ResultUploadMessage, uploadFile } from '../../../utils/uploadFile'; +import { verifyDownloadableReport } from '../../../utils/verifyDownloadableReport'; test('Resolve Errors (Logic)', async ({ page, navigateToUploadFile }) => { navigateToUploadFile; @@ -28,6 +29,7 @@ test('Resolve Errors (Logic)', async ({ page, navigateToUploadFile }) => { await expect( page.getByText('Your register contains no syntax errors'), ).toBeVisible(); + await checkSnapshot(page); }); await test.step('Verify Resolve Errors (logic) and number of errors', async () => { @@ -45,6 +47,7 @@ test('Resolve Errors (Logic)', async ({ page, navigateToUploadFile }) => { await expect(page.locator('#multi-field-errors')).toContainText( 'Multi-field errors: 52 found', ); + await checkSnapshot(page); }); await test.step('Verify navigation of paginated (logic) content', async () => { @@ -67,6 +70,7 @@ test('Resolve Errors (Logic)', async ({ page, navigateToUploadFile }) => { await expect(page3row1.getByRole('cell').nth(0)).toHaveText('62'); await expect(page3row1.getByRole('cell').nth(2)).toHaveText('999'); await expect(page3row1.getByRole('cell').nth(3)).toHaveText('1'); + await checkSnapshot(page); }; await test.step('Page 1, Row 1', async () => { @@ -86,10 +90,12 @@ test('Resolve Errors (Logic)', async ({ page, navigateToUploadFile }) => { await expect(page2row1.getByRole('cell').nth(0)).toHaveText('42'); await expect(page2row1.getByRole('cell').nth(2)).toHaveText('999'); await expect(page2row1.getByRole('cell').nth(3)).toHaveText('1'); + await checkSnapshot(page); }); await test.step('Page 3, Row 1', async () => { await verifyPage3(); + await checkSnapshot(page); }); await test.step('Last page, "Next" disabled', async () => { diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-1-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-1-chromium-darwin.png new file mode 100644 index 000000000..f3b37d6af Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-2-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-2-chromium-darwin.png new file mode 100644 index 000000000..b2061f341 Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-3-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-3-chromium-darwin.png new file mode 100644 index 000000000..4e67e43b9 Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-3-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-4-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-4-chromium-darwin.png new file mode 100644 index 000000000..6a2aaca26 Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-4-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-5-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-5-chromium-darwin.png new file mode 100644 index 000000000..6a2aaca26 Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-5-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-6-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-6-chromium-darwin.png new file mode 100644 index 000000000..6a2aaca26 Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadLogicErrors.spec.ts-snapshots/Resolve-Errors-Logic-6-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts b/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts index f12c65d9f..eca633538 100644 --- a/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts +++ b/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts @@ -1,8 +1,9 @@ import { expect } from '@playwright/test'; import { test } from '../../../fixtures/testFixture'; +import { clickContinueNext } from '../../../utils/navigation.utils'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { ResultUploadMessage, uploadFile } from '../../../utils/uploadFile'; import { verifyDownloadableReport } from '../../../utils/verifyDownloadableReport'; -import { clickContinueNext } from '../../../utils/navigation.utils'; test('Resolve Errors (Syntax)', async ({ page, navigateToUploadFile }) => { navigateToUploadFile; @@ -25,6 +26,7 @@ test('Resolve Errors (Syntax)', async ({ page, navigateToUploadFile }) => { await expect(page.locator('h2')).toContainText( 'Single-field errors: 136 found', ); + await checkSnapshot(page); }); await verifyDownloadableReport({ testUsed: test, pageUsed: page }); diff --git a/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts-snapshots/Resolve-Errors-Syntax-1-chromium-darwin.png b/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts-snapshots/Resolve-Errors-Syntax-1-chromium-darwin.png new file mode 100644 index 000000000..72c7b26fe Binary files /dev/null and b/e2e/pages/filing-app/uploadFile/completeUploadSyntaxErrors.spec.ts-snapshots/Resolve-Errors-Syntax-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts index 855365b72..7c6648a03 100644 --- a/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts +++ b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts @@ -1,6 +1,7 @@ import { expect } from '@playwright/test'; import { test } from '../../fixtures/testFixture'; import { clickLinkWithRetry } from '../../utils/clickExternalLinkWithRetry'; +import { checkSnapshot } from '../../utils/snapshotTesting'; test('Institution Profile Page', async ({ page, navigateToFilingHome }) => { // Go to Profile page @@ -20,6 +21,7 @@ test('Institution Profile Page', async ({ page, navigateToFilingHome }) => { await expect(page.locator('h1'), 'h1 is correct').toContainText( 'View your financial institution profile', ); + await checkSnapshot(page); }); // Check Detail Headings diff --git a/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts-snapshots/Institution-Profile-Page-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts-snapshots/Institution-Profile-Page-1-chromium-darwin.png new file mode 100644 index 000000000..4eea51d3e Binary files /dev/null and b/e2e/pages/shared-lending-platform/InstitutionProfile.spec.ts-snapshots/Institution-Profile-Page-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts b/e2e/pages/shared-lending-platform/Navigation.spec.ts index 07fea734e..db063f69b 100644 --- a/e2e/pages/shared-lending-platform/Navigation.spec.ts +++ b/e2e/pages/shared-lending-platform/Navigation.spec.ts @@ -1,6 +1,9 @@ import { expect } from '@playwright/test'; import { test } from '../../fixtures/testFixture'; import { clickLinkWithRetry } from '../../utils/clickExternalLinkWithRetry'; +import { checkSnapshot } from '../../utils/snapshotTesting'; + +// Note: Skipped snapshot tests for pages outside of the SBL site test('Navigation', async ({ page, navigateToFilingHome }) => { navigateToFilingHome; @@ -14,6 +17,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { await expect(page.locator('h1')).toContainText( 'File your small business lending data', ); + await checkSnapshot(page); // Test Home Link await page @@ -21,6 +25,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { .getByRole('link', { name: 'Home', exact: false }) .click(); await expect(page.locator('h1')).toContainText('File your lending data'); + await checkSnapshot(page); // Test Profile Link await page @@ -28,6 +33,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { .getByRole('link', { name: 'Playwright Test User' }) .click(); await expect(page.locator('h1')).toContainText('View your user profile'); + await checkSnapshot(page); }); await test.step('Breadcrumb Navigation', async () => { @@ -38,6 +44,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { await expect(page.locator('h1')).toContainText( 'View your financial institution profile', ); + await checkSnapshot(page); await page .getByRole('link', { name: 'Update your financial institution profile', @@ -47,6 +54,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { await expect(page.locator('h1')).toContainText( 'Update your financial institution profile', ); + await checkSnapshot(page); await page .getByRole('link', { name: 'View your financial institution profile' }) .click(); @@ -244,6 +252,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { 'Get started filing your lending data', ); await expect(page.locator('.navbar .nav-items')).toHaveCount(0); + await checkSnapshot(page); // Test CFPB Logo Link await clickLinkWithRetry({ page, target: page.getByLabel('Home') }); diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-1-chromium-darwin.png new file mode 100644 index 000000000..2e0ac7017 Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-2-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-2-chromium-darwin.png new file mode 100644 index 000000000..a9426523e Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-2-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-3-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-3-chromium-darwin.png new file mode 100644 index 000000000..69d17126b Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-3-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-4-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-4-chromium-darwin.png new file mode 100644 index 000000000..4eea51d3e Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-4-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-5-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-5-chromium-darwin.png new file mode 100644 index 000000000..8f24efd65 Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-5-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-6-chromium-darwin.png b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-6-chromium-darwin.png new file mode 100644 index 000000000..4bb5dfc26 Binary files /dev/null and b/e2e/pages/shared-lending-platform/Navigation.spec.ts-snapshots/Navigation-6-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts index e40bd2f7f..9ae596880 100644 --- a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts +++ b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts @@ -1,8 +1,9 @@ import { expect } from '@playwright/test'; +import { DefaultInputCharLimit, LeiInputCharLimit } from 'utils/constants'; import { test } from '../../fixtures/testFixture'; -import { controlUnicode } from '../../utils/unicodeConstants'; import { assertTextInput } from '../../utils/inputValidators'; -import { DefaultInputCharLimit, LeiInputCharLimit } from 'utils/constants'; +import { checkSnapshot } from '../../utils/snapshotTesting'; +import { controlUnicode } from '../../utils/unicodeConstants'; const expectedNoAssociationsSummaryUrl = /\/profile\/complete\/summary\/submitted$/; @@ -25,11 +26,13 @@ test('Complete User Profile -- No Associations -- process', async ({ await page .getByLabel('Legal Entity Identifier (LEI)') .fill('12345678901234567890'); + await checkSnapshot(page); await page.getByLabel('Submit User Profile').click(); // redirected to the summary page await expect(page).toHaveURL(expectedNoAssociationsSummaryUrl); await expect(page.locator('#Summary div').first()).toBeVisible(); + await checkSnapshot(page); }); }); @@ -70,5 +73,6 @@ test('Complete User Profile with Bad Unicode -- No Associations -- process', asy expected: expectedValues.leiField, unexpected: unexpectedValues.leiField, }); + await checkSnapshot(page); }); }); diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png new file mode 100644 index 000000000..e282fefa3 Binary files /dev/null and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png new file mode 100644 index 000000000..983a53178 Binary files /dev/null and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png new file mode 100644 index 000000000..5960d89ae Binary files /dev/null and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts index 20526e822..eed29514f 100644 --- a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts +++ b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts @@ -1,7 +1,8 @@ import { expect } from '@playwright/test'; -import { test } from '../../fixtures/testFixture'; import { DefaultInputCharLimit } from 'utils/constants'; +import { test } from '../../fixtures/testFixture'; import { assertTextInput } from '../../utils/inputValidators'; +import { checkSnapshot } from '../../utils/snapshotTesting'; import { controlUnicode } from '../../utils/unicodeConstants'; test('Update Institution Profile Page', async ({ @@ -20,6 +21,7 @@ test('Update Institution Profile Page', async ({ .getByRole('link', { name: 'RegTech Regional Reserve - ' }) .click(); }); + await checkSnapshot(page); }); // Institution Profile page @@ -35,6 +37,7 @@ test('Update Institution Profile Page', async ({ .first() .click(); }); + await checkSnapshot(page); }); // Update Institution Profile page @@ -151,6 +154,8 @@ test('Update Institution Profile Page', async ({ page.locator('#top_holder_rssd_id'), 'Top-Holder RSSD is editable', ).toBeEditable(); + + await checkSnapshot(page); }); // Reset Form @@ -160,6 +165,8 @@ test('Update Institution Profile Page', async ({ page.getByLabel('You must enter a type of'), 'Other field reset', ).not.toBeEnabled(); + + await checkSnapshot(page); }); // Add Other (again) @@ -190,6 +197,8 @@ test('Update Institution Profile Page', async ({ 'mailto:SBLHelp@cfpb.gov?subject=[BETA] Update your financial institution profile: Questions after submitting form', ); }); + + await checkSnapshot(page); }); }); @@ -295,5 +304,7 @@ test('Update Institution Profile Page: Check Character Limits', async ({ expected: expectedValues.topRssdField, unexpected: unexpectedValues.topRssdField, }); + + await checkSnapshot(page); }); }); diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-1-chromium-darwin.png new file mode 100644 index 000000000..4eea51d3e Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-2-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-2-chromium-darwin.png new file mode 100644 index 000000000..8f24efd65 Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-2-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-3-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-3-chromium-darwin.png new file mode 100644 index 000000000..090e383aa Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-3-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-4-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-4-chromium-darwin.png new file mode 100644 index 000000000..af3107f66 Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-4-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-5-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-5-chromium-darwin.png new file mode 100644 index 000000000..c57ec24c9 Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-5-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-Check-Character-Limits-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-Check-Character-Limits-1-chromium-darwin.png new file mode 100644 index 000000000..4fe350663 Binary files /dev/null and b/e2e/pages/shared-lending-platform/UpdateInstitutionProfile.spec.ts-snapshots/Update-Institution-Profile-Page-Check-Character-Limits-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/UserProfile.spec.ts b/e2e/pages/shared-lending-platform/UserProfile.spec.ts index 8e7f06c4d..50f361cae 100644 --- a/e2e/pages/shared-lending-platform/UserProfile.spec.ts +++ b/e2e/pages/shared-lending-platform/UserProfile.spec.ts @@ -1,5 +1,6 @@ import { expect } from '@playwright/test'; import { test } from '../../fixtures/testFixture'; +import { checkSnapshot } from '../../utils/snapshotTesting'; test('User Profile Page', async ({ page, navigateToFilingHome }) => { // Go to Profile page @@ -7,6 +8,7 @@ test('User Profile Page', async ({ page, navigateToFilingHome }) => { navigateToFilingHome; await page.goto('/profile/view'); await expect(page.locator('h1')).toContainText('View your user profile'); + await checkSnapshot(page); }); // Verify Name + Email diff --git a/e2e/pages/shared-lending-platform/UserProfile.spec.ts-snapshots/User-Profile-Page-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/UserProfile.spec.ts-snapshots/User-Profile-Page-1-chromium-darwin.png new file mode 100644 index 000000000..61f8bc108 Binary files /dev/null and b/e2e/pages/shared-lending-platform/UserProfile.spec.ts-snapshots/User-Profile-Page-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts index 2d348d3e3..68f792aa0 100644 --- a/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts +++ b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts @@ -1,5 +1,6 @@ import { expect, test } from '@playwright/test'; import { webcrypto } from 'node:crypto'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; // this is just an example test (e2e tests should be way longer than this) test('Unauthenticated homepage: Registering with an invalid email domain', async ({ @@ -35,6 +36,7 @@ test('Unauthenticated homepage: Registering with an invalid email domain', async await expect(page.getByRole('heading')).toContainText( 'Your email domain is not authorized', ); + await checkSnapshot(page); await expect(page.locator('#Summary div').first()).toBeVisible(); }); }); diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png new file mode 100644 index 000000000..80ffa9b85 Binary files /dev/null and b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts b/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts index cd54f4955..74a8604f7 100644 --- a/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts +++ b/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from '@playwright/test'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { expectedPaperworkReductionActUrl } from '../../../utils/testFixture.utils'; test('Unauthenticated homepage: Paperwork Reduction Act', async ({ page }) => { @@ -10,6 +11,7 @@ test('Unauthenticated homepage: Paperwork Reduction Act', async ({ page }) => { await expect( page.getByRole('link', { name: 'View Paperwork Reduction Act' }), ).toBeVisible(); + await checkSnapshot(page); }); await test.step('Navigates to the Paperwork Reduction Act summary', async () => { diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts-snapshots/Unauthenticated-homepage-Paperwork-Reduction-Act-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts-snapshots/Unauthenticated-homepage-Paperwork-Reduction-Act-1-chromium-darwin.png new file mode 100644 index 000000000..4bb5dfc26 Binary files /dev/null and b/e2e/pages/shared-lending-platform/unauthenticated-homepage/paperworkReductionAct.spec.ts-snapshots/Unauthenticated-homepage-Paperwork-Reduction-Act-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts index 3e6b835e5..b7d222627 100644 --- a/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts +++ b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from '@playwright/test'; +import { checkSnapshot } from '../../../utils/snapshotTesting'; import { expectedPrivacyNoticeUrl } from '../../../utils/testFixture.utils'; test('Unauthenticated homepage: Privacy Notice', async ({ page }) => { @@ -8,6 +9,7 @@ test('Unauthenticated homepage: Privacy Notice', async ({ page }) => { await expect( page.getByRole('link', { name: 'View Privacy Notice' }), ).toBeVisible(); + await checkSnapshot(page); }); await test.step('Navigates to the Privacy Notice summary', async () => { @@ -15,5 +17,6 @@ test('Unauthenticated homepage: Privacy Notice', async ({ page }) => { await expect(page).toHaveURL(expectedPrivacyNoticeUrl); await expect(page.getByText('/Home')).toBeVisible(); await expect(page.getByRole('heading')).toContainText('Privacy Notice'); + await checkSnapshot(page); }); }); diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-1-chromium-darwin.png new file mode 100644 index 000000000..4bb5dfc26 Binary files /dev/null and b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-2-chromium-darwin.png b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-2-chromium-darwin.png new file mode 100644 index 000000000..d17c69371 Binary files /dev/null and b/e2e/pages/shared-lending-platform/unauthenticated-homepage/privacyNotice.spec.ts-snapshots/Unauthenticated-homepage-Privacy-Notice-2-chromium-darwin.png differ diff --git a/e2e/utils/blockApi.ts b/e2e/utils/blockApi.ts index 1a970b300..fce45af10 100644 --- a/e2e/utils/blockApi.ts +++ b/e2e/utils/blockApi.ts @@ -1,6 +1,7 @@ import type { Page } from '@playwright/test'; import { expect } from '@playwright/test'; import { test } from '../fixtures/testFixture'; +import { checkSnapshot } from './snapshotTesting'; export async function blockApi( page: Page, @@ -57,6 +58,7 @@ export const verifyApiBlockThenUnblock = async ({ await expect(page.locator('h1'), 'h1 is correct').toContainText( 'An unknown error occurred', ); + await checkSnapshot(page); }); // Unblock API Call diff --git a/package.json b/package.json index 1ba0c88ca..77731e6c3 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "test:ci": "vitest run", "test:e2e": "chmod +x ./run-playwright.sh && sh ./run-playwright.sh", "test:e2e:snapshot": "chmod +x ./run-playwright.sh && SBL_ENABLE_PLAYWRIGHT_SNAPSHOT_TESTING=true sh ./run-playwright.sh", + "test:e2e:snapshot-update": "SBL_ENABLE_PLAYWRIGHT_SNAPSHOT_TESTING=true yarn playwright test --update-snapshots", "format": "prettier -uw --cache .", "run-tsc": "tsc", "run-eslint": "eslint --cache --fix --ignore-path .gitignore --ignore-path .eslintignore --ext .ts,.tsx .", diff --git a/src/components/AssociatedInstitution.tsx b/src/components/AssociatedInstitution.tsx index ec0f869c3..80b7002cd 100644 --- a/src/components/AssociatedInstitution.tsx +++ b/src/components/AssociatedInstitution.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/require-default-props */ import { ListLink } from 'components/Link'; -import { formatPipeSeparatedString } from 'utils/formatting'; import type { InstitutionDetailsApiType } from 'types/formTypes'; +import { formatPipeSeparatedString } from 'utils/formatting'; export function AssociatedInstitution({ name, @@ -17,7 +17,7 @@ export function AssociatedInstitution({ } return ( - + {text} ); diff --git a/src/pages/Filing/FilingApp/FileDetailsUpload.tsx b/src/pages/Filing/FilingApp/FileDetailsUpload.tsx index 7461cbcf9..960894c66 100644 --- a/src/pages/Filing/FilingApp/FileDetailsUpload.tsx +++ b/src/pages/Filing/FilingApp/FileDetailsUpload.tsx @@ -23,7 +23,7 @@ function FileDetailsUpload({ {dataGetSubmissionLatest.filename} - + Uploaded by {dataGetSubmissionLatest.submitter.user_name} on{' '} {`${formatDateTimeShort( // @ts-expect-error Luxon expects string when it should be string | Date diff --git a/src/pages/Filing/FilingApp/FilingSubmit.helpers.tsx b/src/pages/Filing/FilingApp/FilingSubmit.helpers.tsx index 65f6ad6a1..38d5088f3 100644 --- a/src/pages/Filing/FilingApp/FilingSubmit.helpers.tsx +++ b/src/pages/Filing/FilingApp/FilingSubmit.helpers.tsx @@ -103,9 +103,14 @@ export function FileInformation({ - + @@ -176,6 +181,7 @@ export function SignCertify({ checked={value} onChange={onChange} disabled + className='snapshot-ignore' /> diff --git a/src/pages/Filing/FilingApp/InstitutionHeading.tsx b/src/pages/Filing/FilingApp/InstitutionHeading.tsx index 9c6086ead..87eba45ff 100644 --- a/src/pages/Filing/FilingApp/InstitutionHeading.tsx +++ b/src/pages/Filing/FilingApp/InstitutionHeading.tsx @@ -1,6 +1,6 @@ import { Heading } from 'design-system-react'; -import { formatPipeSeparatedString } from '../../../utils/formatting'; import type { HeadingType } from 'design-system-react/dist/components/Headings/Heading'; +import { formatPipeSeparatedString } from '../../../utils/formatting'; import type { InstitutionDataType } from './InstitutionCard.types'; // Format the Institution name + LEI @@ -12,7 +12,7 @@ function InstitutionHeading({ // eslint-disable-next-line react/require-default-props }: InstitutionDataType & { headingType?: HeadingType }): JSX.Element { return ( - + { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing formatPipeSeparatedString([name || lei, filingPeriod]) diff --git a/src/pages/Filing/UpdateFinancialProfile/UpdateIdentifyingInformation.tsx b/src/pages/Filing/UpdateFinancialProfile/UpdateIdentifyingInformation.tsx index 4e75ea500..8d32f16ff 100644 --- a/src/pages/Filing/UpdateFinancialProfile/UpdateIdentifyingInformation.tsx +++ b/src/pages/Filing/UpdateFinancialProfile/UpdateIdentifyingInformation.tsx @@ -83,6 +83,7 @@ function UpdateIdentifyingInformation({ {...register(taxID)} errorMessage={formErrors[taxID]?.message} showError + className='snapshot-ignore' /> diff --git a/src/pages/Filing/ViewInstitutionProfile/FinancialInstitutionDetails.tsx b/src/pages/Filing/ViewInstitutionProfile/FinancialInstitutionDetails.tsx index 40c3a388f..6ed27000f 100644 --- a/src/pages/Filing/ViewInstitutionProfile/FinancialInstitutionDetails.tsx +++ b/src/pages/Filing/ViewInstitutionProfile/FinancialInstitutionDetails.tsx @@ -68,6 +68,7 @@ export function FinancialInstitutionDetails({ } /> - + ) : ( '' diff --git a/src/pages/Filing/ViewInstitutionProfile/IdentifyingInformation.tsx b/src/pages/Filing/ViewInstitutionProfile/IdentifyingInformation.tsx index d735413a5..868a99e5e 100644 --- a/src/pages/Filing/ViewInstitutionProfile/IdentifyingInformation.tsx +++ b/src/pages/Filing/ViewInstitutionProfile/IdentifyingInformation.tsx @@ -65,8 +65,13 @@ export function IdentifyingInformation({ value={data.tax_id} fallbackValue={NOT_PROVIDED} alertStatus={alertStatus} + className='snapshot-ignore' + /> + - {data.name}} + className='snapshot-ignore' /> {data.email}} + className='snapshot-ignore' />