From 8c58f53d4fd99fb06ed9fe47c6698c14afe77c06 Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Mon, 12 Aug 2024 11:30:08 +0800 Subject: [PATCH] sonar security hotspots --- cypress.config.js | 5 ++++- cypress/e2e/accountAdmin/accountDuplicationCheck.cy.js | 2 +- cypress/e2e/accountAdmin/confirmPasswordMessage.cy.js | 2 +- cypress/e2e/accountAdmin/createAccont.cy.js | 2 +- cypress/e2e/accountAdmin/deleteAccount.cy.js | 2 +- cypress/e2e/accountAdmin/editAccount.cy.js | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 1e0b7e6..a873102 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -8,5 +8,8 @@ module.exports = defineConfig({ e2e: { specPattern: "cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}", }, - includeShadowDom: true + includeShadowDom: true, + env: { + loginPwd: 'REDACTED-PWD', + } }); diff --git a/cypress/e2e/accountAdmin/accountDuplicationCheck.cy.js b/cypress/e2e/accountAdmin/accountDuplicationCheck.cy.js index 5f0aebf..6750738 100644 --- a/cypress/e2e/accountAdmin/accountDuplicationCheck.cy.js +++ b/cypress/e2e/accountAdmin/accountDuplicationCheck.cy.js @@ -4,7 +4,7 @@ describe('Account duplication check.', ()=>{ beforeEach(() => { cy.visit('https://REDACTED-HOST/account-admin'); const username = 'cindy'; - const password = 'REDACTED-PWD'; + const password = Cypress.env('loginPwd'); cy.visit('https://REDACTED-HOST/account-admin'); diff --git a/cypress/e2e/accountAdmin/confirmPasswordMessage.cy.js b/cypress/e2e/accountAdmin/confirmPasswordMessage.cy.js index 90a232e..23de82e 100644 --- a/cypress/e2e/accountAdmin/confirmPasswordMessage.cy.js +++ b/cypress/e2e/accountAdmin/confirmPasswordMessage.cy.js @@ -4,7 +4,7 @@ describe('Confirm that two input passwords are equal.', ()=>{ beforeEach(() => { cy.visit('https://REDACTED-HOST/account-admin'); const username = 'cindy'; - const password = 'REDACTED-PWD'; + const password = Cypress.env('loginPwd'); cy.visit('https://REDACTED-HOST/account-admin'); diff --git a/cypress/e2e/accountAdmin/createAccont.cy.js b/cypress/e2e/accountAdmin/createAccont.cy.js index dcbd95d..e1e904e 100644 --- a/cypress/e2e/accountAdmin/createAccont.cy.js +++ b/cypress/e2e/accountAdmin/createAccont.cy.js @@ -2,7 +2,7 @@ describe('Create an Account', ()=>{ beforeEach(() => { cy.visit('https://REDACTED-HOST/account-admin'); const username = 'cindy'; - const password = 'REDACTED-PWD'; + const password = Cypress.env('loginPwd'); cy.visit('https://REDACTED-HOST/account-admin'); diff --git a/cypress/e2e/accountAdmin/deleteAccount.cy.js b/cypress/e2e/accountAdmin/deleteAccount.cy.js index 38db868..3b58e51 100644 --- a/cypress/e2e/accountAdmin/deleteAccount.cy.js +++ b/cypress/e2e/accountAdmin/deleteAccount.cy.js @@ -2,7 +2,7 @@ describe('Delete an Account', ()=>{ beforeEach(() => { cy.visit('https://REDACTED-HOST/account-admin'); const username = 'cindy'; - const password = 'REDACTED-PWD'; + const password = Cypress.env('loginPwd'); cy.visit('https://REDACTED-HOST/account-admin'); diff --git a/cypress/e2e/accountAdmin/editAccount.cy.js b/cypress/e2e/accountAdmin/editAccount.cy.js index aa57554..c6c9a2e 100644 --- a/cypress/e2e/accountAdmin/editAccount.cy.js +++ b/cypress/e2e/accountAdmin/editAccount.cy.js @@ -14,7 +14,7 @@ describe('Edit an account', ()=>{ beforeEach(() => { cy.visit('https://REDACTED-HOST/account-admin'); const username = 'cindy'; - const password = 'REDACTED-PWD'; + const password = Cypress.env('loginPwd'); cy.visit('https://REDACTED-HOST/account-admin');