Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ codegen: ## generate test code
uv run playwright codegen \
--target python-pytest \
--output tests/test_codegen.py

.PHONY: locust
locust: ## run locust server running on localhost:8089
uv run locust \
--locustfile scripts/locustfile.py \
--host http://localhost:8888 \
--web-port 8089
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ uv run scripts/load_context.py

## [Playwright MCP server](https://github.com/microsoft/playwright-mcp)

## [Locust](https://github.com/locustio/locust)

- [Your first test](https://docs.locust.io/en/stable/quickstart.html)

## Custom apps

### Credentials
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"authlib>=1.5.2",
"locust>=2.36.2",
"playwright>=1.52.0",
"pytest-playwright>=0.7.0",
"streamlit>=1.45.0",
Expand Down
9 changes: 9 additions & 0 deletions scripts/locustfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from locust import HttpUser, task


class HelloWorldUser(HttpUser):
Comment on lines +1 to +4
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a wait_time attribute to the HelloWorldUser class to simulate realistic user behavior. For example, you can add 'wait_time = between(1, 5)' to introduce random waiting periods between requests.

Suggested change
from locust import HttpUser, task
class HelloWorldUser(HttpUser):
from locust import HttpUser, task, between
class HelloWorldUser(HttpUser):
wait_time = between(1, 5)

Copilot uses AI. Check for mistakes.

@task
def hello_world(self):
self.client.get(
url="/",
)
Loading