storybook/docs/snippets/react/portable-stories-playwright-ct.ts.mdx
Kyle Gach e09480aefb Split into three separate pages
- Organizational and prose improvements
- Remove Cypress, for now
2024-02-27 11:09:42 -07:00

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 />);
});
```