diff --git a/packages/core/src/components/message/test/basic/message.e2e.ts b/packages/core/src/components/message/test/basic/message.e2e.ts index fc6227053..985ca076b 100644 --- a/packages/core/src/components/message/test/basic/message.e2e.ts +++ b/packages/core/src/components/message/test/basic/message.e2e.ts @@ -1,18 +1,34 @@ import { test } from 'stencil-playwright'; import { expect } from '@playwright/test'; +import { + testConfigurations, + getTestDescribeText, + setupPage, +} from '../../../../utils/testConfiguration'; const componentTestPath = 'src/components/message/test/basic/index.html'; +const componentName = 'tds-message'; +const testDescription = 'tds-message-basic'; -test.describe.parallel('tds-message-basic', () => { - test('is basic message rendered correctly', async ({ page }) => { - await page.goto(componentTestPath); +testConfigurations.withModeVariants.forEach((config) => { + test.describe.parallel(getTestDescribeText(config, testDescription), () => { + test.beforeEach(async ({ page }) => { + await setupPage(page, config, componentTestPath, componentName); + }); - /* Check diff on screenshot */ - await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + test('is basic message rendered correctly', async ({ page }) => { + /* Check diff on screenshot */ + await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + }); }); +}); - test('has icon', async ({ page }) => { +test.describe.parallel(componentName, () => { + test.beforeEach(async ({ page }) => { await page.goto(componentTestPath); + }); + + test('has icon', async ({ page }) => { const messageIcon = page.getByRole('img'); await expect(messageIcon).toHaveCount(1); await expect(messageIcon).toBeVisible(); diff --git a/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-darkmode-is-basic-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-darkmode-is-basic-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..e62e22a26 Binary files /dev/null and b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-darkmode-is-basic-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-lightmode-is-basic-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-lightmode-is-basic-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..74efee726 Binary files /dev/null and b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-primary-lightmode-is-basic-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-darkmode-is-basic-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-darkmode-is-basic-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..cf5230d1e Binary files /dev/null and b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-darkmode-is-basic-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-is-basic-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-lightmode-is-basic-message-rendered-correctly-1-linux.png similarity index 59% rename from packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-is-basic-message-rendered-correctly-1-linux.png rename to packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-lightmode-is-basic-message-rendered-correctly-1-linux.png index bb1f93a0d..b8b83d4f2 100644 Binary files a/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-is-basic-message-rendered-correctly-1-linux.png and b/packages/core/src/components/message/test/basic/message.e2e.ts-snapshots/tds-message-basic-secondary-lightmode-is-basic-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/error/message.e2e.ts b/packages/core/src/components/message/test/error/message.e2e.ts index f9c26baa8..d379c2b5e 100644 --- a/packages/core/src/components/message/test/error/message.e2e.ts +++ b/packages/core/src/components/message/test/error/message.e2e.ts @@ -1,32 +1,46 @@ import { test } from 'stencil-playwright'; import { expect } from '@playwright/test'; +import { + testConfigurations, + getTestDescribeText, + setupPage, +} from '../../../../utils/testConfiguration'; const componentTestPath = 'src/components/message/test/error/index.html'; +const componentName = 'tds-message'; +const testDescription = 'tds-message-error'; -test.describe.parallel('tds-message-error', () => { - test('is error message rendered correctly', async ({ page }) => { - await page.goto(componentTestPath); +testConfigurations.withModeVariants.forEach((config) => { + test.describe.parallel(getTestDescribeText(config, testDescription), () => { + test.beforeEach(async ({ page }) => { + await setupPage(page, config, componentTestPath, componentName); + }); - /* Check diff on screenshot */ - await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + test('is error message rendered correctly', async ({ page }) => { + /* Check diff on screenshot */ + await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + }); }); +}); - test('has header text', async ({ page }) => { +test.describe.parallel(componentName, () => { + test.beforeEach(async ({ page }) => { await page.goto(componentTestPath); + }); + + test('has header text', async ({ page }) => { const messageComponentHeader = page.getByText('Message header', { exact: true }); await expect(messageComponentHeader).toHaveCount(1); await expect(messageComponentHeader).toBeVisible(); }); test('has subheader text', async ({ page }) => { - await page.goto(componentTestPath); const messageComponentSubHeader = page.getByText('Longer Message text can be placed here.'); await expect(messageComponentSubHeader).toHaveCount(1); await expect(messageComponentSubHeader).toBeVisible(); }); test('has error icon', async ({ page }) => { - await page.goto(componentTestPath); const messageIcon = page.getByRole('img'); await expect(messageIcon).toHaveCount(1); await expect(messageIcon).toBeVisible(); diff --git a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-is-error-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-is-error-message-rendered-correctly-1-linux.png deleted file mode 100644 index f11fe7f54..000000000 Binary files a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-is-error-message-rendered-correctly-1-linux.png and /dev/null differ diff --git a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-darkmode-is-error-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-darkmode-is-error-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..1f589c9f3 Binary files /dev/null and b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-darkmode-is-error-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-lightmode-is-error-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-lightmode-is-error-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..be50c5c6b Binary files /dev/null and b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-primary-lightmode-is-error-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-darkmode-is-error-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-darkmode-is-error-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..8f7a6aea2 Binary files /dev/null and b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-darkmode-is-error-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-lightmode-is-error-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-lightmode-is-error-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..e0074cc20 Binary files /dev/null and b/packages/core/src/components/message/test/error/message.e2e.ts-snapshots/tds-message-error-secondary-lightmode-is-error-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/information/message.e2e.ts b/packages/core/src/components/message/test/information/message.e2e.ts index 9dd2326d7..1a6266657 100644 --- a/packages/core/src/components/message/test/information/message.e2e.ts +++ b/packages/core/src/components/message/test/information/message.e2e.ts @@ -1,13 +1,24 @@ import { test } from 'stencil-playwright'; import { expect } from '@playwright/test'; +import { + testConfigurations, + getTestDescribeText, + setupPage, +} from '../../../../utils/testConfiguration'; const componentTestPath = 'src/components/message/test/information/index.html'; +const componentName = 'tds-message'; +const testDescription = 'tds-message-information'; -test.describe('tds-message-information', () => { - test('is information message rendered correctly', async ({ page }) => { - await page.goto(componentTestPath); +testConfigurations.withModeVariants.forEach((config) => { + test.describe.parallel(getTestDescribeText(config, testDescription), () => { + test.beforeEach(async ({ page }) => { + await setupPage(page, config, componentTestPath, componentName); + }); - /* Take screenshot */ - await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + test('is information message rendered correctly', async ({ page }) => { + /* Take screenshot */ + await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + }); }); }); diff --git a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-is-information-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-is-information-message-rendered-correctly-1-linux.png deleted file mode 100644 index bb0e82bad..000000000 Binary files a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-is-information-message-rendered-correctly-1-linux.png and /dev/null differ diff --git a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-darkmode-is-information-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-darkmode-is-information-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..fb3d79298 Binary files /dev/null and b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-darkmode-is-information-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-lightmode-is-information-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-lightmode-is-information-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..f2316b21b Binary files /dev/null and b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-primary-lightmode-is-information-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-darkmode-is-information-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-darkmode-is-information-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..28de60c88 Binary files /dev/null and b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-darkmode-is-information-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-lightmode-is-information-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-lightmode-is-information-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..2047708f8 Binary files /dev/null and b/packages/core/src/components/message/test/information/message.e2e.ts-snapshots/tds-message-information-secondary-lightmode-is-information-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/success/message.e2e.ts b/packages/core/src/components/message/test/success/message.e2e.ts index 6ff774248..8694b1630 100644 --- a/packages/core/src/components/message/test/success/message.e2e.ts +++ b/packages/core/src/components/message/test/success/message.e2e.ts @@ -1,13 +1,24 @@ import { test } from 'stencil-playwright'; import { expect } from '@playwright/test'; +import { + testConfigurations, + getTestDescribeText, + setupPage, +} from '../../../../utils/testConfiguration'; const componentTestPath = 'src/components/message/test/success/index.html'; +const componentName = 'tds-message'; +const testDescription = 'tds-message-success'; -test.describe('tds-message-success', () => { - test('is success message rendered correctly', async ({ page }) => { - await page.goto(componentTestPath); +testConfigurations.withModeVariants.forEach((config) => { + test.describe.parallel(getTestDescribeText(config, testDescription), () => { + test.beforeEach(async ({ page }) => { + await setupPage(page, config, componentTestPath, componentName); + }); - /* Take screenshot */ - await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + test('is success message rendered correctly', async ({ page }) => { + /* Take screenshot */ + await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + }); }); }); diff --git a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-is-success-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-is-success-message-rendered-correctly-1-linux.png deleted file mode 100644 index 7e5132629..000000000 Binary files a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-is-success-message-rendered-correctly-1-linux.png and /dev/null differ diff --git a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-darkmode-is-success-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-darkmode-is-success-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..10c0d6ef6 Binary files /dev/null and b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-darkmode-is-success-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-lightmode-is-success-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-lightmode-is-success-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..6408fb9e1 Binary files /dev/null and b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-primary-lightmode-is-success-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-darkmode-is-success-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-darkmode-is-success-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..a164c5638 Binary files /dev/null and b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-darkmode-is-success-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-lightmode-is-success-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-lightmode-is-success-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..f37ef66f2 Binary files /dev/null and b/packages/core/src/components/message/test/success/message.e2e.ts-snapshots/tds-message-success-secondary-lightmode-is-success-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts b/packages/core/src/components/message/test/warning/message.e2e.ts index 1df862a76..314d1dbeb 100644 --- a/packages/core/src/components/message/test/warning/message.e2e.ts +++ b/packages/core/src/components/message/test/warning/message.e2e.ts @@ -1,13 +1,24 @@ import { test } from 'stencil-playwright'; import { expect } from '@playwright/test'; +import { + testConfigurations, + getTestDescribeText, + setupPage, +} from '../../../../utils/testConfiguration'; const componentTestPath = 'src/components/message/test/warning/index.html'; +const componentName = 'tds-message'; +const testDescription = 'tds-message-warning'; -test.describe('tds-message-warning', () => { - test('is warning message rendered correctly', async ({ page }) => { - await page.goto(componentTestPath); +testConfigurations.withModeVariants.forEach((config) => { + test.describe.parallel(getTestDescribeText(config, testDescription), () => { + test.beforeEach(async ({ page }) => { + await setupPage(page, config, componentTestPath, componentName); + }); - /* Take screenshot */ - await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + test('is warning message rendered correctly', async ({ page }) => { + /* Take screenshot */ + await expect(page).toHaveScreenshot({ maxDiffPixels: 0 }); + }); }); }); diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-is-warning-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-is-warning-message-rendered-correctly-1-linux.png deleted file mode 100644 index de3038921..000000000 Binary files a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-is-warning-message-rendered-correctly-1-linux.png and /dev/null differ diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-darkmode-is-warning-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-darkmode-is-warning-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..8b5b825dd Binary files /dev/null and b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-darkmode-is-warning-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-lightmode-is-warning-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-lightmode-is-warning-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..beede9b50 Binary files /dev/null and b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-primary-lightmode-is-warning-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-darkmode-is-warning-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-darkmode-is-warning-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..f2cb4c187 Binary files /dev/null and b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-darkmode-is-warning-message-rendered-correctly-1-linux.png differ diff --git a/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-lightmode-is-warning-message-rendered-correctly-1-linux.png b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-lightmode-is-warning-message-rendered-correctly-1-linux.png new file mode 100644 index 000000000..33cb01925 Binary files /dev/null and b/packages/core/src/components/message/test/warning/message.e2e.ts-snapshots/tds-message-warning-secondary-lightmode-is-warning-message-rendered-correctly-1-linux.png differ