Skip to content

Commit 7e798e1

Browse files
committed
chore: roll Playwright to latest
1 parent 18b2e8d commit 7e798e1

8 files changed

Lines changed: 72 additions & 52 deletions

File tree

.claude/skills/dev/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: dev
3+
description: Development workflows for the playwright-cli repository. Use when the user asks about rolling dependencies, releasing, or other repo maintenance tasks.
4+
---
5+
6+
# Development skills
7+
8+
* **Rolling Playwright dependency** [roll.md](roll.md)

.claude/skills/dev/roll.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# How to roll Playwright dependency
2+
3+
## Steps
4+
5+
1. **Update Playwright packages** in `package.json`:
6+
- Update `playwright` (dependency) and `@playwright/test` (devDependency) to the target version.
7+
- Run `npm install` to update `package-lock.json`.
8+
9+
2. **Run the update script** to sync skills and README:
10+
```bash
11+
node scripts/update.js
12+
```
13+
This script:
14+
- Runs `node playwright-cli.js install --skills` to regenerate skills from the new Playwright version.
15+
- Copies the generated skills from `.claude/skills/playwright-cli/` into `skills/playwright-cli/`.
16+
- Cleans up the generated `.claude/skills/` directory.
17+
18+
3. **Update README.md** with relevant changes from the updated skill at `skills/playwright-cli/SKILL.md`. Compare the skill file with the README and update any sections that are out of date (commands, flags, default behaviors, examples).
19+
20+
4. **Verify** the CLI works:
21+
```bash
22+
node playwright-cli.js --help
23+
```
24+
25+
5. **Test** the CLI:
26+
```bash
27+
npm run test
28+
```
29+
30+
5. **Create a branch and commit**:
31+
- Branch name: `roll_<version>` (e.g. `roll_214`)
32+
- Commit message: `chore: roll Playwright to <version>`
33+
34+
## Key files
35+
36+
| File | Role |
37+
|---|---|
38+
| `package.json` | Playwright version pins (`playwright`, `@playwright/test`) |
39+
| `playwright-cli.js` | CLI entry point — requires Playwright's program module |
40+
| `scripts/update.js` | Automation script for syncing skills and README after version bump |
41+
| `skills/playwright-cli/SKILL.md` | Skill definition installed from Playwright (source of truth for commands) |
42+
| `README.md` | User-facing docs — must reflect current skill commands and behavior |

.claude/skills/roll/SKILL.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ playwright-cli --help
3131

3232
Claude Code, GitHub Copilot and others will use the locally installed skills.
3333

34-
Run this command in your project's root directory:
35-
3634
```bash
3735
playwright-cli install --skills
3836
```
@@ -76,16 +74,16 @@ playwright-cli open https://playwright.dev --headed
7674

7775
## Sessions
7876

79-
Playwright CLI will use a dedicated persistent profile by default. It means that
80-
your cookies and other storage state will be preserved between the calls. You can use different
81-
instances of the browser for different projects with sessions.
77+
Playwright CLI keeps the browser profile in memory by default. Your cookies and storage state
78+
are preserved between CLI calls within the session, but lost when the browser closes. Use
79+
`--persistent` to save the profile to disk for persistence across browser restarts.
8280

83-
Following will result in two browsers with separate profiles being available. Pass `-s=` to
81+
You can use different instances of the browser for different projects with sessions. Pass `-s=` to
8482
the invocation to talk to a specific browser.
8583

8684
```bash
8785
playwright-cli open https://playwright.dev
88-
playwright-cli -s=example open https://example.com
86+
playwright-cli -s=example open https://example.com --persistent
8987
playwright-cli list
9088
```
9189

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"test": "playwright test"
1919
},
2020
"devDependencies": {
21-
"@playwright/test": "1.59.0-alpha-1770426101000",
21+
"@playwright/test": "1.59.0-alpha-2026-02-14",
2222
"@types/node": "^25.2.1"
2323
},
2424
"dependencies": {
2525
"minimist": "^1.2.5",
26-
"playwright": "1.59.0-alpha-1770426101000"
26+
"playwright": "1.59.0-alpha-2026-02-14"
2727
},
2828
"bin": {
2929
"playwright-cli": "playwright-cli.js"

playwright-cli.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
const { program } = require('playwright/lib/mcp/terminal/program');
19-
const packageLocation = require.resolve('./package.json');
20-
program(packageLocation).catch(e => {
21-
console.error(e.message);
22-
process.exit(1);
23-
});
18+
require('playwright/lib/cli/client/program');

scripts/update.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ function run(command, options = {}) {
1111
}
1212

1313
async function main() {
14-
// 1. Install latest @playwright/cli as dev dependency
15-
console.log('\n=== Installing @playwright/cli ===\n');
16-
run('npm install --save-dev @playwright/cli@latest');
17-
const { version } = require(path.join(rootDir, 'node_modules', '@playwright', 'cli', 'package.json'));
18-
console.log(`Installed @playwright/cli version: ${version}`);
19-
2014
// 2. Run playwright-cli install-skills
2115
console.log('\n=== Running playwright-cli install --skills ===\n');
22-
run('npx playwright-cli install --skills');
16+
run('node playwright-cli.js install --skills');
2317

2418
// 3. Move generated skills into the existing skills folder
2519
console.log('\n=== Updating skills folder ===\n');
@@ -39,19 +33,6 @@ async function main() {
3933
} catch {
4034
console.warn('Warning: Generated skills directory not found at', generatedSkillsDir);
4135
}
42-
43-
// 4. Copy README from @playwright/cli to root folder
44-
console.log('\n=== Copying README ===\n');
45-
const packageReadme = path.join(rootDir, 'node_modules', '@playwright', 'cli', 'README.md');
46-
const rootReadme = path.join(rootDir, 'README.md');
47-
48-
try {
49-
await fs.copyFile(packageReadme, rootReadme);
50-
console.log(`Copied README from ${packageReadme} to ${rootReadme}`);
51-
} catch {
52-
console.warn('Warning: README not found at', packageReadme);
53-
}
54-
5536
console.log('\n=== Update complete! ===\n');
5637
}
5738

0 commit comments

Comments
 (0)