diff --git a/core/src/components/header/test/a11y/e2e.ts b/core/src/components/header/test/a11y/e2e.ts
deleted file mode 100644
index 59305da702..0000000000
--- a/core/src/components/header/test/a11y/e2e.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { AxePuppeteer } from '@axe-core/puppeteer';
-import { newE2EPage } from '@stencil/core/testing';
-
-test('header: axe', async () => {
- const page = await newE2EPage({
- url: '/src/components/header/test/a11y?ionic:_testing=true',
- });
-
- const results = await new AxePuppeteer(page).analyze();
- expect(results.violations.length).toEqual(0);
-});
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..f948f7dbd1
--- /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 { 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/basic/e2e.ts b/core/src/components/header/test/basic/e2e.ts
deleted file mode 100644
index 9a1f4c86d5..0000000000
--- a/core/src/components/header/test/basic/e2e.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { newE2EPage } from '@stencil/core/testing';
-
-test('header: basic', async () => {
- const page = await newE2EPage({
- url: '/src/components/header/test/basic?ionic:_testing=true',
- });
-
- const compare = await page.compareScreenshot();
- expect(compare).toMatchScreenshot();
-});
diff --git a/core/src/components/header/test/basic/header.e2e.ts b/core/src/components/header/test/basic/header.e2e.ts
new file mode 100644
index 0000000000..0a536794ff
--- /dev/null
+++ b/core/src/components/header/test/basic/header.e2e.ts
@@ -0,0 +1,78 @@
+import { expect } from '@playwright/test';
+import { test } from '@utils/test/playwright';
+
+test.describe('header: basic', () => {
+ test.describe('header: rendering', () => {
+ test('should not have visual regressions with basic header', async ({ page }) => {
+ await page.setContent(`
+
+
+ Header - Default
+
+
+ `);
+
+ const header = page.locator('ion-header');
+ expect(await header.screenshot()).toMatchSnapshot(`header-diff-${page.getSnapshotSettings()}.png`);
+ });
+ });
+
+ test.describe('header: feature rendering', () => {
+ test.beforeEach(({ skip }) => {
+ skip.rtl();
+ });
+
+ test('should not have visual regressions with no border', async ({ page }) => {
+ await page.setContent(`
+
+
+ Header - No Border
+
+
+ `);
+
+ const header = page.locator('ion-header');
+ expect(await header.screenshot()).toMatchSnapshot(`header-no-border-diff-${page.getSnapshotSettings()}.png`);
+ });
+
+ test('should not have visual regressions with translucent header', async ({ page, skip }) => {
+ skip.mode('md', 'Translucent effect is only available in iOS mode.');
+ skip.browser('firefox', 'Firefox has some issues rendering translucent effects on Linux.');
+
+ await page.setContent(`
+
+
+

+
+
+ Header - Translucent
+
+
+ `);
+
+ const header = page.locator('ion-header');
+ expect(await header.screenshot()).toMatchSnapshot(`header-translucent-diff-${page.getSnapshotSettings()}.png`);
+ });
+
+ 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.');
+ skip.browser('firefox', 'Firefox has some issues rendering translucent effects on Linux.');
+
+ await page.setContent(`
+
+
+

+
+
+ Header - Translucent
+
+
+ `);
+
+ const header = page.locator('ion-header');
+ expect(await header.screenshot()).toMatchSnapshot(
+ `header-translucent-color-diff-${page.getSnapshotSettings()}.png`
+ );
+ });
+ });
+});
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..3e8aa22e58
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..55ea7993f9
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..737efe5fe2
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..3e8aa22e58
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..55ea7993f9
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..737efe5fe2
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-ios-rtl-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..3a9b1e9e37
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..03a66cbbfa
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..a125e85d27
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..3b24c3fe30
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..2a35f36947
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..4e720ee658
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-diff-md-rtl-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..2a6c287d9b
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..6b4bb7d693
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..8b85c3eb67
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..9098a8dc06
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..453c1db49d
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..156f85760e
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-no-border-diff-md-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..458edf7720
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..36a70e3537
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-color-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..3e4ac2c41b
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/basic/header.e2e.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
new file mode 100644
index 0000000000..29073b5256
Binary files /dev/null and b/core/src/components/header/test/basic/header.e2e.ts-snapshots/header-translucent-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/basic/index.html b/core/src/components/header/test/basic/index.html
index 41c454785c..2fbfa476b0 100644
--- a/core/src/components/header/test/basic/index.html
+++ b/core/src/components/header/test/basic/index.html
@@ -15,20 +15,13 @@
+
+
+ Header
+
+
-
-
- Header - Default
-
-
-
-
-
-
-
- Header - No Border
-
-
+ Content
diff --git a/core/src/components/header/test/condense/header.e2e.ts b/core/src/components/header/test/condense/header.e2e.ts
index 3312a06ead..f0a1f6ab43 100644
--- a/core/src/components/header/test/condense/header.e2e.ts
+++ b/core/src/components/header/test/condense/header.e2e.ts
@@ -7,24 +7,37 @@ test.describe('header: condense', () => {
skip.rtl();
await page.goto('/src/components/header/test/condense');
- const header = page.locator('#collapsibleHeader');
+ const largeTitleHeader = page.locator('#largeTitleHeader');
+ const smallTitleHeader = page.locator('#smallTitleHeader');
const content = page.locator('ion-content');
- await expect(header).toHaveAttribute('aria-hidden', 'true');
+ await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true');
- await content.evaluate((el: HTMLIonContentElement) => el.scrollToBottom());
- await page.waitForChanges();
+ expect(await largeTitleHeader.screenshot({ animations: 'disabled' })).toMatchSnapshot(
+ `header-condense-large-title-initial-diff-${page.getSnapshotSettings()}.png`
+ );
+
+ await content.evaluate(async (el: HTMLIonContentElement) => {
+ await el.scrollToBottom();
+ });
+ await page.waitForSelector('#largeTitleHeader.header-collapse-condense-inactive');
+
+ expect(await smallTitleHeader.screenshot({ animations: 'disabled' })).toMatchSnapshot(
+ `header-condense-large-title-collapsed-diff-${page.getSnapshotSettings()}.png`
+ );
/**
* Playwright can't do .not.toHaveAttribute() because a value is expected,
* and toHaveAttribute can't accept a value of type null.
*/
- const ariaHidden = await header.getAttribute('aria-hidden');
+ const ariaHidden = await smallTitleHeader.getAttribute('aria-hidden');
expect(ariaHidden).toBeNull();
- await content.evaluate((el: HTMLIonContentElement) => el.scrollToTop());
- await page.waitForChanges();
+ await content.evaluate(async (el: HTMLIonContentElement) => {
+ await el.scrollToTop();
+ });
+ await page.waitForSelector('#smallTitleHeader.header-collapse-condense-inactive');
- await expect(header).toHaveAttribute('aria-hidden', 'true');
+ await expect(smallTitleHeader).toHaveAttribute('aria-hidden', 'true');
});
});
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..2821b49e47
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..bc54f9aad1
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..6fa282afe0
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-collapsed-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..ea15d1c95b
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Chrome-linux.png differ
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..45a3125cf5
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Firefox-linux.png differ
diff --git a/core/src/components/header/test/condense/header.e2e.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
new file mode 100644
index 0000000000..e7a957e4f5
Binary files /dev/null and b/core/src/components/header/test/condense/header.e2e.ts-snapshots/header-condense-large-title-initial-diff-ios-ltr-Mobile-Safari-linux.png differ
diff --git a/core/src/components/header/test/condense/index.html b/core/src/components/header/test/condense/index.html
index dfcf35d00f..f5cfea1635 100644
--- a/core/src/components/header/test/condense/index.html
+++ b/core/src/components/header/test/condense/index.html
@@ -12,79 +12,74 @@
-
-