When writing UI tests its often useful to reset the browser to a clean state. Cypress has commands for clearing cookies cy.clearCookies(), and also resetting local storage, cy.clearLocalStorage(). However there isn't a command for clearing session storage. Add a custom cypress command more info. Add to cypress/support/commands.js (or .ts if typescript)
Then in cypress/support/index.js (or .ts if typescript)
Then our final finished function is
1 Comment
Cole
8/23/2021 12:14:06 pm
Very interesting
Reply
Leave a Reply. |