Reuse a login session
Log in once, store the session, and pass it into other Flows with DoesQA Run.
Logging in on every Test Case slows a suite and can trip rate limits on the application. Log in once in a parent Flow, store the session data, then pass it into other Flows so they start already signed in.
Use the Flow Builder for this walkthrough.
To reuse the same login steps in many Flows without sharing a live session, use a Step Group instead.
What you need
A login URL and credentials as Values
At least one child Flow that should start signed in (create it before the parent calls it)
The cookie or storage key your application uses after login
Build the child Flow first
Each child Run gets a fresh browser. It must apply the session data the parent will pass in.
Open the application
Start with Open. Point it at a page in your application.
Build the parent Flow
Open the sign-in page
Start with Open. Point it at your login URL.
Store the session data
Add the matching Store step:
Set Value Store Key to a clear name, such as cookieValue. That key holds the data for this Run so DoesQA Run can pass it on.
Start the child Flows
Add DoesQA Run from Express.
Set a Run Label.
Choose Flow Selection: pick the child Flows, a Run Recipe, or tag filters.
In Values, map the stored key into the name the child expects:
{{cookieValue}} pulls the parent’s stored key. The child then reads $auth_token in its Set step.
Related
Last updated