For this project, I was tasked with writing a function in JavaScript to generate a random password on a webpage. The goal was to create a passowrd using various character forms and one that would be a random sequence of those character forms.
- GIVEN I need a new, secure password, WHEN I click the button to generate a password, THEN I am presented with a series of prompts for password criteria;
- WHEN prompted for password criteria, THEN I select which criteria to include in the password;
- WHEN prompted for the length of the password, THEN I choose a length of at least 8 characters and no more than 128 characters;
- WHEN asked for character types to include in the password, THEN I confirm whether or not to include lowercase, uppercase, numeric, and/or special characters;
- WHEN I answer each prompt, THEN my input should be validated and at least one character type should be selected;
- WHEN all prompts are answered, THEN a password is generated that matches the selected criteria;
- WHEN the password is generated, THEN the password is either displayed in an alert or written to the page.
- When the Generate Password button is clicked, a series of prompts appears at the top of the webpage in the browser.
- When Prompted for all password criteria, including a length between 8 and 128 characters, the use of uppercase, lowercase, numeric, and special characters, the option to confirm all choices is presented
- When prompts are answered, the input is validated and used in generating the random password.
- When the password is generated, it matches all the above criteria and is displayed in the box on the page
- Javascript Generate Password Function written by Sier Behashti https://github.com/sbehashti
- Starter Code provided by UC Davis Coding Bootcamp