Scenarios

Custom scenarios can be specified via the Scenario class:

class logikal_browser.Scenario(settings: Settings | Iterable[Settings], browsers: Iterable[str] | None = None)

Browser scenario specification.

Parameters:
  • settings – Settings to use.

  • browsers – Browsers to use. Defaults to using all configured browser versions.

class logikal_browser.Settings(name: str, width: int, height: int, full_page_height: bool = True, mobile: bool = False)

Browser settings specification.

Parameters:
  • name – Name of the settings.

  • width – Browser window width.

  • height – Browser window height.

  • full_page_height – Whether to use the full page height for screenshots.

  • mobile – Whether it is a mobile browser.

Standard Scenarios

Currently the following standard scenarios are available:

logikal_browser.scenarios.desktop_4k = StandardScenario(settings=Settings(name='desktop_4k', width=2560, height=1440, full_page_height=True, mobile=False), browsers=None)
logikal_browser.scenarios.desktop = StandardScenario(settings=Settings(name='desktop', width=1800, height=900, full_page_height=True, mobile=False), browsers=None)
logikal_browser.scenarios.laptop_l = StandardScenario(settings=Settings(name='laptop_l', width=1440, height=900, full_page_height=True, mobile=False), browsers=None)
logikal_browser.scenarios.laptop = StandardScenario(settings=Settings(name='laptop', width=1024, height=768, full_page_height=True, mobile=False), browsers=None)
logikal_browser.scenarios.tablet = StandardScenario(settings=Settings(name='tablet', width=768, height=1024, full_page_height=True, mobile=True), browsers=None)
logikal_browser.scenarios.mobile_l = StandardScenario(settings=Settings(name='mobile_l', width=425, height=680, full_page_height=True, mobile=True), browsers=None)
logikal_browser.scenarios.mobile_m = StandardScenario(settings=Settings(name='mobile_m', width=375, height=600, full_page_height=True, mobile=True), browsers=None)
logikal_browser.scenarios.mobile_s = StandardScenario(settings=Settings(name='mobile_s', width=320, height=512, full_page_height=True, mobile=True), browsers=None)