From e3a0935c954b5774eff472dbb6649ed75c5987d8 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 27 Apr 2023 17:42:00 -0400 Subject: [PATCH] test(header): migrate to generators (#27311) Issue number: N/A --------- ## What is the current behavior? Header tests us legacy syntax ## What is the new behavior? - Header tests us generator syntax ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- .../header/test/a11y/header.e2e-legacy.ts | 34 --------- .../components/header/test/a11y/header.e2e.ts | 34 +++++++++ .../{header.e2e-legacy.ts => header.e2e.ts} | 65 +++++++++++------- ...eader-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...ader-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...eader-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...eader-diff-ios-rtl-Mobile-Chrome-linux.png | Bin ...ader-diff-ios-rtl-Mobile-Firefox-linux.png | Bin ...eader-diff-ios-rtl-Mobile-Safari-linux.png | Bin ...header-diff-md-ltr-Mobile-Chrome-linux.png | Bin ...eader-diff-md-ltr-Mobile-Firefox-linux.png | Bin ...header-diff-md-ltr-Mobile-Safari-linux.png | Bin ...header-diff-md-rtl-Mobile-Chrome-linux.png | Bin ...eader-diff-md-rtl-Mobile-Firefox-linux.png | Bin ...header-diff-md-rtl-Mobile-Safari-linux.png | Bin ...order-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...rder-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...order-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...border-diff-md-ltr-Mobile-Chrome-linux.png | Bin ...order-diff-md-ltr-Mobile-Firefox-linux.png | Bin ...border-diff-md-ltr-Mobile-Safari-linux.png | Bin ...color-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...olor-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...color-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...ucent-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...cent-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...ucent-diff-ios-ltr-Mobile-Safari-linux.png | Bin .../header/test/condense/header.e2e-legacy.ts | 45 ------------ .../header/test/condense/header.e2e.ts | 38 ++++++++++ ...apsed-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...psed-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...apsed-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...itial-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...tial-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...itial-diff-ios-ltr-Mobile-Safari-linux.png | Bin .../header/test/fade/header.e2e-legacy.ts | 27 -------- .../components/header/test/fade/header.e2e.ts | 22 ++++++ ...urred-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...rred-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...rred-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Safari-linux.png | Bin .../test/scroll-target/header.e2e-legacy.ts | 32 --------- .../header/test/scroll-target/header.e2e.ts | 27 ++++++++ ...urred-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...rred-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Safari-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Chrome-linux.png | Bin ...rred-diff-ios-ltr-Mobile-Firefox-linux.png | Bin ...urred-diff-ios-ltr-Mobile-Safari-linux.png | Bin 51 files changed, 160 insertions(+), 164 deletions(-) delete mode 100644 core/src/components/header/test/a11y/header.e2e-legacy.ts create mode 100644 core/src/components/header/test/a11y/header.e2e.ts rename core/src/components/header/test/basic/{header.e2e-legacy.ts => header.e2e.ts} (57%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-rtl-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-rtl-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-ios-rtl-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-rtl-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-rtl-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-diff-md-rtl-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-no-border-diff-md-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-color-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/basic/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png (100%) delete mode 100644 core/src/components/header/test/condense/header.e2e-legacy.ts create mode 100644 core/src/components/header/test/condense/header.e2e.ts rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/condense/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png (100%) delete mode 100644 core/src/components/header/test/fade/header.e2e-legacy.ts create mode 100644 core/src/components/header/test/fade/header.e2e.ts rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-blurred-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-blurred-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-blurred-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/fade/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-fade-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png (100%) delete mode 100644 core/src/components/header/test/scroll-target/header.e2e-legacy.ts create mode 100644 core/src/components/header/test/scroll-target/header.e2e.ts rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-blurred-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-blurred-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-blurred-diff-ios-ltr-Mobile-Safari-linux.png (100%) rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png (100%) rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png (100%) rename core/src/components/header/test/scroll-target/{header.e2e-legacy.ts-snapshots => header.e2e.ts-snapshots}/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png (100%) diff --git a/core/src/components/header/test/a11y/header.e2e-legacy.ts b/core/src/components/header/test/a11y/header.e2e-legacy.ts deleted file mode 100644 index f948f7dbd1..0000000000 --- a/core/src/components/header/test/a11y/header.e2e-legacy.ts +++ /dev/null @@ -1,34 +0,0 @@ -import AxeBuilder from '@axe-core/playwright'; -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('header: a11y', () => { - test.beforeEach(async ({ skip }) => { - skip.rtl(); - skip.mode('md'); - }); - - test('should not have accessibility violations', async ({ page }) => { - await page.goto(`/src/components/header/test/a11y`); - - const headers = page.locator('ion-header'); - await expect(headers.first()).toHaveAttribute('role', 'banner'); - await expect(headers.last()).toHaveAttribute('role', 'none'); - - const results = await new AxeBuilder({ page }).analyze(); - expect(results.violations).toEqual([]); - }); - - test('should allow for custom role', async ({ page }) => { - /** - * Note: This example should not be used in production. - * This only serves to check that `role` can be customized. - */ - await page.setContent(` - - `); - const header = page.locator('ion-header'); - - await expect(header).toHaveAttribute('role', 'heading'); - }); -}); diff --git a/core/src/components/header/test/a11y/header.e2e.ts b/core/src/components/header/test/a11y/header.e2e.ts new file mode 100644 index 0000000000..51f35b7d8e --- /dev/null +++ b/core/src/components/header/test/a11y/header.e2e.ts @@ -0,0 +1,34 @@ +import AxeBuilder from '@axe-core/playwright'; +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('header: a11y'), () => { + test('should not have accessibility violations', async ({ page }) => { + await page.goto(`/src/components/header/test/a11y`, config); + + const headers = page.locator('ion-header'); + await expect(headers.first()).toHaveAttribute('role', 'banner'); + await expect(headers.last()).toHaveAttribute('role', 'none'); + + const results = await new AxeBuilder({ page }).analyze(); + expect(results.violations).toEqual([]); + }); + + test('should allow for custom role', async ({ page }) => { + /** + * Note: This example should not be used in production. + * This only serves to check that `role` can be customized. + */ + await page.setContent( + ` + + `, + config + ); + const header = page.locator('ion-header'); + + await expect(header).toHaveAttribute('role', 'heading'); + }); + }); +}); diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts b/core/src/components/header/test/basic/header.e2e.ts similarity index 57% rename from core/src/components/header/test/basic/header.e2e-legacy.ts rename to core/src/components/header/test/basic/header.e2e.ts index 9d636eff97..5550bc575d 100644 --- a/core/src/components/header/test/basic/header.e2e-legacy.ts +++ b/core/src/components/header/test/basic/header.e2e.ts @@ -1,44 +1,54 @@ import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; +import { configs, test } from '@utils/test/playwright'; -test.describe('header: basic', () => { - test.describe('header: rendering', () => { +configs().forEach(({ title, screenshot, config }) => { + test.describe(title('header: rendering'), () => { test('should not have visual regressions with basic header', async ({ page }) => { - await page.setContent(` + await page.setContent( + ` Header - Default - `); + `, + config + ); const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-diff-${page.getSnapshotSettings()}.png`); + await expect(header).toHaveScreenshot(screenshot(`header-diff`)); }); }); +}); - test.describe('header: feature rendering', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - }); - +configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('header: feature rendering'), () => { test('should not have visual regressions with no border', async ({ page }) => { - await page.setContent(` + await page.setContent( + ` Header - No Border - `); + `, + config + ); const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-no-border-diff-${page.getSnapshotSettings()}.png`); + await expect(header).toHaveScreenshot(screenshot(`header-no-border-diff`)); }); + }); +}); - test('should not have visual regressions with translucent header', async ({ page, skip }) => { - skip.mode('md', 'Translucent effect is only available in iOS mode.'); - - await page.setContent(` +/** + * Translucent effect is only available in iOS mode. + */ +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('header: translucent'), () => { + test('should not have visual regressions with translucent header', async ({ page }) => { + await page.setContent( + `
@@ -47,16 +57,17 @@ test.describe('header: basic', () => { Header - Translucent - `); + `, + config + ); const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-translucent-diff-${page.getSnapshotSettings()}.png`); + await expect(header).toHaveScreenshot(screenshot(`header-translucent-diff`)); }); - test('should not have visual regressions with translucent header with color', async ({ page, skip }) => { - skip.mode('md', 'Translucent effect is only available in iOS mode.'); - - await page.setContent(` + test('should not have visual regressions with translucent header with color', async ({ page }) => { + await page.setContent( + `
@@ -65,10 +76,12 @@ test.describe('header: basic', () => { Header - Translucent - `); + `, + config + ); const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-translucent-color-diff-${page.getSnapshotSettings()}.png`); + await expect(header).toHaveScreenshot(screenshot(`header-translucent-color-diff`)); }); }); }); diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-ios-rtl-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-diff-md-rtl-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/basic/header.e2e-legacy.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts b/core/src/components/header/test/condense/header.e2e-legacy.ts deleted file mode 100644 index 7eae2fa32c..0000000000 --- a/core/src/components/header/test/condense/header.e2e-legacy.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('header: condense', () => { - test('should be hidden from screen readers when collapsed', async ({ page, skip }) => { - skip.mode('md'); - skip.rtl(); - - await page.goto('/src/components/header/test/condense'); - const largeTitleHeader = page.locator('#largeTitleHeader'); - const smallTitleHeader = page.locator('#smallTitleHeader'); - const content = page.locator('ion-content'); - - await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true'); - - await expect(largeTitleHeader).toHaveScreenshot( - `header-condense-large-title-initial-diff-${page.getSnapshotSettings()}.png`, - { animations: 'disabled' } - ); - - await content.evaluate(async (el: HTMLIonContentElement) => { - await el.scrollToBottom(); - }); - await page.waitForSelector('#largeTitleHeader.header-collapse-condense-inactive'); - - await expect(smallTitleHeader).toHaveScreenshot( - `header-condense-large-title-collapsed-diff-${page.getSnapshotSettings()}.png`, - { animations: 'disabled' } - ); - - /** - * Playwright can't do .not.toHaveAttribute() because a value is expected, - * and toHaveAttribute can't accept a value of type null. - */ - const ariaHidden = await smallTitleHeader.getAttribute('aria-hidden'); - expect(ariaHidden).toBeNull(); - - await content.evaluate(async (el: HTMLIonContentElement) => { - await el.scrollToTop(); - }); - await page.waitForSelector('#smallTitleHeader.header-collapse-condense-inactive'); - - await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true'); - }); -}); diff --git a/core/src/components/header/test/condense/header.e2e.ts b/core/src/components/header/test/condense/header.e2e.ts new file mode 100644 index 0000000000..c2ac59efd0 --- /dev/null +++ b/core/src/components/header/test/condense/header.e2e.ts @@ -0,0 +1,38 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('header: condense'), () => { + test('should be hidden from screen readers when collapsed', async ({ page }) => { + await page.goto('/src/components/header/test/condense', config); + const largeTitleHeader = page.locator('#largeTitleHeader'); + const smallTitleHeader = page.locator('#smallTitleHeader'); + const content = page.locator('ion-content'); + + await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true'); + + await expect(largeTitleHeader).toHaveScreenshot(screenshot(`header-condense-large-title-initial-diff`)); + + await content.evaluate(async (el: HTMLIonContentElement) => { + await el.scrollToBottom(); + }); + await page.waitForSelector('#largeTitleHeader.header-collapse-condense-inactive'); + + await expect(smallTitleHeader).toHaveScreenshot(screenshot(`header-condense-large-title-collapsed-diff`)); + + /** + * Playwright can't do .not.toHaveAttribute() because a value is expected, + * and toHaveAttribute can't accept a value of type null. + */ + const ariaHidden = await smallTitleHeader.getAttribute('aria-hidden'); + expect(ariaHidden).toBeNull(); + + await content.evaluate(async (el: HTMLIonContentElement) => { + await el.scrollToTop(); + }); + await page.waitForSelector('#smallTitleHeader.header-collapse-condense-inactive'); + + await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true'); + }); + }); +}); diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/condense/header.e2e-legacy.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts b/core/src/components/header/test/fade/header.e2e-legacy.ts deleted file mode 100644 index c7b9bf8f8e..0000000000 --- a/core/src/components/header/test/fade/header.e2e-legacy.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('header: fade', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - }); - - test('should not have visual regressions with fade header', async ({ page, skip }) => { - skip.mode('md', 'Translucent effect is only available in iOS mode.'); - - await page.goto('/src/components/header/test/fade'); - - const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-fade-not-blurred-diff-${page.getSnapshotSettings()}.png`, { - animations: 'disabled', - }); - - const content = page.locator('ion-content'); - await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0)); - await page.waitForChanges(); - - await expect(header).toHaveScreenshot(`header-fade-blurred-diff-${page.getSnapshotSettings()}.png`, { - animations: 'disabled', - }); - }); -}); diff --git a/core/src/components/header/test/fade/header.e2e.ts b/core/src/components/header/test/fade/header.e2e.ts new file mode 100644 index 0000000000..5bf7a0fbf6 --- /dev/null +++ b/core/src/components/header/test/fade/header.e2e.ts @@ -0,0 +1,22 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +/** + * Translucent effect is only available in iOS mode. + */ +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('header: fade'), () => { + test('should not have visual regressions with fade header', async ({ page }) => { + await page.goto('/src/components/header/test/fade', config); + + const header = page.locator('ion-header'); + await expect(header).toHaveScreenshot(screenshot(`header-fade-not-blurred-diff`)); + + const content = page.locator('ion-content'); + await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom(0)); + await page.waitForChanges(); + + await expect(header).toHaveScreenshot(screenshot(`header-fade-blurred-diff`)); + }); + }); +}); diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-blurred-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/fade/header.e2e-legacy.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/fade/header.e2e.ts-snapshots/header-fade-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts b/core/src/components/header/test/scroll-target/header.e2e-legacy.ts deleted file mode 100644 index dc0584e1bc..0000000000 --- a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { expect } from '@playwright/test'; -import { test } from '@utils/test/playwright'; - -test.describe('header: scroll-target', () => { - test.beforeEach(({ skip }) => { - skip.rtl(); - }); - - /** - * This test suite verifies that the fade effect for iOS is working correctly - * when the `ion-header` is using a custom scroll target with the `.ion-content-scroll-host` - * selector. - */ - test('should not have visual regressions with custom scroll target header', async ({ page, skip }) => { - skip.mode('md', 'Translucent effect is only available in iOS mode.'); - - await page.goto('/src/components/header/test/scroll-target'); - - const header = page.locator('ion-header'); - await expect(header).toHaveScreenshot(`header-scroll-target-not-blurred-diff-${page.getSnapshotSettings()}.png`, { - animations: 'disabled', - }); - - const scrollTarget = page.locator('#scroll-target'); - await scrollTarget.evaluate((el: HTMLDivElement) => (el.scrollTop = el.scrollHeight)); - await page.waitForChanges(); - - await expect(header).toHaveScreenshot(`header-scroll-target-blurred-diff-${page.getSnapshotSettings()}.png`, { - animations: 'disabled', - }); - }); -}); diff --git a/core/src/components/header/test/scroll-target/header.e2e.ts b/core/src/components/header/test/scroll-target/header.e2e.ts new file mode 100644 index 0000000000..b173ae3dfe --- /dev/null +++ b/core/src/components/header/test/scroll-target/header.e2e.ts @@ -0,0 +1,27 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +/** + * Translucent effect is only available in iOS mode. + */ +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { + test.describe(title('header: scroll-target'), () => { + /** + * This test suite verifies that the fade effect for iOS is working correctly + * when the `ion-header` is using a custom scroll target with the `.ion-content-scroll-host` + * selector. + */ + test('should not have visual regressions with custom scroll target header', async ({ page }) => { + await page.goto('/src/components/header/test/scroll-target', config); + + const header = page.locator('ion-header'); + await expect(header).toHaveScreenshot(screenshot(`header-scroll-target-not-blurred-diff`)); + + const scrollTarget = page.locator('#scroll-target'); + await scrollTarget.evaluate((el: HTMLDivElement) => (el.scrollTop = el.scrollHeight)); + await page.waitForChanges(); + + await expect(header).toHaveScreenshot(screenshot(`header-scroll-target-blurred-diff`)); + }); + }); +}); diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-blurred-diff-ios-ltr-Mobile-Safari-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Chrome-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Firefox-linux.png diff --git a/core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png b/core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png similarity index 100% rename from core/src/components/header/test/scroll-target/header.e2e-legacy.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png rename to core/src/components/header/test/scroll-target/header.e2e.ts-snapshots/header-scroll-target-not-blurred-diff-ios-ltr-Mobile-Safari-linux.png