Skip to content

Commit

Permalink
Sort k6/browser module in JavaScript API section (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano authored Jul 22, 2024
1 parent 886c054 commit ff51652
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
30 changes: 15 additions & 15 deletions docs/sources/next/javascript-api/k6-browser/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'k6/browser'
description: 'An overview of the browser-level APIs from browser module.'
weight: 01
weight: 02
---

# browser
Expand Down Expand Up @@ -34,14 +34,14 @@ The browser module is the entry point for all your tests, and it is what interac
- [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext) which is where you can set a variety of attributes to control the behavior of pages;
- and [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) which is where your rendered site is displayed.

| Method | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [browser.context()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/context) | Returns the current [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| [browser.closeContext()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/closecontext) | Closes the current [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| [browser.isConnected](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/isconnected) {{< docs/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])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/newcontext/) {{< docs/bwipt id="455" >}} | Creates and returns a new [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| Method | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [browser.context()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/context) | Returns the current [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| [browser.closeContext()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/closecontext) | Closes the current [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| [browser.isConnected](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/isconnected) {{< docs/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])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/newcontext/) {{< docs/bwipt id="455" >}} | Creates and returns a new [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext). |
| [browser.newPage([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/newpage) {{< docs/bwipt id="455" >}} | Creates a new [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) in a new [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext) and returns the page. Pages that have been opened ought to be closed using [`Page.close`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page/close). Pages left open could potentially distort the results of Web Vital metrics. |
| [browser.version()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/version) | Returns the browser application's version. |
| [browser.version()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/version) | Returns the browser application's version. |

### Example

Expand Down Expand Up @@ -113,20 +113,20 @@ PS C:\k6> k6 run script.js

## Browser-level APIs

| k6 Class | Description |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| k6 Class | Description |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext) {{< docs/bwipt >}} | Enables independent browser sessions with separate [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page)s, cache, and cookies. |
| [ElementHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/elementhandle) {{< docs/bwipt >}} | Represents an in-page DOM element. |
| [ElementHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/elementhandle) {{< docs/bwipt >}} | Represents an in-page DOM element. |
| [Frame](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/frame) {{< docs/bwipt >}} | Access and interact with the [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page).'s `Frame`s. |
| [JSHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/jshandle) | Represents an in-page JavaScript object. |
| [JSHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/jshandle) | Represents an in-page JavaScript object. |
| [Keyboard](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/keyboard) | Used to simulate the keyboard interactions with the associated [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page). |
| [Locator](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator) | The Locator API makes it easier to work with dynamically changing elements. |
| [Locator](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator) | The Locator API makes it easier to work with dynamically changing elements. |
| [Mouse](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/mouse) | Used to simulate the mouse interactions with the associated [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page). |
| [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) {{< docs/bwipt >}} | Provides methods to interact with a single tab in a browser. |
| [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) {{< docs/bwipt >}} | Provides methods to interact with a single tab in a browser. |
| [Request](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/request) {{< docs/bwipt >}} | Used to keep track of the request the [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) makes. |
| [Response](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/response) {{< docs/bwipt >}} | Represents the response received by the [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page). |
| [Touchscreen](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/touchscreen) | Used to simulate touch interactions with the associated [`Page`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page). |
| [Worker](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/worker) | Represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). |
| [Worker](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/worker) | Represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). |

## Browser Module Options

Expand Down
Loading

0 comments on commit ff51652

Please sign in to comment.