Skip to content

Commit 546fe1c

Browse files
committed
Update end-to-end testing docs for test generation
Clarifies instructions for generating test files, including improved guidance on expanding generated tests, updated dependency installation, and clearer provider/model selection examples. Reorders and revises credential setup steps for better readability.
1 parent 8c9f320 commit 546fe1c

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

docs/end-to-end-testing.qmd

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,35 +174,33 @@ shiny add test
174174
```
175175

176176
1. Answer the prompts: It will ask for the path to your app file (e.g., `app.py`) and a name for your test file (e.g., `test_myapp.py`). Remember, the test file name must start with `test_`.
177-
1. The generated test file typically provides basic assertions that verify visible text and interactive state changes for Shiny components (e.g., slider values, output text).
177+
1. Generated test files usually include simple assertions that check visible UI text and interactive states for Shiny components (for example, slider values or checkbox output). Treat these as a starting point and expand them to cover additional behaviors, edge cases, and integration points as needed.
178178

179179
Before generating tests, make sure you have:
180180

181+
- An API key or credentials for the provider you intend to use:
182+
- Anthropic: `export ANTHROPIC_API_KEY=...`
183+
- OpenAI: `export OPENAI_API_KEY=...`
184+
181185
- A working Shiny app file (e.g. `app.py`).
182186
- Shiny testing dependencies installed. If you haven't installed the extras yet:
183187

184188
```bash
185-
pip install "shiny[test,testgen]"
189+
pip install "shiny[add-test]"
186190
```
187191

188-
- An API key or credentials for the provider you intend to use:
189-
- Anthropic: `export ANTHROPIC_API_KEY=...`
190-
- OpenAI: `export OPENAI_API_KEY=...`
191-
192-
193192
#### Choosing a provider for generating tests
194193

195194
```bash
196195
# Anthropic (default)
197-
shiny add test --app app.py --provider anthropic --model sonnet
196+
shiny add test --app app.py
198197

199-
# OpenAI
200-
shiny add test --app app.py --provider openai --model gpt-5
201-
```
198+
# OpenAI (will use gpt-5)
199+
shiny add test --app app.py --provider openai
202200

203-
::: callout-note
204-
The generated file is a **starting point**, not a full coverage suite. Iterate toward meaningful, stable assertions aligned with your app’s business logic.
205-
:::
201+
# explicitly use gpt-5-mini model
202+
shiny add test --app app.py --provider openai --model gpt-5-mini
203+
```
206204

207205
### Troubleshooting Common Issues
208206

0 commit comments

Comments
 (0)