diff --git a/.gitignore b/.gitignore index 0934f3cff0..17e28e6066 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ playwright-report /packages/*/NOTICE /packages/playwright/README.md /packages/playwright-core/api.json +.env diff --git a/package-lock.json b/package-lock.json index 206d9b1132..01f7ea85c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,7 @@ "copy-webpack-plugin": "^9.1.0", "cross-env": "^7.0.3", "css-loader": "^6.5.1", + "dotenv": "^16.0.0", "electron": "^12.2.1", "enquirer": "^2.3.6", "eslint": "^8.8.0", @@ -3016,6 +3017,15 @@ "tslib": "^2.0.3" } }, + "node_modules/dotenv": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -9783,6 +9793,12 @@ "tslib": "^2.0.3" } }, + "dotenv": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "dev": true + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", diff --git a/package.json b/package.json index b8cf413501..2f2113a995 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "copy-webpack-plugin": "^9.1.0", "cross-env": "^7.0.3", "css-loader": "^6.5.1", + "dotenv": "^16.0.0", "electron": "^12.2.1", "enquirer": "^2.3.6", "eslint": "^8.8.0", diff --git a/tests/config/android.config.ts b/tests/config/android.config.ts index 0f693a0eba..f7b3108fb0 100644 --- a/tests/config/android.config.ts +++ b/tests/config/android.config.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { config as loadEnv } from 'dotenv'; +loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); + import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test'; import * as path from 'path'; import { ServerWorkerOptions } from './serverFixtures'; diff --git a/tests/config/default.playwright.config.ts b/tests/config/default.playwright.config.ts index effee40413..3d8bbf79a0 100644 --- a/tests/config/default.playwright.config.ts +++ b/tests/config/default.playwright.config.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { config as loadEnv } from 'dotenv'; +loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); + import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test'; import * as path from 'path'; import { TestModeWorkerOptions } from './testModeFixtures'; diff --git a/tests/config/electron.config.ts b/tests/config/electron.config.ts index a10450fe85..335286556e 100644 --- a/tests/config/electron.config.ts +++ b/tests/config/electron.config.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { config as loadEnv } from 'dotenv'; +loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); + import type { Config, PlaywrightTestOptions, PlaywrightWorkerOptions } from '@playwright/test'; import * as path from 'path'; import { CoverageWorkerOptions } from './coverageFixtures'; diff --git a/tests/playwright-test/playwright-test.config.ts b/tests/playwright-test/playwright-test.config.ts index 4580180836..a7438cf8cf 100644 --- a/tests/playwright-test/playwright-test.config.ts +++ b/tests/playwright-test/playwright-test.config.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { config as loadEnv } from 'dotenv'; +loadEnv({ path: path.join(__dirname, '..', '..', '.env') }); + import { Config } from './stable-test-runner'; import * as path from 'path';