PlaywrightEx.Artifact (PlaywrightEx v0.6.0)

Copy Markdown View Source

Interact with a Playwright Artifact.

Artifacts are Playwright-owned files produced by operations such as tracing or downloads. Local Playwright connections expose a finished artifact path directly, while remote connections require streaming the artifact bytes through the protocol.

Summary

Functions

Deletes an artifact from Playwright.

Saves an artifact to path.

Types

opt()

@type opt() :: {:connection, GenServer.name()} | {:timeout, timeout()}

Functions

delete(artifact_guid, opts \\ [])

@spec delete(PlaywrightEx.guid(), [opt() | PlaywrightEx.unknown_opt()]) ::
  {:ok, any()} | {:error, any()}

Deletes an artifact from Playwright.

save_as(artifact_guid, path, opts \\ [])

@spec save_as(PlaywrightEx.guid(), Path.t(), [opt() | PlaywrightEx.unknown_opt()]) ::
  :ok | {:error, any()}

Saves an artifact to path.

For local Playwright connections this copies the finished artifact file. For remote Playwright connections this streams the artifact through the Playwright protocol.