diff --git a/apps/desktop/e2e/browser-tools.spec.ts b/apps/desktop/e2e/browser-tools.spec.ts index 3b573ad9df3..92e5e18d429 100644 --- a/apps/desktop/e2e/browser-tools.spec.ts +++ b/apps/desktop/e2e/browser-tools.spec.ts @@ -1,5 +1,5 @@ import { mkdtempSync } from 'node:fs' -import { createServer, type Server } from 'node:http' +import { createServer, type IncomingMessage, type Server } from 'node:http' import { tmpdir } from 'node:os' import { join } from 'node:path' import { fileURLToPath } from 'node:url' @@ -62,6 +62,36 @@ const CAPABILITIES_FIXTURE = `Capabilities fixture const POPUP_FIXTURE = `Authorize fixture ` +/** Sign-in and payment popup patterns: blank-then-navigate, and form posts into a new tab. */ +const popupsFixture = ( + appOrigin: string, + popupOrigin: string +) => `Popups fixture +
+
+` + +async function readBody(request: IncomingMessage): Promise { + let body = '' + for await (const chunk of request) body += chunk.toString() + return body +} + +const echoPage = (method: string | undefined, body: string) => + `${method} ${body}` + const UPLOAD_TARGET_FIXTURE = `Upload target fixture