How to Store Sensitive Data Like Username and Password For a Cypress Test
Last updated
Was this helpful?
Last updated
Was this helpful?
Let's say you want to test the login for an application. Here's how you'd go about storing username and password in Testery.
Navigate to Environments Tab
Add a new environment (if you don't have one)
Add a variable for your sensitive data like password
Enter name of variable (i.e. password) as CYPRESS_password and its value. For Cypress, you'll be able to access the value using Cypress.env('password') in your code (omitting the CYPRESS_ prefix)
Click on "encrypt" checkbox (screenshot below)
Save