@beryl-so/cli 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/beryl-test-skill.js +8 -7
- package/dist/commands/accounts.js +16 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -332,7 +332,7 @@ Durable identities on the site under test: what an authenticated test signs in a
|
|
|
332
332
|
| --- | --- | --- |
|
|
333
333
|
| `beryl accounts list` | List the test accounts an environment's tests sign in as | `accounts_list` |
|
|
334
334
|
| `beryl accounts create` | Add a test account: the customer's own, or one Beryl signs up | `accounts_create` |
|
|
335
|
-
| `beryl accounts
|
|
335
|
+
| `beryl accounts signup <account-id>` | Store a test account's signup plan and sign it up on its environment | `accounts_signup` |
|
|
336
336
|
| `beryl accounts set-login <account-id>` | Store the sign-in plan a run replays once, plus the probe that proves it | `accounts_set_login` |
|
|
337
337
|
| `beryl accounts get-login <account-id>` | Read the stored sign-in plan, its probe, and the hash a safe write must cite | `accounts_get_login` |
|
|
338
338
|
| `beryl accounts check <account-id>` | Sign in now and prove the session survives into a fresh browser | `accounts_check` |
|
package/dist/beryl-test-skill.js
CHANGED
|
@@ -154,13 +154,14 @@ An empty \`accounts list\` means nothing is set up. In order of preference:
|
|
|
154
154
|
\`beryl accounts create --email <email> --password <password>\`. A DEDICATED test
|
|
155
155
|
account only — never a real user's.
|
|
156
156
|
2. **No credentials, but the app has a signup form** → let Beryl make one.
|
|
157
|
-
\`beryl accounts create --type beryl\`, then
|
|
158
|
-
\`beryl accounts
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
\`beryl accounts create --type beryl\`, then sign it up with
|
|
158
|
+
\`beryl accounts signup <id> --file <signup-plan.json>\`. The plan is the app's own
|
|
159
|
+
signup form as an ActionPlan, ending LOGGED IN, filling \`{{mailbox_address}}\` and
|
|
160
|
+
\`{{login_password}}\`. It stays on the account, so a new environment signs the same
|
|
161
|
+
identity up again by itself. An account that already exists on the site (hand-made,
|
|
162
|
+
or the record was lost) skips signup: store its sign-in with \`accounts set-login\`.
|
|
163
|
+
No password sign-in? Pass \`--login-method otp\` (or \`magic_link\`) and let the plan
|
|
164
|
+
\`await_email\` through; later sign-ins read the same mailbox.
|
|
164
165
|
3. **Neither** → the flow is not testable authenticated. Say so rather than guessing.
|
|
165
166
|
|
|
166
167
|
A project with no accounts falls back to the \`LOGIN_EMAIL\` variable +
|
|
@@ -63,7 +63,7 @@ export const testAccountCommands = [
|
|
|
63
63
|
description: "Two kinds. `--type user_provided` records a dedicated account you already have on " +
|
|
64
64
|
"the site: pass --email and --password, and it is usable immediately. `--type beryl` " +
|
|
65
65
|
"reserves one Beryl will sign up itself, addressed at the project mailbox. It starts " +
|
|
66
|
-
"`pending` and becomes usable after `beryl accounts
|
|
66
|
+
"`pending` and becomes usable after `beryl accounts signup`. " +
|
|
67
67
|
"The first account an environment gets is its default whatever you pass.",
|
|
68
68
|
scope: "project",
|
|
69
69
|
flags: [
|
|
@@ -111,8 +111,8 @@ export const testAccountCommands = [
|
|
|
111
111
|
is_default: flagBool(input, "default"),
|
|
112
112
|
}));
|
|
113
113
|
const next = account.status === "pending"
|
|
114
|
-
? yellow(`\nNot
|
|
115
|
-
`with a plan that ends logged in
|
|
114
|
+
? yellow(`\nNot signed up yet. Run:\n beryl accounts signup ${account.id} --file <signup-plan.json>\n` +
|
|
115
|
+
`with the app's signup form as a plan that ends logged in.`)
|
|
116
116
|
: "";
|
|
117
117
|
return {
|
|
118
118
|
data: account,
|
|
@@ -121,15 +121,15 @@ export const testAccountCommands = [
|
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
name: "accounts
|
|
125
|
-
summary: "
|
|
126
|
-
description: "Runs the
|
|
127
|
-
"The plan is an ordinary ActionPlan
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
124
|
+
name: "accounts signup",
|
|
125
|
+
summary: "Store a test account's signup plan and sign it up on its environment",
|
|
126
|
+
description: "Runs the app's signup form once in a real browser and, if it ends logged in, marks " +
|
|
127
|
+
"the account ready. The plan is an ordinary ActionPlan of the SIGNUP flow. Type " +
|
|
128
|
+
"{{mailbox_address}} into the email field and {{login_password}} into the password " +
|
|
129
|
+
"field. Both resolve at replay time, and an `await_email` step reads the project " +
|
|
130
|
+
"mailbox, so a verification code works. The plan is kept on the account, so the " +
|
|
131
|
+
"same identity can be signed up again on a new environment. For an account that " +
|
|
132
|
+
"already exists on the site, store its sign-in with `accounts set-login` instead.",
|
|
133
133
|
scope: "project",
|
|
134
134
|
args: [{ name: "account-id", description: "Account id from `beryl accounts list`", required: true }],
|
|
135
135
|
flags: [
|
|
@@ -137,20 +137,17 @@ export const testAccountCommands = [
|
|
|
137
137
|
name: "file",
|
|
138
138
|
type: "string",
|
|
139
139
|
required: true,
|
|
140
|
-
description: "ActionPlan
|
|
140
|
+
description: "The signup ActionPlan, ending logged in, as JSON (path, or - for stdin)",
|
|
141
141
|
},
|
|
142
142
|
],
|
|
143
|
-
examples: [
|
|
144
|
-
"beryl accounts provision acc_123 --file signup-plan.json",
|
|
145
|
-
"beryl accounts provision acc_123 --file signin-plan.json",
|
|
146
|
-
],
|
|
143
|
+
examples: ["beryl accounts signup acc_123 --file signup-plan.json"],
|
|
147
144
|
async run(ctx, input) {
|
|
148
145
|
const { workspaceId, projectId } = await ctx.requireProject(input);
|
|
149
|
-
const account = (await ctx.client.post(`${accountsPath(workspaceId, projectId)}/${arg(input, "account-id")}/
|
|
146
|
+
const account = (await ctx.client.post(`${accountsPath(workspaceId, projectId)}/${arg(input, "account-id")}/signup`, { plan: readJsonFlag(input, "file") }));
|
|
150
147
|
if (account.status !== "ready")
|
|
151
148
|
return {
|
|
152
149
|
data: account,
|
|
153
|
-
human: `${yellow("The
|
|
150
|
+
human: `${yellow("The signup did not get in")}: ${account.last_error ?? account.status}`,
|
|
154
151
|
exitCode: 1,
|
|
155
152
|
};
|
|
156
153
|
return {
|
package/package.json
CHANGED