diff --git a/src/csf/__snapshots__/transformCsf.test.ts.snap b/src/csf/__snapshots__/transformCsf.test.ts.snap index e04d4ddc..c20f0035 100644 --- a/src/csf/__snapshots__/transformCsf.test.ts.snap +++ b/src/csf/__snapshots__/transformCsf.test.ts.snap @@ -29,7 +29,7 @@ if (!require.main) { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -96,7 +96,7 @@ if (!require.main) { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -149,7 +149,7 @@ if (!require.main) { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { diff --git a/src/playwright/transformPlaywright.test.ts b/src/playwright/transformPlaywright.test.ts index 2e43f5f7..17a5a80d 100644 --- a/src/playwright/transformPlaywright.test.ts +++ b/src/playwright/transformPlaywright.test.ts @@ -69,7 +69,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -114,7 +114,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -177,7 +177,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -240,7 +240,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -285,7 +285,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -357,7 +357,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -402,7 +402,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -479,7 +479,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -540,7 +540,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -601,7 +601,7 @@ describe('Playwright', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { diff --git a/src/playwright/transformPlaywright.ts b/src/playwright/transformPlaywright.ts index f74699ae..094306dd 100644 --- a/src/playwright/transformPlaywright.ts +++ b/src/playwright/transformPlaywright.ts @@ -25,7 +25,7 @@ export const testPrefixer: TestPrefixer = (context) => { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ id, hasPlayFn }) => __test(id, hasPlayFn), { + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { id: %%id%%, }); diff --git a/src/playwright/transformPlaywrightJson.test.ts b/src/playwright/transformPlaywrightJson.test.ts index 2d16d735..0adde362 100644 --- a/src/playwright/transformPlaywrightJson.test.ts +++ b/src/playwright/transformPlaywrightJson.test.ts @@ -53,7 +53,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -98,7 +98,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -145,7 +145,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -239,7 +239,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -286,7 +286,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -356,7 +356,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -447,7 +447,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -492,7 +492,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -539,7 +539,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), { @@ -618,7 +618,7 @@ describe('Playwright Json', () => { if (globalThis.__sbPreVisit) { await globalThis.__sbPreVisit(page, context); } - const result = await page.evaluate(({ + const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), {