Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ next-env.d.ts

# manually-triggered API type codegen output (see src/lib/api-types.ts)
src/lib/api-types.generated.ts

# playwright e2e artifacts
test-results/
playwright-report/
e2e/.e2e-certs/
25 changes: 25 additions & 0 deletions frontend/e2e/global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { execSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";

const CERT_DIR = path.join(__dirname, ".e2e-certs");
const CERT_PATH = path.join(CERT_DIR, "cert.pem");
const KEY_PATH = path.join(CERT_DIR, "key.pem");

export default function globalSetup() {
if (fs.existsSync(CERT_PATH) && fs.existsSync(KEY_PATH)) {
return;
}
fs.mkdirSync(CERT_DIR, { recursive: true });
execSync(
[
"openssl req -x509 -newkey rsa:2048 -nodes",
`-keyout ${KEY_PATH}`,
`-out ${CERT_PATH}`,
"-days 3650",
'-subj "/CN=localhost"',
'-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"',
].join(" "),
{ stdio: "pipe" },
);
}
Loading
Loading