@clerk/testing
Version:
Utilities to help you create E2E test suites for apps using Clerk
25 lines • 1.08 kB
TypeScript
import type { Page } from '@playwright/test';
import type { SetupClerkTestingTokenOptions } from '../common';
type SetupClerkTestingTokenParams = {
page: Page;
options?: SetupClerkTestingTokenOptions;
};
/**
* Bypasses bot protection by appending the testing token in the Frontend API requests.
*
* @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 ({ page }) => {
* await setupClerkTestingToken({ page });
* await page.goto('https://your-app.com');
* // Continue with your test...
* });
*/
export declare const setupClerkTestingToken: ({ page, options }: SetupClerkTestingTokenParams) => Promise<void>;
export {};
//# sourceMappingURL=setupClerkTestingToken.d.ts.map