diff --git a/core/src/components/toast/test/is-open/toast.e2e.ts b/core/src/components/toast/test/is-open/toast.e2e.ts index fc74b12133c..2cb6daa4bf5 100644 --- a/core/src/components/toast/test/is-open/toast.e2e.ts +++ b/core/src/components/toast/test/is-open/toast.e2e.ts @@ -6,29 +6,20 @@ import { configs, test } from '@utils/test/playwright'; */ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { test.describe(title('toast: isOpen'), () => { - test.beforeEach(async ({ page }) => { + test('should open and close the toast', async ({ page }) => { await page.goto('/src/components/toast/test/is-open', config); - }); - test('should open the toast', async ({ page }) => { const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss'); + const toast = page.locator('ion-toast'); await page.click('#default'); await ionToastDidPresent.next(); await expect(toast).toBeVisible(); - }); - test('should open the toast then close after a timeout', async ({ page }) => { - const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); - const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss'); - const toast = page.locator('ion-toast'); - - await page.click('#timeout'); - - await ionToastDidPresent.next(); - await expect(toast).toBeVisible(); + await toast.evaluate((el: HTMLIonToastElement) => (el.isOpen = false)); await ionToastDidDismiss.next(); await expect(toast).toBeHidden(); diff --git a/core/src/components/toast/test/standalone/toast.e2e.ts b/core/src/components/toast/test/standalone/toast.e2e.ts index 0f4bdc07645..cf6d67fbd51 100644 --- a/core/src/components/toast/test/standalone/toast.e2e.ts +++ b/core/src/components/toast/test/standalone/toast.e2e.ts @@ -2,22 +2,21 @@ import { expect } from '@playwright/test'; import { configs, test } from '@utils/test/playwright'; /** - * This test does not check LTR vs RTL layouts + * This behavior does not vary across modes/directions. */ -configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { test.describe(title('toast: standalone'), () => { - test.beforeEach(async ({ page }) => { + test('should open overlay without ion-app', async ({ page }) => { await page.goto(`/src/components/toast/test/standalone`, config); - }); - test('should not have visual regressions', async ({ page }) => { + const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent'); + const toast = page.locator('ion-toast'); const basicButton = page.locator('#basic-toast'); await basicButton.click(); await ionToastDidPresent.next(); - - await expect(page).toHaveScreenshot(screenshot(`toast-standalone`)); + await expect(toast).toBeVisible(); }); }); }); 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 deleted file mode 100644 index 119a9c72b18..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Chrome-linux.png and /dev/null 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 deleted file mode 100644 index a9bc630cfc4..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Firefox-linux.png and /dev/null 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 deleted file mode 100644 index 05432046310..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-ios-ltr-Mobile-Safari-linux.png and /dev/null 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 deleted file mode 100644 index 91b7aaa1e5a..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Chrome-linux.png and /dev/null 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 deleted file mode 100644 index 2387b0aec6d..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Firefox-linux.png and /dev/null 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 deleted file mode 100644 index 04bc205bd82..00000000000 Binary files a/core/src/components/toast/test/standalone/toast.e2e.ts-snapshots/toast-standalone-md-ltr-Mobile-Safari-linux.png and /dev/null differ