diff --git a/packages/playwright/src/takeSnapshot.ts b/packages/playwright/src/takeSnapshot.ts index 7beeaa7b..8ec08f04 100644 --- a/packages/playwright/src/takeSnapshot.ts +++ b/packages/playwright/src/takeSnapshot.ts @@ -35,6 +35,9 @@ async function takeSnapshot( // Serialize and capture the DOM const domSnapshot: elementNode = await page.evaluate(dedent` ${rrweb}; + // page.evaluate returns the value of the function being evaluated. In this case, it means that + // it is returning either the resolved value of the Promise or the return value of the call to + // the snapshot function. See https://playwright.dev/docs/api/class-page#page-evaluate. if (typeof define === "function" && define.amd) { // AMD support is detected, so we need to load rrwebSnapshot asynchronously new Promise((resolve) => {