Quickly Create A User And Log in Using Dependent Data Sessions

Published: 05 October 2021
on channel: gleb bahmutov
670
12

Let's say you need to create a user and log in. Do you recreate the user before each test? No, you use cy.dataSession from the cypress-data-session plugin to only create the user if needed. How do you log in? You use another cy.dataSession to execute the commands, and cache the session cookie. And the final step: if the user data session is invalidated, and the user is recreated, then the cookie data session is automatically invalidated using the "dependsOn" parameter linking the second data session to the first one. See the full source code in https://github.com/bahmutov/chat.io


Watch video Quickly Create A User And Log in Using Dependent Data Sessions online, duration hours minute second in high quality that is uploaded to the channel gleb bahmutov 05 October 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 670 times and liked it 12 visitors.