Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture elements are captured, including art direction #208

Merged
merged 21 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/eighty-bikes-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@chromatic-com/playwright': minor
'@chromatic-com/cypress': minor
'@chromatic-com/shared-e2e': minor
---

Picture tags are archived
36 changes: 36 additions & 0 deletions packages/cypress/tests/cypress/e2e/archiving-assets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,42 @@ it('srcset is used to determine image asset URL', () => {
cy.visit('/asset-paths/srcset');
});

it('picture source is captured, multiple source elements', () => {
cy.visit('/asset-paths/picture');
});

// TODO: Unskip when we use one-archive-per-test in Cypress (like we do in Playwright)
// currently, we use one archive for all the tests, but in this case it means we capture
// the wrong image (since the unmatching images are already in the global archive, we
// mistakenly assume they were "captured" by this test and use them instead of the fallback image)
context.skip('mobile', { viewportWidth: 500, viewportHeight: 500 }, () => {
it('picture source is captured, multiple source elements', () => {
cy.visit('/asset-paths/picture');
});
});

// TODO: Unskip when we use one-archive-per-test in Cypress (like we do in Playwright)
// currently, we use one archive for all the tests, but in this case it means we capture
// the wrong image (since the unmatching images are already in the global archive, we
// mistakenly assume they were "captured" by this test and use them instead of the fallback image)
it.skip('picture captures fallback image', () => {
cy.visit('/asset-paths/picture-no-matching-source');
});

it('picture source is captured, single source with srcset', () => {
cy.visit('/asset-paths/picture-multiple-srcset');
});

// TODO: Unskip when we use one-archive-per-test in Cypress (like we do in Playwright)
// currently, we use one archive for all the tests, but in this case it means we capture
// the wrong image (since the unmatching images are already in the global archive, we
// mistakenly assume they were "captured" by this test and use them instead of the fallback image)
context.skip('mobile', { viewportWidth: 500, viewportHeight: 500 }, () => {
it('picture source is captured, single source with srcset', () => {
cy.visit('/asset-paths/picture-multiple-srcset');
});
});

it('external CSS files are inlined', () => {
cy.visit('/asset-paths/external-css-files');
});
Expand Down
12 changes: 12 additions & 0 deletions packages/playwright/tests/archiving-assets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ test('srcset is used to determine image asset URL', async ({ page }) => {
await page.goto('/asset-paths/srcset');
});

test('picture source is captured, multiple source elements', async ({ page }) => {
await page.goto('/asset-paths/picture');
});

test('picture source is captured, single source with srcset', async ({ page }) => {
await page.goto('/asset-paths/picture-multiple-srcset');
});

test('picture captures fallback image', async ({ page }) => {
await page.goto('/asset-paths/picture-no-matching-source');
});

test('external CSS files are inlined', async ({ page }) => {
await page.goto('/asset-paths/external-css-files');
});
Expand Down
Loading
Loading