@specific.dev/spectest 0.41.0 → 0.44.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/src/mobile.ts CHANGED
@@ -99,14 +99,18 @@ export async function openMobile(opts: {
99
99
  }
100
100
 
101
101
  /**
102
- * Acquire the persistent phone-emulated session for an app (one per app URL,
103
- * created on first use). The daemon calls this from `ctx.mobile(app)` with a
104
- * per-test rrweb recorder; the resulting record carries `frame: "mobile"` so
105
- * the dashboard renders a phone bezel. `detach` is the test-end hook;
106
- * `mobile.close()` destroys the session for real.
102
+ * Acquire the persistent phone-emulated session for an app (one per app URL
103
+ * per `name`, created on first use). The daemon calls this from
104
+ * `ctx.mobile(app, name?)` with a per-test rrweb recorder; the resulting
105
+ * record carries `frame: "mobile"` so the dashboard renders a phone bezel.
106
+ * `detach` is the test-end hook; `mobile.close()` destroys the session for
107
+ * real.
107
108
  */
108
109
  export async function openPersistentMobile(opts: {
109
110
  url: string;
111
+ /** Session name — `""` (the default) is the unnamed session every
112
+ * `ctx.mobile(app)` call shares. Two names on one app are two phones. */
113
+ name?: string;
110
114
  recorder: BrowserSessionRecorder | null;
111
115
  /** Installed before the fresh session's first navigation (ignored on an
112
116
  * attached session, which already carries it on the forked holder). */
@@ -121,6 +125,7 @@ export async function openPersistentMobile(opts: {
121
125
  }> {
122
126
  const { browser, attached, detach } = await acquirePersistentMobileBackend(
123
127
  opts.url,
128
+ opts.name ?? "",
124
129
  opts.recorder,
125
130
  opts.initScript,
126
131
  );
package/src/recorder.ts CHANGED
@@ -429,6 +429,16 @@ export interface BrowserEvent extends BaseEvent {
429
429
  * with a `BrowserSessionRecorder` attached (the daemon always does).
430
430
  */
431
431
  sessionId?: string;
432
+ /**
433
+ * Author-given name of that session — `ctx.browser("alice")` — absent
434
+ * for the default unnamed browser, so a single-browser test's steps
435
+ * carry no name and render exactly as they always have. Present, it is
436
+ * what the step list badges to say which browser acted. Duplicated here
437
+ * rather than resolved from the session record because the CLI's
438
+ * failure detail renders from persisted events alone, with no replay
439
+ * bundle to look the session up in.
440
+ */
441
+ sessionName?: string;
432
442
  /**
433
443
  * Wall-clock `Date.now()` captured at the moment this op *finished*.
434
444
  * Lives in the same time base as rrweb's `event.timestamp` fields,