Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add browser traffic in loadgenerator and export traces in frontend #1345

Merged
merged 14 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert - Removed select option event
jordibisbal8 committed Jan 29, 2024

Unverified

This user has not yet uploaded their public signing key.
commit e556c4a7728bd51fbe04aa2753e7962e39fe5be8
4 changes: 2 additions & 2 deletions src/loadgenerator/locustfile.py
Original file line number Diff line number Diff line change
@@ -142,12 +142,12 @@ class WebsiteBrowserUser(PlaywrightUser):

@task
@pw
async def open_cart_page_and_click_button(self, page: PageWithRetry):
async def open_cart_page_and_change_currency(self, page: PageWithRetry):
try:
page.on("console", lambda msg: print(msg.text))
await page.route('**/*', add_baggage_header)
await page.goto("/cart", wait_until="domcontentloaded")
await page.click('button:has-text("Continue Shopping")', wait_until="domcontentloaded")
await page.select_option('[name="currency_code"]', 'CHF')
await page.wait_for_timeout(2000) # giving the browser time to export the traces
except:
pass