effect-playwright
    Preparing search index...
    • Creates a Layer that initializes the PlaywrightEnvironment.

      Parameters

      • browser: BrowserType

        The Playwright BrowserType implementation (e.g. chromium, firefox, webkit).

      • OptionallaunchOptions: LaunchOptions

        Optional configuration for launching the browser (e.g. headless, args).

      Returns Layer<PlaywrightEnvironment.PlaywrightEnvironment, never, never>

      import { PlaywrightEnvironment } from "effect-playwright/experimental";
      import { chromium } from "playwright-core";

      const playwrightEnv = PlaywrightEnvironment.layer(chromium);

      // use the layer
      const program = Effect.gen(function* () {
      const playwright = yield* PlaywrightEnvironment;
      const browser = yield* playwright.browser;
      const page = yield* browser.newPage();
      yield* page.goto("https://example.com");
      }).pipe(Effect.scoped, Effect.provide(playwrightEnv));

      0.1.0