-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1208 from grafana/update/browser-cloud-updates
All browser cloud documentation updates for v1.0.0
- Loading branch information
Showing
121 changed files
with
1,912 additions
and
849 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 |
---|---|---|
|
@@ -210,4 +210,5 @@ shm | |
srgb | ||
kwallet | ||
referer | ||
scrollable | ||
scrollable | ||
headful |
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
209 changes: 193 additions & 16 deletions
209
src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser.md
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
...rkdown/docs/02 javascript api/07 k6-experimental/01 browser/01 Browser class.md
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
.../docs/02 javascript api/07 k6-experimental/01 browser/01 Browser class/close.md
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
...cs/02 javascript api/07 k6-experimental/01 browser/01 Browser class/contexts.md
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
...02 javascript api/07 k6-experimental/01 browser/01 Browser class/on--event--.md
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
...kdown/docs/02 javascript api/07 k6-experimental/01 browser/01 Browser module.md
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,53 @@ | ||
****--- | ||
title: "Browser module" | ||
excerpt: "Browser module" | ||
--- | ||
|
||
The `Browser` module is the entry point for all your tests, and it is what interacts with the actual web browser via [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) (CDP). It manages: | ||
- [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) which is where you can set a variety of attributes to control the behavior of pages; | ||
- and [Page](/javascript-api/k6-experimental/browser/page/) which is where your rendered site is displayed. | ||
|
||
A new browser process is automatically created when you use the `newContext` method of the `browser` module (`'k6/experimental/browser'`). | ||
|
||
| Method | Description | | ||
|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| [browser.contexts()](/javascript-api/k6-experimental/browser/browser-module/contexts) | Lets you access all open [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/)s. | | ||
| [browser.isConnected](/javascript-api/k6-experimental/browser/browser-module/isconnected) <BWIPT id="453"/> | Indicates whether the [CDP](https://chromedevtools.github.io/devtools-protocol/) connection to the browser process is active or not. | | ||
| [browser.newContext([options])](/javascript-api/k6-experimental/browser/browser-module/newcontext/) <BWIPT id="455"/> | Creates and returns a new [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/). | | ||
| [browser.newPage([options])](/javascript-api/k6-experimental/browser/browser-module/newpage) <BWIPT id="455"/> | Creates a new [Page](/javascript-api/k6-experimental/browser/page/) in a new [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) and returns the page. | | ||
| [browser.version()](/javascript-api/k6-experimental/browser/browser-module/version/) | Returns the browser application's version. | | ||
|
||
### Example | ||
|
||
<CodeGroup labels={[]}> | ||
|
||
```javascript | ||
import { browser } from 'k6/experimental/browser'; | ||
|
||
export const options = { | ||
scenarios: { | ||
browser: { | ||
executor: 'shared-iterations', | ||
options: { | ||
browser: { | ||
type: 'chromium', | ||
}, | ||
}, | ||
}, | ||
}, | ||
thresholds: { | ||
checks: ["rate==1.0"] | ||
} | ||
} | ||
|
||
export default async function () { | ||
const page = browser.newPage(); | ||
try { | ||
await page.goto('https://test.k6.io/'); | ||
} finally { | ||
page.close(); | ||
} | ||
} | ||
``` | ||
|
||
</CodeGroup> |
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
31 changes: 0 additions & 31 deletions
31
...cs/02 javascript api/07 k6-experimental/01 browser/02 BrowserContext/browser.md
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.