mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
Feature/ssl integration (#1)
* feat: update E2E testing configuration to use ssl * fix: add IPv6 loopback support to mkcert generation command in CI workflow * feat: centralize SSL certificate generation into a reusable workflow job * fix: use static ip in mkcert command * fix: correct mkcert command args * feat: implement certificate caching in CI workflow to persist SSL files across jobs * refactor: optimize CI workflow caching * ci: implement certificate caching in workflow * fix: correct certificate caching keys and fix environment file paths in CI workflows * fix: correct environment file paths and parallelize frontend dependency installation in CI workflow * test: set TZ environment variable to Asia/Kolkata in vitest configuration * fix: force en-US locale in Intl formatters to ensure consistent date and time output * fix: update MAILPIT_API_URL protocol from https to http in e2e environment example * chore: set test timezone to Asia/Kolkata * ci: add sll support and enhance e2e workflow * ci: improve compatibility for docker-compose execution * refactor: improve container orchestration detection and fallback logic in e2e test script * feat: add container runtime validation and force docker usage in CI environment * feat: add caching for Playwright dependencies in CI workflow * chore: update restart policy to unless-stopped for postgres and mailpit services in e2e docker-compose --------- Co-authored-by: ramvignesh-b <ramvignesh-b@github.com>
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import path from "node:path";
|
||||
import process from "node:process";
|
||||
import process, { env } from "node:process";
|
||||
import { defineConfig, devices } from "@playwright/test";
|
||||
import dotenv from "dotenv";
|
||||
import { getBaseUrl } from "./utils/url-builder";
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
*/
|
||||
dotenv.config({ path: path.resolve(process.cwd(), "../.env.e2e") });
|
||||
const baseUrl = getBaseUrl(
|
||||
env.SSL_ENABLED === "true",
|
||||
env.FRONTEND_DOMAIN,
|
||||
env.FRONTEND_PORT,
|
||||
);
|
||||
|
||||
console.log(baseUrl);
|
||||
export default defineConfig({
|
||||
timeout: 60000,
|
||||
expect: {
|
||||
@@ -26,13 +34,17 @@ export default defineConfig({
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: process.env.FRONTEND_URL,
|
||||
baseURL: baseUrl,
|
||||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
||||
actionTimeout: 20000,
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: "on-first-retry",
|
||||
/* Capture screenshot on failure */
|
||||
screenshot: "only-on-failure",
|
||||
/* Capture video on failure */
|
||||
video: "retain-on-failure",
|
||||
/* Ignore HTTPS errors */
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
@@ -49,8 +61,13 @@ export default defineConfig({
|
||||
|
||||
/* Run your local dev server before starting the tests */
|
||||
webServer: {
|
||||
command: "bun run dev",
|
||||
url: process.env.FRONTEND_URL,
|
||||
command: "bun run dev -- --mode e2e",
|
||||
url: getBaseUrl(
|
||||
process.env.SSL_ENABLED === "true",
|
||||
process.env.FRONTEND_DOMAIN,
|
||||
process.env.FRONTEND_PORT,
|
||||
),
|
||||
reuseExistingServer: !process.env.CI,
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user