-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e8e484
commit 55fcd46
Showing
89 changed files
with
151 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,122 @@ | ||
import { test, expect } from '@playwright/test' | ||
import { test, expect, Page } from '@playwright/test' | ||
|
||
type ComponentType = { | ||
name: string | ||
views?: string[] | ||
default?: boolean | ||
} | ||
|
||
const components = [ | ||
{ name: 'Alert' }, | ||
{ name: 'CaPool' }, | ||
{ name: 'CodeEditor' }, | ||
{ name: 'Editor' }, | ||
{ name: 'Headline' }, | ||
{ name: 'Link' }, | ||
{ name: 'StatusPill' }, | ||
{ name: 'StatusTag' }, | ||
{ name: 'Swiper' }, | ||
{ name: 'Tabs' }, | ||
{ name: 'Tag' }, | ||
{ name: 'TileExpand' }, | ||
{ name: 'TileToggle' }, | ||
{ name: 'Tooltip' }, | ||
{ name: 'VersionMark' }, | ||
{ | ||
group: 'Example', | ||
items: [ | ||
{ name: 'Alert' }, | ||
{ name: 'CaPool' }, | ||
{ name: 'CodeEditor' }, | ||
{ name: 'Editor' }, | ||
{ name: 'Headline' }, | ||
{ name: 'Link' }, | ||
{ name: 'StatusPill' }, | ||
{ name: 'StatusTag' }, | ||
{ name: 'Swiper', views: ['feature', 'testimonial'] }, | ||
{ name: 'Tabs' }, | ||
{ name: 'Tag' }, | ||
{ name: 'TileExpand' }, | ||
{ name: 'TileToggle' }, | ||
{ name: 'Tooltip' }, | ||
{ name: 'VersionMark' }, | ||
], | ||
}, | ||
{ | ||
group: 'Assets', | ||
items: [{ name: 'CopyIcon' }, { name: 'Icon' }], | ||
}, | ||
{ | ||
group: 'Form', | ||
items: [ | ||
{ name: 'ActionButton', views: ['variants'] }, | ||
{ name: 'Button' }, | ||
{ name: 'Checkbox' }, | ||
{ name: 'ColorPicker' }, | ||
{ name: 'ConfirmButton' }, | ||
{ name: 'Dropzone' }, | ||
{ name: 'FormGroup' }, | ||
{ name: 'FormInput' }, | ||
{ name: 'FormSelect' }, | ||
{ name: 'Radio' }, | ||
{ name: 'SplitButton' }, | ||
{ name: 'Switch' }, | ||
{ name: 'TimeoutControl' }, | ||
], | ||
}, | ||
{ | ||
group: 'Pages', | ||
items: [{ name: 'InitializedByDifferentUser' }], | ||
}, | ||
{ | ||
group: 'Keycloak', | ||
items: [ | ||
{ name: 'KeycloakTemplate', views: ['default', 'swiper-testimonials', 'swiper-feature', 'sign-in', 'update-password'] }, | ||
{ name: 'Popup', views: ['default', 'right'] }, | ||
{ name: 'SignInForm', views: ['default', 'social', 'registration-step-1', 'registration-step-2', 'reset-password'] }, | ||
{ name: 'Step' }, | ||
], | ||
}, | ||
{ | ||
group: 'Layout', | ||
items: [ | ||
{ name: 'Content', views: ['default', 'headline-status-tag'] }, | ||
{ name: 'ContentMenu' }, | ||
{ name: 'Footer' }, | ||
{ name: 'Header', views: ['default', 'breadcrumb'] }, | ||
{ name: 'Layout' }, | ||
{ name: 'LeftPanel', views: ['default', 'active-item', 'new-feature', 'collapsed'] }, | ||
{ name: 'PageLayout' }, | ||
], | ||
}, | ||
{ | ||
group: 'Loader', | ||
items: [{ name: 'IconLoader' }], | ||
}, | ||
{ | ||
group: 'Modal', | ||
items: [{ name: 'AddClientModal' }, { name: 'DeleteModal' }, { name: 'ProvisionDeviceModal' }, { name: 'ShareDeviceModal' }], | ||
}, | ||
{ | ||
group: 'Notification', | ||
items: [{ name: 'Notification' }, { name: 'NotificationCenter' }, { name: 'NotificationMessage' }], | ||
}, | ||
{ | ||
group: 'Table', | ||
items: [{ name: 'SimpleStripTable' }, { name: 'Table' }, { name: 'TreeTable' }], | ||
}, | ||
] | ||
|
||
components.forEach((component) => { | ||
test(`${component.name}`, async ({ page }) => { | ||
await page.goto(`http://localhost:6006/?path=/story/example-${component.name.toLowerCase()}--default`) | ||
const testMethod = async (page: Page, group: string, name: string, view: string) => { | ||
await page.goto(`http://localhost:6006/?path=/story/${group}-${name.toLowerCase()}--${view}`) | ||
|
||
await page.waitForSelector('#preview-loader', { state: 'detached', timeout: 90000 }) | ||
|
||
await page.click("button[aria-label='Shortcuts']") | ||
await page.click('a#list-item-F') | ||
|
||
// secure interval for animations | ||
await page.waitForTimeout(5000) | ||
await page.locator('#storybook-preview-iframe').focus() | ||
|
||
await page.click("button[aria-label='Shortcuts']") | ||
await page.click('a#list-item-F') | ||
await expect(page).toHaveScreenshot({ fullPage: true, omitBackground: true }) | ||
} | ||
|
||
// secure interval for animations | ||
await page.waitForTimeout(5000) | ||
await page.locator('#storybook-preview-iframe').focus() | ||
components.forEach((group) => { | ||
test.describe(group.group, () => { | ||
group.items.forEach((component) => { | ||
const views = component.views || ['default'] | ||
|
||
await expect(page).toHaveScreenshot({ fullPage: true, omitBackground: true }) | ||
views.forEach((view) => { | ||
test(`${component.name} | ${view}`, async ({ page }) => { | ||
await testMethod(page, group.group, component.name, view) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Binary file removed
BIN
-10.2 KB
tests/components.spec.ts-snapshots/Alert-1-Google-Chrome-darwin.png
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+9.29 KB
tests/components.spec.ts-snapshots/Assets-CopyIcon-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+102 KB
tests/components.spec.ts-snapshots/Assets-Icon-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-10.2 KB
tests/components.spec.ts-snapshots/CaPool-1-Google-Chrome-darwin.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+60.3 KB
tests/components.spec.ts-snapshots/Example-Alert-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21 KB
tests/components.spec.ts-snapshots/Example-CaPool-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.71 KB
...s/components.spec.ts-snapshots/Example-CodeEditor-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.4 KB
tests/components.spec.ts-snapshots/Example-Editor-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.1 KB
tests/components.spec.ts-snapshots/Example-Headline-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.97 KB
tests/components.spec.ts-snapshots/Example-Link-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.8 KB
...s/components.spec.ts-snapshots/Example-StatusPill-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
tests/components.spec.ts-snapshots/Example-StatusTag-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+177 KB
tests/components.spec.ts-snapshots/Example-Swiper-feature-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.2 KB
...s/components.spec.ts-snapshots/Example-Swiper-testimonial-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.3 KB
tests/components.spec.ts-snapshots/Example-Tabs-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.7 KB
tests/components.spec.ts-snapshots/Example-Tag-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.1 KB
...s/components.spec.ts-snapshots/Example-TileExpand-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+15.7 KB
tests/components.spec.ts-snapshots/Example-Tooltip-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.8 KB
.../components.spec.ts-snapshots/Example-VersionMark-default-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.32 KB
...s/components.spec.ts-snapshots/Form-ActionButton-variants-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.5 KB
tests/components.spec.ts-snapshots/Form-Button-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+34.8 KB
tests/components.spec.ts-snapshots/Form-Checkbox-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+16.4 KB
tests/components.spec.ts-snapshots/Form-ColorPicker-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
...s/components.spec.ts-snapshots/Form-ConfirmButton-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+22.5 KB
tests/components.spec.ts-snapshots/Form-Dropzone-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+29.2 KB
tests/components.spec.ts-snapshots/Form-FormGroup-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+31.3 KB
tests/components.spec.ts-snapshots/Form-FormInput-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+28.1 KB
tests/components.spec.ts-snapshots/Form-FormSelect-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
tests/components.spec.ts-snapshots/Form-Radio-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+32.1 KB
tests/components.spec.ts-snapshots/Form-SplitButton-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+13.2 KB
tests/components.spec.ts-snapshots/Form-Switch-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+19.5 KB
.../components.spec.ts-snapshots/Form-TimeoutControl-default-1-chromium-darwin.png
Oops, something went wrong.
Diff not rendered.
Binary file added
BIN
+32.9 KB
...nents.spec.ts-snapshots/Keycloak-KeycloakTemplate-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.2 KB
...nents.spec.ts-snapshots/Keycloak-KeycloakTemplate-sign-in-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.5 KB
...pec.ts-snapshots/Keycloak-KeycloakTemplate-swiper-feature-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.7 KB
...s-snapshots/Keycloak-KeycloakTemplate-swiper-testimonials-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.8 KB
...ec.ts-snapshots/Keycloak-KeycloakTemplate-update-password-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+32.1 KB
tests/components.spec.ts-snapshots/Keycloak-Popup-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+31.8 KB
tests/components.spec.ts-snapshots/Keycloak-Popup-right-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+32.6 KB
.../components.spec.ts-snapshots/Keycloak-SignInForm-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.4 KB
...spec.ts-snapshots/Keycloak-SignInForm-registration-step-1-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.3 KB
...spec.ts-snapshots/Keycloak-SignInForm-registration-step-2-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+33.3 KB
...ents.spec.ts-snapshots/Keycloak-SignInForm-reset-password-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+32.5 KB
...s/components.spec.ts-snapshots/Keycloak-SignInForm-social-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+31.9 KB
tests/components.spec.ts-snapshots/Keycloak-Step-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+18.3 KB
tests/components.spec.ts-snapshots/Layout-Content-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+19.3 KB
...ents.spec.ts-snapshots/Layout-Content-headline-status-tag-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+18.6 KB
...s/components.spec.ts-snapshots/Layout-ContentMenu-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
tests/components.spec.ts-snapshots/Layout-Footer-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+19.3 KB
tests/components.spec.ts-snapshots/Layout-Header-breadcrumb-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+16.4 KB
tests/components.spec.ts-snapshots/Layout-Header-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+40.6 KB
tests/components.spec.ts-snapshots/Layout-Layout-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+70.1 KB
...components.spec.ts-snapshots/Layout-LeftPanel-active-item-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+70 KB
...s/components.spec.ts-snapshots/Layout-LeftPanel-collapsed-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+36.5 KB
tests/components.spec.ts-snapshots/Layout-LeftPanel-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+48.6 KB
...components.spec.ts-snapshots/Layout-LeftPanel-new-feature-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+45.9 KB
tests/components.spec.ts-snapshots/Layout-PageLayout-default-1-chromium-darwin.png
Oops, something went wrong.
Diff not rendered.
Binary file added
BIN
+10.1 KB
tests/components.spec.ts-snapshots/Loader-IconLoader-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+25.8 KB
...components.spec.ts-snapshots/Modal-AddClientModal-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+44.6 KB
tests/components.spec.ts-snapshots/Modal-DeleteModal-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+24.5 KB
...ents.spec.ts-snapshots/Modal-ProvisionDeviceModal-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+50.8 KB
...mponents.spec.ts-snapshots/Modal-ShareDeviceModal-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
...nents.spec.ts-snapshots/Notification-Notification-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+11.1 KB
...spec.ts-snapshots/Notification-NotificationCenter-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+12.4 KB
...pec.ts-snapshots/Notification-NotificationMessage-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+64.7 KB
...pec.ts-snapshots/Pages-InitializedByDifferentUser-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file removed
BIN
-10.2 KB
tests/components.spec.ts-snapshots/StatusPill-1-chromium-darwin.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file added
BIN
+30.2 KB
...mponents.spec.ts-snapshots/Table-SimpleStripTable-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+115 KB
tests/components.spec.ts-snapshots/Table-Table-default-1-chromium-darwin.png
Oops, something went wrong.
Binary file added
BIN
+25.3 KB
tests/components.spec.ts-snapshots/Table-TreeTable-default-1-chromium-darwin.png
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Binary file removed
BIN
-44.1 KB
tests/components.spec.ts-snapshots/TileExpand-1-chromium-darwin.png
Diff not rendered.
Diff not rendered.
Binary file removed
BIN
-10.2 KB
tests/components.spec.ts-snapshots/VersionMark-1-chromium-darwin.png
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters