Skip to content

Commit

Permalink
test(stepper): add darkmode screenshot test and refactor folder struc…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
max-umain committed Dec 17, 2024
1 parent 34583ce commit e3453de
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Stepper - Large horizontal text below</title>
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body class="tds-mode-dark" style="background-color: var(--tds-grey-958)">
<tds-stepper
data-testid="tds-stepper-testid"
size="lg"
label-position="below"
orientation="horizontal"
>
<tds-step state="success" index="1">
<div slot="label">Success step</div>
</tds-step>
<tds-step state="error" index="2">
<div slot="label">Error step</div>
</tds-step>
<tds-step state="current" index="3">
<div slot="label">Current step</div>
</tds-step>
<tds-step index="4">
<div slot="label">Upcoming step</div>
</tds-step>
</tds-stepper>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/stepper/test/large-horizontal-text-below/index.html';
const componentTestPath =
'src/components/stepper/test/large-horizontal-text-below/darkmode/index.html';

//Test if component renders and take a screenshot of the component
test('Stepper - Large horizontal with text below', async ({ page }) => {
test('Stepper - Large horizontal with text below - darkmode', async ({ page }) => {
await page.goto(componentTestPath);
const stepper = page.locator('[data-testid="tds-stepper-testid"]');
await stepper.waitFor({ state: 'visible' });
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Stepper - Large horizontal text below</title>
<link rel="stylesheet" href="../../../../../dist/tegel/tegel.css" />
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../loader/index.es2017.js';
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body>
<tds-stepper
data-testid="tds-stepper-testid"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath =
'src/components/stepper/test/large-horizontal-text-below/lightmode/index.html';

//Test if component renders and take a screenshot of the component
test('Stepper - Large horizontal with text below - lightmode', async ({ page }) => {
await page.goto(componentTestPath);
const stepper = page.locator('[data-testid="tds-stepper-testid"]');
await stepper.waitFor({ state: 'visible' });
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
});

0 comments on commit e3453de

Please sign in to comment.