mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-22 05:02:18 +08:00
18 lines
562 B
TypeScript
18 lines
562 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
import process from 'process';
|
|
|
|
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
|
|
|
|
test('Basic story test', async ({ page }) => {
|
|
await page.goto(storybookUrl);
|
|
|
|
const preview = page.frameLocator('#storybook-preview-iframe');
|
|
const root = preview.locator('#root:visible, #docs-root:visible');
|
|
|
|
// General check for any selected entry
|
|
await expect(root).not.toBeEmpty();
|
|
|
|
// Specific check for introduction story
|
|
await expect(root).toContainText('Welcome to Storybook');
|
|
});
|