Repository navigation
Commit 289556e
committed
test(branch): log in with EMAIL/PASSWORD and manage own environments in BranchAPITest
BranchAPITest used TestClient.getStack(), which sends the management token.
Branch create answered 401 (error 161) with it, and the test assumed the
'development' and 'production' environments exist on the stack.
The class now:
- logs in with EMAIL / PASSWORD and uses the apiKey header only;
- creates two environments whose names are unique to the run, and deletes
them, with every created branch (force=true), and logs out in @afterall;
- polls fetch until a created branch is ready (bounded, 60s, 2s steps);
- treats a rejected create as no branch when fetch answers 422 with
error_code 905, the same answer as a missing branch;
- adds TC-23 (create without publish_config) and TC-24 (environment name in
a different case gets 422).
Without EMAIL, PASSWORD or apiKey in .env the class is skipped with a
"not run" message. TestClient gains public EMAIL and PASSWORD constants and
isApiKeyConfigured().
Refs: DX-31579
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ef6P4M5YRs6tDbdFqkvmZc1 parent 01ea18f commit 289556e
2 files changed
Lines changed: 281 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
| |||
0 commit comments