oneuptime/E2E/Config.ts

29 lines
988 B
TypeScript
Raw Normal View History

import Protocol from "Common/Types/API/Protocol";
import URL from "Common/Types/API/URL";
type GetEnvFunction = (key: string) => string;
export const env: GetEnvFunction = (key: string): string => {
return (process.env[key] as string) || "";
};
export const HOST: string = env("HOST") || "localhost";
export const HTTP_PROTOCOL: Protocol =
env("HTTP_PROTOCOL") === "https" ? Protocol.HTTPS : Protocol.HTTP;
export const BASE_URL: URL = URL.fromString(`${HTTP_PROTOCOL}${HOST}`);
2024-04-25 21:03:12 +00:00
export const IS_USER_REGISTERED: boolean =
env("E2E_TEST_IS_USER_REGISTERED") === "true";
2024-04-25 21:03:12 +00:00
export const REGISTERED_USER_EMAIL: string =
env("E2E_TEST_REGISTERED_USER_EMAIL") || "";
2024-04-25 21:03:12 +00:00
export const REGISTERED_USER_PASSWORD: string =
env("E2E_TEST_REGISTERED_USER_PASSWORD") || "";
export const IS_BILLING_ENABLED: boolean = env("BILLING_ENABLED") === "true";
export const STATUS_PAGE_URL: URL | null = env("E2E_TEST_STATUS_PAGE_URL")
? URL.fromString(env("E2E_TEST_STATUS_PAGE_URL"))
: null;