Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Rename package to @storybook/playwright-ct
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Aug 18, 2023
1 parent 5f0bd8d commit b0fe01c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CT Storybook allows you to write a Playwright test against that story using all

```ts
// Button.spec.ts
import { test, expect } from 'playwright-ct-storybook';
import { test, expect } from '@storybook/playwright-ct';
import * as ButtonStories from './Button.stories';

test('interacts', async ({ mount }) => {
Expand Down Expand Up @@ -144,14 +144,14 @@ npm init playwright@latest
Then install this package:

```sh
npm install playwright-ct-storybook
npm install @storybook/playwright-ct
```

Then update your Playwright config to use `playwright-ct-storybook`'s `defineConfig`:
Then update your Playwright config to use `@storybook/playwright-ct`'s `defineConfig`:

```diff
- import { defineConfig, devices } from '@playwright/test';
+ import { defineConfig, devices } from 'playwright-ct-storybook';
+ import { defineConfig, devices } from '@storybook/playwright-ct';
```

This is a thin wrapper around Playwright's `defineConfig` that tells Playwright to run against your Storybook dev server.
Expand All @@ -167,7 +167,7 @@ This will run the example E2E tests that Playwright installs in your project.
Then, you can write your first test based on your existing stories. This test uses `Button.stories` that is included as an example file in the Storybook installation, but it can be any Story file.

```js
import { test, expect } from 'playwright-ct-storybook';
import { test, expect } from '@storybook/playwright-ct';
import * as ButtonStories from './Button.stories';

test('renders', async ({ mount }) => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "playwright-ct-storybook",
"name": "@storybook/playwright-ct",
"version": "0.0.0",
"description": "Playwright CT powered by Storybook (Experimental)",
"repository": {
"type": "git",
"url": "https://github.com/shilman/playwright-ct-storybook"
"url": "https://github.com/storybookjs/playwright-ct"
},
"author": "Michael Shilman <michael@lab80.co>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const defineConfig = (config: PlaywrightTestConfig) =>
// @ts-expect-error WTH
babelPlugins: [...(config.build?.babelPlugins || []), [join(__dirname, 'ct-test-plugin.js')]],
// @ts-expect-error WTH
external: [/playwright-ct-storybook\/.*.js$/],
external: [/playwright-ct\/.*.js$/],
...config.build,
},
webServer: {
Expand Down

0 comments on commit b0fe01c

Please sign in to comment.