@velaro/cli 1.4.238 → 1.4.239

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.
@@ -86,6 +86,18 @@ async function loadPlaywright() {
86
86
  }
87
87
  }
88
88
 
89
+ // The SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile (at most 3 hops).
90
+ async function chooseSignedInAccount(page) {
91
+ for (let i = 0; i < 3; i++) {
92
+ if (!/login\.velaro\.com/.test(page.url())) break;
93
+ const tile = page.getByText('Signed in', { exact: true }).first();
94
+ if (!(await tile.isVisible().catch(() => false))) break;
95
+ await tile.click();
96
+ await page.waitForURL((u) => !/login\.velaro\.com/.test(u.toString()), { timeout: 30_000 }).catch(() => {});
97
+ await page.waitForLoadState('networkidle', { timeout: 15_000 }).catch(() => {});
98
+ }
99
+ }
100
+
89
101
  /**
90
102
  * Logs into the given app on staging using the same form-fill steps as
91
103
  * e2e/tests/auth.setup.ts, navigates to `route`, optionally clicks a selector,
@@ -186,7 +198,7 @@ export async function loginAndScreenshot(app, route, outputPath, opts = {}) {
186
198
 
187
199
  // Handle "Stay signed in?" prompt — not always shown.
188
200
  try {
189
- await page.getByRole('button', { name: /yes|no|stay signed in/i }).first().click({ timeout: 5_000 });
201
+ await page.getByRole('button', { name: 'Yes', exact: true }).click({ timeout: 15_000 });
190
202
  } catch { /* prompt not shown — proceed */ }
191
203
 
192
204
  await page.waitForURL(/velaro\.com/, { timeout: 30_000 });
@@ -200,6 +212,30 @@ export async function loginAndScreenshot(app, route, outputPath, opts = {}) {
200
212
  // capture just because the network never goes fully idle.
201
213
  });
202
214
 
215
+ // The SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile.
216
+ await chooseSignedInAccount(page);
217
+
218
+ // The HTML splash and the app's own loading screen both look "idle" to networkidle;
219
+ // a capture taken then is a picture of the loading screen (seen 2026-11-03 on usage page).
220
+ await page.waitForSelector('#app-splash', { state: 'detached', timeout: 30_000 }).catch(() => {});
221
+ await page.waitForFunction(
222
+ () => !/preparing your workspace|before reacting|loading/i.test(document.body.innerText.slice(0, 400)) && document.querySelectorAll('nav, aside, main').length > 0,
223
+ undefined,
224
+ { timeout: 30_000 }
225
+ ).catch(() => {});
226
+ await page.waitForSelector('.vw-lockup', { state: 'detached', timeout: 60_000 }).catch(() => {});
227
+ await page.waitForTimeout(3000);
228
+
229
+ // Again after the app settles: the SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile.
230
+ await chooseSignedInAccount(page);
231
+
232
+ await page.waitForFunction(
233
+ () => !/preparing your workspace|before reacting|loading/i.test(document.body.innerText.slice(0, 400)),
234
+ undefined,
235
+ { timeout: 30_000 }
236
+ ).catch(() => {});
237
+ await page.waitForTimeout(1500);
238
+
203
239
  let captureTarget = page;
204
240
 
205
241
  if (opts.click) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.238",
3
+ "version": "1.4.239",
4
4
  "description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
5
5
  "type": "module",
6
6
  "bin": {