createAssets
createAssets<
T>(assetsMap):Assets<T>
Defined in: asset.ts:90
Creates a set of typed asset controllers, one per key in the map.
Calling a controller marks the asset in the recording timeline. The renderer places the asset at that point and plays it for its natural duration.
Type Parameters
Section titled “Type Parameters”T extends Record<string, AssetConfig>
Parameters
Section titled “Parameters”assetsMap
Section titled “assetsMap”{ [K in string | number | symbol]: T[K] }
Returns
Section titled “Returns”Assets<T>
Example
Section titled “Example”const assets = createAssets({ logo: { path: './logo.png', audio: 0, fullScreen: false }, intro: { path: './intro.mp4', audio: 1.0, fullScreen: true },})
video('Product demo', async ({ page }) => { await assets.intro() await page.goto('/dashboard') await assets.logo()})