Skip to content

Commit c2e6f66

Browse files
committed
changelog for test prompt param and update docs
1 parent 48a029f commit c2e6f66

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.changeset/eleven-lamps-watch.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"magnitude-test": patch
3+
---
4+
5+
add support for prompting at test and test group levels
6+
author: @ashutosh-rath02

docs/testing/building-test-cases.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ test('example', async (agent) => {
9393
});
9494
```
9595

96+
You can also do this at the test or group level to apply to all acts within that block.
97+
98+
```typescript
99+
test.group('todo list', { prompt: 'Each todo should be exactly 5 words'}, () => {
100+
test('can add todos', { url: 'https://magnitodo.com', prompt: 'All todos should be animal related' }, async (agent) => {
101+
await agent.act('create 3 todos', { prompt: 'the first and last word on the todo must start with the same letter'});
102+
});
103+
});
104+
```
96105

97106
### Example of migrating a Playwright test case to Magnitude
98107

0 commit comments

Comments
 (0)