From c419eb756b2e2105557b1d73d4d12ed38392947a Mon Sep 17 00:00:00 2001 From: Taras Yatsynych Date: Tue, 5 Dec 2023 16:28:40 +0100 Subject: [PATCH] replace credentials with env variables --- .gitignore | 3 +++ src/test/playwright/constants/general.constants.js | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 619d2bcf..217747ae 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ workspace.xml /test-results/ /playwright-report/ /playwright/.cache/ + +#.environmental variables +.env diff --git a/src/test/playwright/constants/general.constants.js b/src/test/playwright/constants/general.constants.js index 209cb6fd..a90e0382 100644 --- a/src/test/playwright/constants/general.constants.js +++ b/src/test/playwright/constants/general.constants.js @@ -1,7 +1,9 @@ -export const ADMIN_EMAIL = 'admin@gmail.com'; -export const ADMIN_PASSWORD = 'admin'; -export const USER_EMAIL = 'user@gmail.com'; -export const USER_PASSWORD = 'user'; +require('dotenv').config(); + +export const ADMIN_EMAIL = process.env.ADMIN_EMAIL; +export const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD; +export const USER_EMAIL = process.env.USER_EMAIL; +export const USER_PASSWORD = process.env.USER_PASSWORD; export const USER_ROLES = { admin: 'admin', user: 'user',