UNPKG

@salesforce/salesforcedx-vscode-test-tools

Version:
145 lines (144 loc) 5.16 kB
import { LogLevel } from './core/constants'; /** * Singleton class to manage environment settings for Salesforce DX VSCode automation tests * * @remarks * This class loads configuration from environment variables at initialization time */ export declare class EnvironmentSettings { private static _instance; /** * VSCode version to use in tests * @env VSCODE_VERSION - VSCode version identifier (vscode-extension-tester standard) * @default 'latest' */ private _codeVersion; /** * Specific test spec files to run * @env SPEC_FILES - Test spec filename(s) to run * @default [] */ private _specFiles; /** * Path to directory containing VSIX files to install * @env VSIX_TO_INSTALL - Path to directory with VSIX files * @default undefined */ private _vsixToInstallDir; /** * DevHub org alias name * @env DEV_HUB_ALIAS_NAME - Alias for the DevHub org * @default 'vscodeOrg' */ private _devHubAliasName; /** * DevHub username * @env DEV_HUB_USER_NAME - Username for the DevHub org */ private _devHubUserName; /** * SFDX auth URL for authentication * @env SFDX_AUTH_URL - URL for authenticating with Salesforce DX * @default undefined */ private _sfdxAuthUrl; /** * Path to Salesforce DX VSCode extensions * @env EXTENSIONS_FOLDER - Path to extensions directory (vscode-extension-tester standard) * @default '[project_root]/extensions' */ private _extensionsFolder; /** * Path to the workspace folder where VS Code and test artifacts are stored * @env TEST_RESOURCES - Path to workspace directory (vscode-extension-tester standard) * @default '[project_root]/test-resources' */ private _testResources; /** * Chrome driver arguments * @env VSCODE_EXTENSION_TESTER_CHROMEDRIVER_ARGS - Arguments for Chrome driver * @default undefined */ private _chromeDriverArgs; /** * Test execution start time * @default current time formatted as short time string */ private _startTime; /** * Factor to slow down test execution * @env THROTTLE_FACTOR - Number to multiply timeouts by * @default 1 */ private _throttleFactor; /** * Java home directory path * @env JAVA_HOME - Path to Java installation * @default undefined */ private _javaHome; /** * Path to an existing project to use instead of creating a new one * @env USE_EXISTING_PROJECT_PATH - Path to existing project directory * @default undefined */ private _useExistingProject; /** * Log level for test execution * @env E2E_LOG_LEVEL - One of the valid log levels defined in LOG_LEVELS * @default 'info' */ private _logLevel; /** * Private constructor that loads all settings from environment variables * Follows the Singleton pattern - use getInstance() to access */ private constructor(); /** * Returns the singleton instance of EnvironmentSettings * Creates the instance if it doesn't exist */ static getInstance(): EnvironmentSettings; /** Gets the VSCode version to use in tests */ get vscodeVersion(): string; /** @deprecated Use vscodeVersion instead */ get codeVersion(): string; /** Gets the spec files to run */ get specFiles(): string[]; /** Gets the DevHub org alias name */ get devHubAliasName(): string; /** Gets the DevHub username */ get devHubUserName(): string | undefined; /** Gets the path to Salesforce DX VSCode extensions */ get extensionPath(): string; /** Gets the path to Salesforce DX VSCode extensions (aligned with env var name) */ get extensionsFolder(): string; /** Gets the throttle factor for slowing down test execution */ get throttleFactor(): number; /** Gets the test execution start time */ get startTime(): string; /** Gets the SFDX auth URL for authentication */ get sfdxAuthUrl(): string | undefined; /** Gets the Java home directory path */ get javaHome(): string | undefined; /** Gets the path to an existing project */ get useExistingProject(): string | undefined; /** * Sets the path to an existing project * @param existingProject Path to the project directory * @throws Error if the specified path does not exist */ set useExistingProject(existingProject: string | undefined); /** Gets the workspace path where VS Code and test artifacts are stored */ get workspacePath(): string; /** Gets the test resources path (aligned with env var name) */ get testResources(): string; /** Gets the log level for test execution */ get logLevel(): LogLevel; /** Gets the Chrome driver arguments */ get chromeDriverArgs(): string | undefined; /** Gets the Chrome driver arguments (more explicit naming) */ get vscodeExtensionTesterChromeDriverArgs(): string | undefined; /** Gets the directory containing VSIX files to install */ get vsixToInstallDir(): string | undefined; }