From ad9ba9053e542c6fb9a2332131b93f3de3d6e78c Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 21 Nov 2023 11:53:19 -0600 Subject: [PATCH] :white_check_mark: Add tests for ignored regions in test archiver. Note: This will have to be run through chromatic, since it's a change to the way the capture system works. Refs CAP-1291. --- .../fixtures/dynamic-content.html | 31 +++++++++++++++++++ __playwright-tests__/ignored-regions.spec.ts | 9 ++++++ __playwright-tests__/server.js | 4 +++ 3 files changed, 44 insertions(+) create mode 100644 __playwright-tests__/fixtures/dynamic-content.html create mode 100644 __playwright-tests__/ignored-regions.spec.ts diff --git a/__playwright-tests__/fixtures/dynamic-content.html b/__playwright-tests__/fixtures/dynamic-content.html new file mode 100644 index 00000000..459267ba --- /dev/null +++ b/__playwright-tests__/fixtures/dynamic-content.html @@ -0,0 +1,31 @@ + + + + Dynamic Content E2E Tests + + + +
+

Hello There! The current time is:

+
+
+ + + + \ No newline at end of file diff --git a/__playwright-tests__/ignored-regions.spec.ts b/__playwright-tests__/ignored-regions.spec.ts new file mode 100644 index 00000000..4c49aefe --- /dev/null +++ b/__playwright-tests__/ignored-regions.spec.ts @@ -0,0 +1,9 @@ +import { test, expect } from '../src'; + +// NOTE: This is a test that is meant to be run through Chromatic, so it doesn't actually work +// with the automated test suite. +test('ignored regions work with chromatic', async ({ page }) => { + test.setTimeout(2000); + await page.goto('/ignore'); + await setTimeout(() => {}, 1000); +}); diff --git a/__playwright-tests__/server.js b/__playwright-tests__/server.js index cf3e1606..1f032915 100644 --- a/__playwright-tests__/server.js +++ b/__playwright-tests__/server.js @@ -18,6 +18,10 @@ app.get('/asset-paths', (req, res) => { res.sendFile(path.join(__dirname, 'fixtures/asset-paths.html')); }); +app.get('/ignore', (req, res) => { + res.sendFile(path.join(__dirname, 'fixtures/dynamic-content.html')); +}); + app.get('/forms', (req, res) => { res.sendFile(path.join(__dirname, 'fixtures/forms.html')); });