pw-repl 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +0 -2
- package/README.md +2 -1
- package/lib/help.js +3 -1
- package/package.json +1 -1
- package/skill/SKILL.md +16 -0
package/AGENTS.md
CHANGED
|
@@ -49,8 +49,6 @@ If you hit a limitation or write a workaround, consider adding the capability to
|
|
|
49
49
|
- Don't race the clock in a test: a page that changes on a timer, or a command timed against a budget,
|
|
50
50
|
fails on a busy machine. Have the page change when the test asks (eval), or measure the thing itself
|
|
51
51
|
(frames drawn, not clicks timed). A click waits for its element to hold still for two frames.
|
|
52
|
-
- A test that times out in a run much slower than usual (the machine is busy) may be load, not a bug:
|
|
53
|
-
run it again, alone. If it fails alone too, find out why before going on.
|
|
54
52
|
- For anything the tests can't reach, exercise the change in a running REPL of your own: on a socket of
|
|
55
53
|
your own, with `--launch` unless the change needs the user's browser, and then in a tab of your own.
|
|
56
54
|
- `skill/SKILL.md` is how agents learn to use the REPL: keep it in step with a change to how it is
|
package/README.md
CHANGED
|
@@ -159,7 +159,8 @@ pw-repl where # which REPL send would reach
|
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
`pw-repl send` sends one command and prints its result, through the server when it is running and through the
|
|
162
|
-
`playwright-repl` tmux session otherwise.
|
|
162
|
+
`playwright-repl` tmux session otherwise. Chain several in the shell: `&&` stops at the first that fails or
|
|
163
|
+
is not confirmed (exit 1 or 2), `;` runs on.
|
|
163
164
|
|
|
164
165
|
Several agents can share one REPL: `pw-repl send -c <name>` (or `PW_CLIENT=<name>`) sends as a client with a
|
|
165
166
|
selected tab of its own, shown in the pane as `[server:<name>]`. `modes` says which client turned each mode on,
|
package/lib/help.js
CHANGED
|
@@ -93,7 +93,9 @@ Server: pw-repl serve also takes commands on /tmp/playwright-repl.sock; they sho
|
|
|
93
93
|
Clients: pw-repl send -c <name> (or $PW_CLIENT) sends as a client of its own. It has a selected tab of
|
|
94
94
|
its own, so clients do not move each other's; its commands show as [server:<name>] lines. modes and tab
|
|
95
95
|
say which client turned each mode on and opened each tab, and modes off --mine turns off only the
|
|
96
|
-
sender's own. Senders without a name share the prompt's selected tab.
|
|
96
|
+
sender's own. Senders without a name share the prompt's selected tab. Other clients' commands can run
|
|
97
|
+
between a client's own: its selected tab, and the previous command that wait request and wait load count
|
|
98
|
+
from, are its own; a tab's requests, console and watch are shared.
|
|
97
99
|
|
|
98
100
|
The prompt is pw[serve]> while the server is on and pw> without it. Before it are the modes on in the
|
|
99
101
|
selected tab, if any: (watch network:off routes:2 capture) pw>. modes lists them for every tab.
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -114,6 +114,22 @@ spaces and all: `pw-repl send click "text=Your name"`. It works however the REPL
|
|
|
114
114
|
`pw-repl where` says which one a command would reach (the server, or the tmux pane running the
|
|
115
115
|
REPL), or why neither is reachable, without running anything.
|
|
116
116
|
|
|
117
|
+
`send` takes one command; chain several in your shell. Use `&&` when a step only makes sense if the one
|
|
118
|
+
before it worked: it stops at any exit status but 0, a failure and an outcome not confirmed included.
|
|
119
|
+
Use `;` when the steps do not depend on each other. `-t` is each command's own limit. Write each
|
|
120
|
+
`pw-repl send` out in full, not in a shell variable, which hides it from permission rules that allow
|
|
121
|
+
`pw-repl` commands:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pw-repl send -c cart-bug click e5 && pw-repl send -c cart-bug wait load &&
|
|
125
|
+
pw-repl send -c cart-bug screenshot
|
|
126
|
+
pw-repl send -c cart-bug count .item; pw-repl send -c cart-bug text h1
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Other clients' commands can run between yours. Your selected tab is your own, and so is the previous
|
|
130
|
+
command that `wait request` and `wait load` count from; a tab's requests, console and watch are shared
|
|
131
|
+
with whoever else uses that tab.
|
|
132
|
+
|
|
117
133
|
Every command you run and its output show in the REPL's pane, or in `attach` and the log for a
|
|
118
134
|
background REPL (server commands as `[server]` lines), so whoever looks there sees what you do. The pane
|
|
119
135
|
shows REPL commands only, not what was clicked in the browser (unless `watch on --live` is on); for
|