Trying to work out how much of our suite time is logging in. We have thirty-odd UI scenarios tagged @user:standard, plus somebody recording a flow most mornings. Do those all log in independently, or is there a single cached thing they share?
Does every scenario log in separately, or is there one place the login state comes from?
3 answers
Accepted answer
To put numbers on it: one login per pool user per environment, not one per scenario.
textprojects/demo-shop/.auth/staging/standard-0.json projects/demo-shop/.auth/staging/standard-1.jsonA scenario tagged
@user:standardleases a user, the fixture checks whether that user's file is fresh, logs in once in a throwaway context if it is not, and starts the browser context from the state. Thirty scenarios sharing one leased user share one login. The index in the filename is the position within the role.Prime it yourself if you would rather pay up front and see the cost:
bashsdods auth capture -p demo-shop -e staging -u standard --all sdods auth list -p demo-shop -e stagingOne thing to be aware of rather than to work around: there are two code paths producing these files today —
sdods auth capture, which works from dataset rows, and the librarycaptureAuth()thatsdods record --usercalls. They write the same files to the same place, so nothing is broken, but they are two implementations of one idea. Consolidation is scheduled and it has not happened, so if you go reading the source do not expect one path. It is written down under known limitations.answered by Reeta Nandalmaintainer41,280 ·Shared. One file per pool user per environment, and both the runner and the recorder read the same file — that is why
sdods record --user standardopens signed in without you doing anything.answered by Thom Vasseur5,470 ·Adding the boring operational half:
.auth/is gitignored and should stay that way. Those files are live sessions — anyone who gets one is signed in as that user until it expires.If you want a teammate to be able to record without hunting for credentials, the answer is to give them the pool dataset and let capture do its thing, not to hand them a state file. Passwords in the dataset reference environment variables, never literals.
Auth strategies and storage state has the table of which strategy produces state how.
answered by Gio Castellano521 ·
Have the same question?
Ask it with the command you ran and the output you got, and it will be answered here.
Ask a questionRelated
- Linting only the staged feature files in a pre-commit hook — is --json stable enough?0 answers
- Does colorScheme from the env use: block reach a recording, or only the runner?0 answers
- har record printed no scrub line and the Cookie header is still sitting in the file0 answers
- Locator fragility table is empty in insights but heal report has plenty of rows0 answers
- Audit wants proof the agents cannot write to our repo — what do I actually show them?2 answers