UNPKG

@clerk/testing

Version:

Utilities to help you create E2E test suites for apps using Clerk

28 lines 1.25 kB
import type { BrowserContext, Page } from '@playwright/test'; import type { SetupClerkTestingTokenOptions } from '../common'; type SetupClerkTestingTokenParams = { context?: BrowserContext; page?: Page; options?: SetupClerkTestingTokenOptions; }; /** * Bypasses bot protection by appending the testing token in the Frontend API requests. * * @param params.context - The Playwright browser context object. * @param params.page - The Playwright page object. * @param params.options.frontendApiUrl - The frontend API URL for your Clerk dev instance, without the protocol. * @returns A promise that resolves when the bot protection bypass is set up. * @throws An error if the Frontend API URL is not provided. * @example * import { setupClerkTestingToken } from '@clerk/testing/playwright'; * * test('should bypass bot protection', async ({ context }) => { * await setupClerkTestingToken({ context }); * const page = await context.newPage(); * await page.goto('https://your-app.com'); * // Continue with your test... * }); */ export declare const setupClerkTestingToken: ({ context, options, page }: SetupClerkTestingTokenParams) => Promise<void>; export {}; //# sourceMappingURL=setupClerkTestingToken.d.ts.map