nxtgauge-admin-solid/tests/e2e/storybook-admin-pages.spec.ts

20 lines
880 B
TypeScript

import { expect, test } from '@playwright/test';
const STORYBOOK_BASE_URL = process.env.STORYBOOK_BASE_URL || 'http://127.0.0.1:6006';
const STORIES = [
{ id: 'admin-pages--dashboard', text: 'Total Users' },
{ id: 'admin-pages--department-management', text: 'Department Management' },
{ id: 'admin-pages--internal-dashboard-management', text: 'Internal Dashboard Management' },
{ id: 'admin-pages--external-dashboard-management', text: 'External Dashboard Management' },
];
test.describe('Storybook admin stories smoke', () => {
for (const story of STORIES) {
test(`renders ${story.id}`, async ({ page }) => {
const url = `${STORYBOOK_BASE_URL}/iframe.html?id=${story.id}&viewMode=story`;
await page.goto(url, { waitUntil: 'domcontentloaded' });
await expect(page.getByText(story.text).first()).toBeVisible({ timeout: 20_000 });
});
}
});