-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
browser: Add page on request example
- Loading branch information
1 parent
8f76910
commit 2c5f7b2
Showing
1 changed file
with
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { browser } from 'k6/browser' | ||
|
||
export const options = { | ||
scenarios: { | ||
ui: { | ||
executor: 'shared-iterations', | ||
options: { | ||
browser: { | ||
type: 'chromium', | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default async function () { | ||
const page = await browser.newPage() | ||
|
||
// registers a handler that logs all requests made by the page | ||
page.on('request', async request => console.log(request.url())) | ||
|
||
await page.goto('https://quickpizza.grafana.com/', { waitUntil: 'networkidle' }) | ||
|
||
await page.close(); | ||
} |