diff --git a/core/src/components/toast/test/a11y/e2e.ts b/core/src/components/toast/test/a11y/e2e.ts deleted file mode 100644 index 069627d443..0000000000 --- a/core/src/components/toast/test/a11y/e2e.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { AxePuppeteer } from '@axe-core/puppeteer'; -import { newE2EPage } from '@stencil/core/testing'; - -describe('toast accessibility tests', () => { - test('it should not have any axe violations with polite toasts', async () => { - const page = await newE2EPage({ - url: '/src/components/toast/test/a11y?ionic:_testing=true', - }); - - const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); - - await page.click('#polite'); - - await ionToastDidPresent.next(); - - /** - * IonToast overlays the entire screen, so - * Axe will be unable to verify color contrast - * on elements under the toast. - */ - const results = await new AxePuppeteer(page).disableRules('color-contrast').analyze(); - expect(results.violations.length).toEqual(0); - }); - - test('it should not have any axe violations with assertive toasts', async () => { - const page = await newE2EPage({ - url: '/src/components/toast/test/a11y?ionic:_testing=true', - }); - - const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); - - await page.click('#assertive'); - - await ionToastDidPresent.next(); - - /** - * IonToast overlays the entire screen, so - * Axe will be unable to verify color contrast - * on elements under the toast. - */ - const results = await new AxePuppeteer(page).disableRules('color-contrast').analyze(); - expect(results.violations.length).toEqual(0); - }); -}); diff --git a/core/src/components/toast/test/a11y/toast.e2e.ts b/core/src/components/toast/test/a11y/toast.e2e.ts new file mode 100644 index 0000000000..9b98496ef2 --- /dev/null +++ b/core/src/components/toast/test/a11y/toast.e2e.ts @@ -0,0 +1,42 @@ +import AxeBuilder from '@axe-core/playwright'; +import { expect } from '@playwright/test'; +import { test } from '@utils/test/playwright'; + +test.describe('toast: a11y', () => { + test.beforeEach(async ({ page }, testInfo) => { + test.skip(testInfo.project.metadata.rtl === true, 'This test does not check LTR vs RTL layouts'); + await page.goto(`/src/components/toast/test/a11y`); + }); + test('should not have any axe violations with polite toasts', async ({ page }) => { + const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + + const politeButton = page.locator('#polite'); + await politeButton.click(); + + await ionToastDidPresent.next(); + + /** + * IonToast overlays the entire screen, so + * Axe will be unable to verify color contrast + * on elements under the toast. + */ + const results = await new AxeBuilder({ page }).disableRules('color-contrast').analyze(); + expect(results.violations).toEqual([]); + }); + test('should not have any axe violations with assertive toasts', async ({ page }) => { + const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + + const politeButton = page.locator('#assertive'); + await politeButton.click(); + + await ionToastDidPresent.next(); + + /** + * IonToast overlays the entire screen, so + * Axe will be unable to verify color contrast + * on elements under the toast. + */ + const results = await new AxeBuilder({ page }).disableRules('color-contrast').analyze(); + expect(results.violations).toEqual([]); + }); +}); diff --git a/core/src/components/toast/test/basic/e2e.ts b/core/src/components/toast/test/basic/e2e.ts deleted file mode 100644 index 89bb3b4886..0000000000 --- a/core/src/components/toast/test/basic/e2e.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; - -import { testToast } from '../test.utils'; - -const DIRECTORY = 'basic'; - -test('toast: basic, bottom', async () => { - await testToast(DIRECTORY, '#show-bottom-toast'); -}); - -test('toast: basic, middle', async () => { - await testToast(DIRECTORY, '#show-middle-toast'); -}); - -test('toast: basic, top', async () => { - await testToast(DIRECTORY, '#show-top-toast'); -}); - -test('toast: basic, two lines', async () => { - await testToast(DIRECTORY, '#two-line-toast'); -}); - -test('toast: basic, close button', async () => { - await testToast(DIRECTORY, '#close-button-toast'); -}); - -test('toast: basic, custom close text', async () => { - await testToast(DIRECTORY, '#custom-close-text-toast'); -}); - -test('toast: basic, custom buttons', async () => { - await testToast(DIRECTORY, '#custom-action-buttons-toast'); -}); - -test('toast: basic, translucent', async () => { - await testToast(DIRECTORY, '#translucent-toast'); -}); - -test('toast: basic, color', async () => { - await testToast(DIRECTORY, '#color-toast'); -}); - -test('toast: basic, custom class', async () => { - await testToast(DIRECTORY, '#custom-class-toast'); -}); - -test('toast: start end position', async () => { - await testToast(DIRECTORY, '#toast-start-and-end'); -}); - -test('toast: html', async () => { - await testToast(DIRECTORY, '#toast-html'); -}); - -/** - * RTL Tests - */ - -test('toast:rtl: basic, bottom', async () => { - await testToast(DIRECTORY, '#show-bottom-toast', true); -}); - -test('toast:rtl: basic, middle', async () => { - await testToast(DIRECTORY, '#show-middle-toast', true); -}); - -test('toast:rtl: basic, top', async () => { - await testToast(DIRECTORY, '#show-top-toast', true); -}); - -test('toast:rtl: basic, two lines', async () => { - await testToast(DIRECTORY, '#two-line-toast', true); -}); - -test('toast:rtl: basic, close button', async () => { - await testToast(DIRECTORY, '#close-button-toast', true); -}); - -test('toast:rtl: basic, custom close text', async () => { - await testToast(DIRECTORY, '#custom-close-text-toast', true); -}); - -test('toast:rtl: basic, custom buttons', async () => { - await testToast(DIRECTORY, '#custom-action-buttons-toast'); -}); - -test('toast:rtl: basic, translucent', async () => { - await testToast(DIRECTORY, '#translucent-toast', true); -}); - -test('toast:rtl: basic, color', async () => { - await testToast(DIRECTORY, '#color-toast', true); -}); - -test('toast:rtl: basic, custom class', async () => { - await testToast(DIRECTORY, '#custom-class-toast', true); -}); - -test('toast:rtl: start end position', async () => { - await testToast(DIRECTORY, '#toast-start-and-end', true); -}); - -test('toast:rtl: html', async () => { - await testToast(DIRECTORY, '#toast-html', true); -}); - -// Attributes - -test('toast: htmlAttributes', async () => { - const page = await newE2EPage({ url: '/src/components/toast/test/basic?ionic:_testing=true' }); - - await page.click('#show-bottom-toast'); - await page.waitForSelector('#show-bottom-toast'); - - const toast = await page.find('ion-toast'); - - expect(toast).not.toBe(null); - await toast.waitForVisible(); - - const attribute = await page.evaluate(() => document.querySelector('ion-toast').getAttribute('data-testid')); - - expect(attribute).toEqual('basic-toast'); -}); diff --git a/core/src/components/toast/test/basic/index.html b/core/src/components/toast/test/basic/index.html index ccc04084f6..7bff4bdb73 100644 --- a/core/src/components/toast/test/basic/index.html +++ b/core/src/components/toast/test/basic/index.html @@ -67,7 +67,7 @@ Long Message diff --git a/core/src/components/toast/test/basic/toast.e2e.ts b/core/src/components/toast/test/basic/toast.e2e.ts new file mode 100644 index 0000000000..21e23008bd --- /dev/null +++ b/core/src/components/toast/test/basic/toast.e2e.ts @@ -0,0 +1,136 @@ +import { expect } from '@playwright/test'; +import type { Locator, TestInfo } from '@playwright/test'; +import type { E2EPage, EventSpy } from '@utils/test/playwright'; +import { test } from '@utils/test/playwright'; + +class ToastFixture { + readonly page: E2EPage; + readonly testInfo: TestInfo; + + private ionToastDidPresent!: EventSpy; + + constructor(page: E2EPage, testInfo: TestInfo) { + this.page = page; + this.testInfo = testInfo; + } + + async goto() { + const { page } = this; + await page.goto(`/src/components/toast/test/basic`); + this.ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + } + + async openToast(selector: string) { + const { page, ionToastDidPresent } = this; + const button = page.locator(selector); + await button.click(); + + await ionToastDidPresent.next(); + + return { + toast: page.locator('ion-toast'), + container: page.locator('ion-toast .toast-container'), + }; + } + + async screenshot(screenshotModifier: string, el?: Locator) { + const { page } = this; + + const reference = el !== undefined ? el : page; + expect(await reference.screenshot()).toMatchSnapshot( + `toast-${screenshotModifier}-${page.getSnapshotSettings()}.png` + ); + } + + skipRTL(testRef: typeof test, reason = 'This functionality does not have RTL-specific behaviors.') { + const { testInfo } = this; + testRef.skip(testInfo.project.metadata.rtl === true, reason); + } + + skipMode(testRef: typeof test, mode: string, reason: string) { + const { testInfo } = this; + testRef.skip(testInfo.project.metadata.mode === mode, reason); + } +} + +test.describe('toast: rendering', () => { + let toastFixture: ToastFixture; + test.beforeEach(async ({ page }, testInfo) => { + toastFixture = new ToastFixture(page, testInfo); + await toastFixture.goto(); + }); + + test.describe('toast: position', () => { + test.beforeEach(() => { + toastFixture.skipRTL(test); + }); + test('should render toast at the top', async () => { + await toastFixture.openToast('#show-top-toast'); + await toastFixture.screenshot('top'); + }); + test('should render toast at the middle', async () => { + await toastFixture.openToast('#show-middle-toast'); + await toastFixture.screenshot('middle'); + }); + test('should render toast at the bottom', async () => { + await toastFixture.openToast('#show-bottom-toast'); + await toastFixture.screenshot('bottom'); + }); + }); + + test('should set buttons correctly', async () => { + const { container } = await toastFixture.openToast('#custom-action-buttons-toast'); + await toastFixture.screenshot('buttons', container); + }); + + test('should set start/end positioning correctly', async () => { + const { container } = await toastFixture.openToast('#toast-start-and-end'); + await toastFixture.screenshot('start-end', container); + }); + + test('should wrap text correctly', async () => { + toastFixture.skipRTL(test); + const { container } = await toastFixture.openToast('#two-line-toast'); + await toastFixture.screenshot('text', container); + }); + + test('should set color correctly', async () => { + toastFixture.skipRTL(test); + const { container } = await toastFixture.openToast('#color-toast'); + await toastFixture.screenshot('color', container); + }); + + test('should set translucency correctly', async () => { + toastFixture.skipRTL(test); + toastFixture.skipMode(test, 'md', 'Translucency only works on iOS'); + + const { container } = await toastFixture.openToast('#translucent-toast'); + await toastFixture.screenshot('translucent', container); + }); +}); + +test.describe('toast: properties', () => { + let toastFixture: ToastFixture; + test.beforeEach(async ({ page }, testInfo) => { + toastFixture = new ToastFixture(page, testInfo); + + toastFixture.skipMode(test, 'md', 'This functionality has no mode specific logic.'); + toastFixture.skipRTL(test); + + await toastFixture.goto(); + }); + test('should correctly set htmlAttributes', async () => { + const { toast } = await toastFixture.openToast('#show-bottom-toast'); + await expect(toast).toHaveAttribute('data-testid', 'basic-toast'); + }); + + test('should correctly set custom html', async () => { + const { toast } = await toastFixture.openToast('#toast-html'); + await expect(toast.locator('ion-button')).toBeVisible(); + }); + + test('should correctly set custom class', async () => { + const { toast } = await toastFixture.openToast('#custom-class-toast'); + await expect(toast).toHaveClass(/my-custom-class/); + }); +}); diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..179ec60b6e Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..722c0097bd Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..d9625d62b7 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..7ed4cb2cf4 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..4fcf45f21f Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..21815d108c Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-bottom-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..1fab1124ec Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..b1cf24ad38 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..b215906a39 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..f8823fa0ff Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..b7e22c5407 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Safari-linux.png new file mode 100644 index 0000000000..61e724ddf9 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-ios-rtl-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..9258450c81 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..44695df0d7 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..a546dc18bb Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..83ef08c315 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..469e99efaa Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Safari-linux.png new file mode 100644 index 0000000000..33c87ea758 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-buttons-md-rtl-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..1c66111a8b Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..17a7c25c05 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..ce1c441bc1 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..3f2a1682e9 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..7dc5115b8b Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..3d19182bcc Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-color-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..4cb16768c8 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..8d9f5f7176 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..214bc2df7a Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..c68b97d93b Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..a0c87186d9 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..930f7af7aa Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-middle-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..1af860a3fd Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..c0ef4a60dd Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..a1b38bf55f Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..d376a635ec Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..f7e1e6528b Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Safari-linux.png new file mode 100644 index 0000000000..1b827d4d47 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-ios-rtl-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..52eba34f9d Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..5d0117858b Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..ab9c7a7d64 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..b19ac9db44 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..7716c2efe0 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Safari-linux.png new file mode 100644 index 0000000000..a0d89f3fc6 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-start-end-md-rtl-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..5a94cff441 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..659c3e1d6a Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..26a84d02ff Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..8a88f72d07 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..93b72c42bb Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..0feb41d3b1 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-text-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..5e7a1842e9 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..223e625f7c Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..7f56e1c33f Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..aa45c5d57e Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..6e44b17ce0 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..0442777cd8 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-top-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..9c0433fa27 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..68f7f33eb7 Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..aec209878c Binary files /dev/null and b/core/src/components/toast/test/basic/toast.e2e.ts-snapshots/toast-translucent-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/buttons/e2e.ts b/core/src/components/toast/test/buttons/e2e.ts deleted file mode 100644 index 9e401b49dd..0000000000 --- a/core/src/components/toast/test/buttons/e2e.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { testToast } from '../test.utils'; - -const DIRECTORY = 'buttons'; - -test('toast: buttons, close array', async () => { - await testToast(DIRECTORY, '#closeArray'); -}); - -test('toast: buttons, two buttons', async () => { - await testToast(DIRECTORY, '#twoButtons'); -}); - -test('toast: buttons, multiple buttons', async () => { - await testToast(DIRECTORY, '#multipleButtons'); -}); - -test('toast: buttons, long button', async () => { - await testToast(DIRECTORY, '#longButton'); -}); - -/** - * RTL Tests - */ - -test('toast:rtl: buttons, close array', async () => { - await testToast(DIRECTORY, '#closeArray', true); -}); - -test('toast:rtl: buttons, two buttons', async () => { - await testToast(DIRECTORY, '#twoButtons', true); -}); - -test('toast:rtl: buttons, multiple buttons', async () => { - await testToast(DIRECTORY, '#multipleButtons', true); -}); - -test('toast:rtl: buttons, long button', async () => { - await testToast(DIRECTORY, '#longButton', true); -}); diff --git a/core/src/components/toast/test/standalone/e2e.ts b/core/src/components/toast/test/standalone/e2e.ts deleted file mode 100644 index 0dbde14d12..0000000000 --- a/core/src/components/toast/test/standalone/e2e.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { testToast } from '../test.utils'; - -const DIRECTORY = 'standalone'; - -test('toast: standalone', async () => { - await testToast(DIRECTORY, '#basic-toast'); -}); diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts b/core/src/components/toast/test/standalone/toast.e2e.ts new file mode 100644 index 0000000000..b9dfff44b1 --- /dev/null +++ b/core/src/components/toast/test/standalone/toast.e2e.ts @@ -0,0 +1,19 @@ +import { expect } from '@playwright/test'; +import { test } from '@utils/test/playwright'; + +test.describe('toast: standalone', () => { + test.beforeEach(async ({ page }, testInfo) => { + test.skip(testInfo.project.metadata.rtl === true, 'This test does not check LTR vs RTL layouts'); + await page.goto(`/src/components/toast/test/standalone`); + }); + test('should not have visual regressions', async ({ page }) => { + const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + + const basicButton = page.locator('#basic-toast'); + await basicButton.click(); + + await ionToastDidPresent.next(); + + expect(await page.screenshot()).toMatchSnapshot(`toast-standalone-${page.getSnapshotSettings()}.png`); + }); +}); diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..6154f5ee97 Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..a9bc630cfc Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..4c51b7578e Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Chrome-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 0000000000..7c7e32e6bb Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Firefox-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 0000000000..2387b0aec6 Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Safari-linux.png b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 0000000000..059e3775b1 Binary files /dev/null and b/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Safari-linux.png differ