Abstracting password from user details to be env

This commit is contained in:
Kira 2023-09-18 11:43:15 -07:00
parent d70effc7a4
commit 5aedbc8e2c
5 changed files with 16 additions and 2 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
.env

View File

@ -1,4 +1,5 @@
export const adminDetails = {
username: "kira",
password: "secret"
}
password: process.env.ADMIN_PASSWORD
}

9
package-lock.json generated
View File

@ -9,6 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"dotenv": "^16.0.3",
"node-fetch": "^2.6.7",
"uuid": "^9.0.0"
},
@ -41,6 +42,14 @@
"integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==",
"dev": true
},
"node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",

View File

@ -13,6 +13,7 @@
"@playwright/test": "^1.37.1"
},
"dependencies": {
"dotenv": "^16.0.3",
"node-fetch": "^2.6.7",
"uuid": "^9.0.0"
}

View File

@ -1,3 +1,5 @@
import * as dotenv from "dotenv"
dotenv.config()
import { test } from "@playwright/test"
import { MyAccountPage } from "../page-objects/MyAccountPage.js"