diff --git a/packages/core/src/components/radio-button/test/default/darkmode/index.html b/packages/core/src/components/radio-button/test/default/darkmode/index.html new file mode 100644 index 000000000..3dea2d08f --- /dev/null +++ b/packages/core/src/components/radio-button/test/default/darkmode/index.html @@ -0,0 +1,29 @@ + + + + + Textarea - Basic + + + + + + + +
Label text 1
+
+ + +
Label text 2
+
+ + diff --git a/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts b/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts new file mode 100644 index 000000000..b28f0cb43 --- /dev/null +++ b/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts @@ -0,0 +1,20 @@ +import { expect } from '@playwright/test'; +import { test } from 'stencil-playwright'; + +const componentTestPath = 'src/components/radio-button/test/default/darkmode/index.html'; + +test.describe.parallel('TdsRadioButton component tests default darkmode', () => { + test.beforeEach(async ({ page }) => { + await page.goto(componentTestPath); + }); + + test('Radio buttons with Label text = "Label text 1" and "Label text 2" render on the page', async ({ + page, + }) => { + const radioButton1 = page.locator('tds-radio-button', { hasText: 'Label text 1' }); + const radioButton2 = page.locator('tds-radio-button', { hasText: 'Label text 2' }); + await expect(radioButton1).toBeVisible(); + await expect(radioButton2).toBeVisible(); + await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0 }); + }); +}); diff --git a/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-default-darkmod-5ba5b-text-1-and-Label-text-2-render-on-the-page-1-linux.png b/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-default-darkmod-5ba5b-text-1-and-Label-text-2-render-on-the-page-1-linux.png new file mode 100644 index 000000000..2a5213899 Binary files /dev/null and b/packages/core/src/components/radio-button/test/default/darkmode/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-default-darkmod-5ba5b-text-1-and-Label-text-2-render-on-the-page-1-linux.png differ diff --git a/packages/core/src/components/radio-button/test/default/index.html b/packages/core/src/components/radio-button/test/default/index.html deleted file mode 100644 index 5a01bcac6..000000000 --- a/packages/core/src/components/radio-button/test/default/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Textarea - Basic - - - - - - - -
Label text 1
-
- - -
Label text 2
-
- - - \ No newline at end of file diff --git a/packages/core/src/components/radio-button/test/default/lightmode/index.html b/packages/core/src/components/radio-button/test/default/lightmode/index.html new file mode 100644 index 000000000..c09425847 --- /dev/null +++ b/packages/core/src/components/radio-button/test/default/lightmode/index.html @@ -0,0 +1,29 @@ + + + + + Textarea - Basic + + + + + + + +
Label text 1
+
+ + +
Label text 2
+
+ + diff --git a/packages/core/src/components/radio-button/test/default/radio-button.e2e.ts b/packages/core/src/components/radio-button/test/default/lightmode/radio-button.e2e.ts similarity index 91% rename from packages/core/src/components/radio-button/test/default/radio-button.e2e.ts rename to packages/core/src/components/radio-button/test/default/lightmode/radio-button.e2e.ts index be820600a..eea365c07 100644 --- a/packages/core/src/components/radio-button/test/default/radio-button.e2e.ts +++ b/packages/core/src/components/radio-button/test/default/lightmode/radio-button.e2e.ts @@ -1,11 +1,13 @@ import { expect } from '@playwright/test'; import { test } from 'stencil-playwright'; -test.describe.parallel('TdsRadioButton component tests', () => { +const componentTestPath = 'src/components/radio-button/test/default/lightmode/index.html'; + +test.describe.parallel('TdsRadioButton component tests default lightmode', () => { test.beforeEach(async ({ page }) => { // Navigate to the index.html page where your component is rendered // Adjust the path to the index.html as necessary based on your project structure - await page.goto('src/components/radio-button/test/default/index.html'); + await page.goto(componentTestPath); }); test('Radio buttons with Label text = "Label text 1" and "Label text 2" render on the page', async ({ diff --git a/packages/core/src/components/radio-button/test/default/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-Radio-buttons-w-dd5e3-text-1-and-Label-text-2-render-on-the-page-1-linux.png b/packages/core/src/components/radio-button/test/default/lightmode/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-default-lightmo-8ea18-text-1-and-Label-text-2-render-on-the-page-1-linux.png similarity index 100% rename from packages/core/src/components/radio-button/test/default/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-Radio-buttons-w-dd5e3-text-1-and-Label-text-2-render-on-the-page-1-linux.png rename to packages/core/src/components/radio-button/test/default/lightmode/radio-button.e2e.ts-snapshots/TdsRadioButton-component-tests-default-lightmo-8ea18-text-1-and-Label-text-2-render-on-the-page-1-linux.png diff --git a/packages/core/src/components/radio-button/test/disabled/radio-button.e2e.ts b/packages/core/src/components/radio-button/test/disabled/radio-button.e2e.ts index f01f9e902..8a2f57ec1 100644 --- a/packages/core/src/components/radio-button/test/disabled/radio-button.e2e.ts +++ b/packages/core/src/components/radio-button/test/disabled/radio-button.e2e.ts @@ -1,9 +1,11 @@ import { expect } from '@playwright/test'; import { test } from 'stencil-playwright'; +const componentTestPath = 'src/components/radio-button/test/disabled/index.html'; + test.describe.parallel('Radio button - disabled state', () => { test.beforeEach(async ({ page }) => { - await page.goto('src/components/radio-button/test/disabled/index.html'); + await page.goto(componentTestPath); }); test('Radio buttons with Label text = "Label text 1" and "Label text 2" renders on the page', async ({