Skip to content

Commit ff4e40e

Browse files
committed
more direction on testing with playwright and how to deploy
1 parent 66d05da commit ff4e40e

File tree

3 files changed

+49
-17
lines changed

3 files changed

+49
-17
lines changed

AGENTS.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
## Recipe/Pattern Development
44

5-
If you are developing recipes/patterns (they mean the same thing), read the
6-
following documentation:
5+
If you are developing recipes/patterns (they mean the same thing), you MUST read
6+
ALL of the following documentation:
77

8+
- `docs/common/RECIPE_DEV_DEPLOY.md` - Building, debugging, and deploying
9+
recipes step-by-step
810
- `docs/common/RECIPES.md` - Writing recipes with cells, handlers, lifts, best
911
practices, and [ID] usage patterns
10-
- `docs/common/PATTERNS.md` - High-level patterns and examples for building
11-
applications, including common mistakes and debugging tips
1212
- `docs/common/HANDLERS.md` - Writing handler functions, event types, state
1313
management, and handler factory patterns
14-
- `docs/common/COMPONENTS.md` - Guide to UI components (ct-checkbox, ct-input,
14+
- `docs/common/COMPONENTS.md` - Using UI components (ct-checkbox, ct-input,
1515
ct-select, etc.) with bidirectional binding and event handling patterns
16-
- `docs/common/RECIPE_DEV_DEPLOY.md` - Building, debugging, and deploying
17-
recipes step-by-step
16+
- `docs/common/PATTERNS.md` - High-level patterns and examples for building
17+
applications, including common mistakes and debugging tips
1818
- `docs/common/DEVELOPMENT.md` - Coding style, design principles, and best
1919
practices
20-
- `docs/common/UI_TESTING.md` - How to work with shadow dom in our integration
21-
tests
20+
- `docs/common/UI_TESTING.md` - Optional: How to work with shadow dom in our
21+
integration tests
2222

2323
Check `packages/patterns/` for working recipe examples.
2424

docs/common/PATTERNS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ const removeItem = handler(/* ... */);
740740
```
741741

742742
**4. Deploy and Test (3-5 minutes)**
743+
Read ./common/doc/RECIPE_DEV_DEPLOY.md for more information on how to deploy
743744
```bash
744745
# Deploy
745746
./dist/ct charm new --identity key.json --api-url ... --space test pattern.tsx
@@ -760,6 +761,7 @@ echo '{"title": "Test", "done": false}' | \
760761

761762
### Testing Commands Reference
762763

764+
Read ./common/doc/RECIPE_DEV_DEPLOY.md for more information on how to deploy
763765
```bash
764766
# Check syntax only (fast)
765767
./dist/ct dev pattern.tsx --no-run

docs/common/RECIPE_DEV_DEPLOY.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,36 @@ See `PATTERNS.md` Level 3-4 for linking and composition patterns.
153153
- Forget `OpaqueRef<T>` annotations in `.map()`
154154
- Duplicate content from `docs/common/` - reference it instead
155155

156+
## Testing
157+
After developing the charm, if you have Playwright MCP, you must test the charm with it unless the user asks you not to.
158+
159+
### Navigate to the Charm URL
160+
161+
```javascript
162+
await page.goto("http://localhost:8000/<SPACE_NAME>/<CHARM_ID>");
163+
```
164+
Note: Server may be https://toolshed.saga-castor.ts.net instead.
165+
166+
### Register/Login (First Time Only)
167+
168+
When you first visit, you'll see a login page. Register with a passphrase:
169+
170+
1. Click the "➕ Register" button
171+
2. Click the "🔑 Generate Passphrase" button
172+
3. Click the "🔒 I've Saved It - Continue" button
173+
174+
This will log you in and load the charm.
175+
176+
### Test the Charm
177+
178+
Once logged in, you can interact with the charm using Playwright commands.
179+
180+
Then use Playwright to:
181+
182+
1. Navigate to the URL
183+
2. Complete registration (first time)
184+
3. Test the charm functionality
185+
156186
## Deployment
157187

158188
### Prerequisite: `ct` tool availability
@@ -197,18 +227,18 @@ This tool is used to:
197227
./dist/ct dev recipe.tsx --no-run
198228

199229
# 2. Deploy to test space
200-
./dist/ct charm new --identity claude.key --api-url https://toolshed.saga-castor.ts.net/ --space test-space recipe.tsx
230+
./dist/ct charm new --identity claude.key --api-url https://toolshed.saga-castor.ts.net --space test-space recipe.tsx
201231
# Record the charm ID returned
202232

203233
# 3. Inspect deployed charm
204-
./dist/ct charm inspect --identity claude.key --api-url https://toolshed.saga-castor.ts.net/ --space test-space --charm [charm-id]
234+
./dist/ct charm inspect --identity claude.key --api-url https://toolshed.saga-castor.ts.net --space test-space --charm [charm-id]
205235
```
206236

207237
#### Iteration Cycle
208238

209239
```bash
210240
# Update existing charm (much faster than deploying new)
211-
./dist/ct charm setsrc --identity claude.key --api-url https://toolshed.saga-castor.ts.net/ --space test-space --charm [charm-id] recipe.tsx
241+
./dist/ct charm setsrc --identity claude.key --api-url https://toolshed.saga-castor.ts.net --space test-space --charm [charm-id] recipe.tsx
212242
```
213243

214244
**Note:** Don't pre-test syntax unless deployment fails. The deployment process validates automatically.
@@ -217,7 +247,7 @@ This tool is used to:
217247

218248
```bash
219249
# Get source from deployed charm
220-
./dist/ct charm getsrc --identity claude.key --api-url https://toolshed.saga-castor.ts.net/ --space [space] --charm [id] ./recipe.tsx
250+
./dist/ct charm getsrc --identity claude.key --api-url https://toolshed.saga-castor.ts.net --space [space] --charm [id] ./recipe.tsx
221251
```
222252

223253
### Quick Command Reference
@@ -227,16 +257,16 @@ This tool is used to:
227257
./dist/ct dev recipe.tsx --no-run
228258

229259
# Deploy new charm
230-
./dist/ct charm new -i claude.key -a https://toolshed.saga-castor.ts.net/ -s space recipe.tsx
260+
./dist/ct charm new -i claude.key -a https://toolshed.saga-castor.ts.net -s space recipe.tsx
231261

232262
# Update existing charm
233-
./dist/ct charm setsrc -i claude.key -a https://toolshed.saga-castor.ts.net/ -s space -c charm-id recipe.tsx
263+
./dist/ct charm setsrc -i claude.key -a https://toolshed.saga-castor.ts.net -s space -c charm-id recipe.tsx
234264

235265
# Inspect charm
236-
./dist/ct charm inspect -i claude.key -a https://toolshed.saga-castor.ts.net/ -s space -c charm-id
266+
./dist/ct charm inspect -i claude.key -a https://toolshed.saga-castor.ts.net -s space -c charm-id
237267

238268
# Get source from charm
239-
./dist/ct charm getsrc -i claude.key -a https://toolshed.saga-castor.ts.net/ -s space -c charm-id output.tsx
269+
./dist/ct charm getsrc -i claude.key -a https://toolshed.saga-castor.ts.net -s space -c charm-id output.tsx
240270

241271
# For full ct command reference, use the ct skill
242272
```

0 commit comments

Comments
 (0)