Skip to main content

PlaywrightBrowserPlugin

A plugin for managing Playwright automation library.

It should work as a factory for creating new browser instances.

Hierarchy

Index

Methods

__aenter__

  • Enter the context manager and initialize the browser plugin.


    Returns BaseBrowserPlugin

__aexit__

  • async __aexit__(*, exc_type, exc_value, exc_traceback): None
  • Exit the context manager and close the browser plugin.


    Parameters

    • optionalkeyword-onlyexc_type: type[BaseException] | None
    • optionalkeyword-onlyexc_value: BaseException | None
    • optionalkeyword-onlyexc_traceback: TracebackType | None

    Returns None

__init__

  • __init__(*, browser_type, browser_options, page_options, max_open_pages_per_browser): None
  • A default constructor.


    Parameters

    • optionalkeyword-onlybrowser_type: BrowserType = 'chromium'

      The type of the browser to launch.

    • optionalkeyword-onlybrowser_options: Mapping[str, Any] | None = None

      Options to configure the browser instance.

    • optionalkeyword-onlypage_options: Mapping[str, Any] | None = None

      Options to configure a new page instance.

    • optionalkeyword-onlymax_open_pages_per_browser: int = 20

      The maximum number of pages that can be opened in a single browser instance. Once reached, a new browser instance will be launched to handle the excess.

    Returns None

new_browser

Properties

AUTOMATION_LIBRARY

AUTOMATION_LIBRARY: str | None

The name of the automation library that the plugin is managing.

browser_options

browser_options: Mapping[str, Any]

Return the options for a new browser.

browser_type

browser_type: BrowserType

Return the browser type name.

max_open_pages_per_browser

max_open_pages_per_browser: int

Return the maximum number of pages that can be opened in a single browser.

page_options

page_options: Mapping[str, Any]

Return the options for a new page.