Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(stepper): add darkmode screenshot test and refactor folder structure #925

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 });
});
Loading