When browser context is created with the :record_video option, each page has a video object associated with it.
IO.puts(Page.video(page) |> Video.path!())Since Playwright 1.8.
The examples alias the modules they use (alias Playwright.{Locator, Page}).
Summary
Functions
Deletes the video file. Will wait for the video to finish if necessary.
Like delete/1, but returns the value and raises on error.
Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem upon closing the browser context. This method fails when connected remotely.
Like path/1, but returns the value and raises on error.
Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after the page has closed. This method waits until the page is closed and the video is fully saved.
Like save_as/2, but returns the value and raises on error.
Types
Functions
@spec delete(t()) :: :ok | {:error, Playwright.error()}
Deletes the video file. Will wait for the video to finish if necessary.
Since Playwright 1.11.
@spec delete!(t()) :: :ok
Like delete/1, but returns the value and raises on error.
@spec path(t()) :: {:ok, String.t()} | {:error, Playwright.error()}
Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem upon closing the browser context. This method fails when connected remotely.
Since Playwright 1.8.
Like path/1, but returns the value and raises on error.
@spec save_as(t(), String.t()) :: :ok | {:error, Playwright.error()}
Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after the page has closed. This method waits until the page is closed and the video is fully saved.
Since Playwright 1.11.
Arguments
path- Path where the video should be saved.
Like save_as/2, but returns the value and raises on error.