diff --git a/tests/cypress/e2e/archiving-assets.cy.ts b/tests/cypress/e2e/archiving-assets.cy.ts index 401ab918..37d150f4 100644 --- a/tests/cypress/e2e/archiving-assets.cy.ts +++ b/tests/cypress/e2e/archiving-assets.cy.ts @@ -1,15 +1,25 @@ import { testCases } from './../../test-cases'; +// TODO: Remove when Cypress support achieves parity with Playwright +const skippedTestCases = [ + 'asset doesnt prevent directory from being created', + 'percents in URLs are handled', +]; + describe('assets', () => { // add more tests testCases.forEach(({ title, path: urlPath }) => { - it(title, () => { - if (title === 'external asset is archived') { - // mock the external image (which we'll archive) - cy.intercept('https://some.external/domain/image.png', { fixture: 'pink.png' }); - } + if (skippedTestCases.includes(title)) { + it.skip(title, () => {}); + } else { + it(title, () => { + if (title === 'external asset is archived') { + // mock the external image (which we'll archive) + cy.intercept('https://some.external/domain/image.png', { fixture: 'pink.png' }); + } - cy.visit(`http://localhost:3000/${urlPath}`); - }); + cy.visit(`http://localhost:3000/${urlPath}`); + }); + } }); }); diff --git a/tests/test-cases.ts b/tests/test-cases.ts index 23d065fd..a2c479ae 100644 --- a/tests/test-cases.ts +++ b/tests/test-cases.ts @@ -1,12 +1,15 @@ +// these are used by both Playwright and Cypress. +// They're stored here to make sure we test the same things with both frameworks +// and don't get out of alignment on what we support. export const testCases = [ { title: 'query params determine which asset is served', path: 'asset-paths/query-params', }, - // { - // title: 'asset doesnt prevent directory from being created', - // path: 'asset-paths/asset-at-directory-name' - // }, + { + title: 'asset doesnt prevent directory from being created', + path: 'asset-paths/asset-at-directory-name', + }, { title: 'asset is found at relative path', path: 'asset-paths/relative-path', @@ -27,10 +30,10 @@ export const testCases = [ title: 'assets from css urls are archived', path: 'asset-paths/css-urls', }, - // { - // title: 'percents in URLs are handled', - // path: 'asset-paths/percents' - // }, + { + title: 'percents in URLs are handled', + path: 'asset-paths/percents', + }, { title: 'srcset is used to determine image asset URL', path: 'asset-paths/srcset',