-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an example test case with Locust + Playwright
Refs #721
- Loading branch information
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2025 Alexander Todorov <[email protected]> | ||
# | ||
# Licensed under GNU Affero General Public License v3 or later (AGPLv3+) | ||
# https://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from datetime import datetime | ||
|
||
from base import BrowserTestCase | ||
from locust import task | ||
from locust.exception import StopUser | ||
from locust_plugins.users.playwright import pw | ||
|
||
|
||
class UserActionsTestCase(BrowserTestCase): | ||
@task | ||
@pw | ||
async def visit_cases_search_page(self, page): | ||
await page.context.add_cookies([self.session_cookie]) | ||
|
||
await page.goto("/cases/search/") | ||
await page.wait_for_load_state() | ||
|
||
html = await page.content() | ||
print(html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters