For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

1

Open the application

Start with Open. Point it at a page in your application.

2

Set the session data

Add the matching Data step for how your app keeps the session:

After login, the app uses
Set it with

A cookie

localStorage

sessionStorage

In the value field, type $ and pick the Value name the parent will pass, such as $auth_token.

3

Continue the journey

Add the steps that assume a signed-in user, such as opening a dashboard and checking content.

Build the parent Flow

1

Open the sign-in page

Start with Open. Point it at your login URL.

2

Complete login

Add Set value and Touch (or your usual login steps) until the session is established.

3

Store the session data

Add the matching Store step:

Source
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.

4

Start the child Flows

Add DoesQA Run from Express.

  1. Set a Run Label.

  2. Choose Flow Selection: pick the child Flows, a Run Recipe, or tag filters.

  3. 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.

Pro tip: Use Await & Match Results on DoesQA Run when the parent should fail if a child Run fails. Use Trigger Only when the parent only needs to start the children.

Last updated