mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
16 lines
470 B
Plaintext
16 lines
470 B
Plaintext
```tsx
|
|
// Button.playwright.test.tsx
|
|
import { createTest } from '@storybook/react/experimental-playwright';
|
|
import { test as base } from '@playwright/experimental-ct-react';
|
|
|
|
import stories from './Button.portable';
|
|
|
|
const test = createTest(base);
|
|
|
|
test('renders primary button', async ({ mount }) => {
|
|
// The mount function will execute all the necessary steps in the story,
|
|
// such as loaders, render, and play function
|
|
await mount(<stories.Primary />);
|
|
});
|
|
```
|