import '@japa/plugin-adonisjs'; import type { PluginFn } from '@japa/runner/types'; import type { ApplicationService } from '@adonisjs/core/types'; import type { CookieOptions as AdonisCookieOptions } from '@adonisjs/core/types/http'; import { SessionClient } from '../../client.ts'; import type { SessionData } from '../../types.ts'; declare module 'playwright' { interface BrowserContext { sessionClient: SessionClient; /** * Initiate session. The session id cookie will be defined * if missing */ initiateSession(options?: Partial): Promise; /** * Returns data from the session store */ getSession(): Promise; /** * Returns data from the session store */ getFlashMessages(): Promise; /** * Set session data */ setSession(values: SessionData): Promise; /** * Set flash messages */ setFlashMessages(values: SessionData): Promise; } } /** * Hooks AdonisJS Session with the Japa browser client plugin. * Provides session methods for browser testing context. * * @param app - AdonisJS application service * * @example * // Register in test setup * import { sessionBrowserClient } from '@adonisjs/session/plugins/japa/browser_client' * * // Use in browser tests * test('can set session data', async ({ visit }) => { * await visit.context().setSession({ userId: 123 }) * const response = await visit('/profile') * // Assert profile page shows user data * }) */ export declare const sessionBrowserClient: (app: ApplicationService) => PluginFn;