@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/dist/browser.d.ts +21 -8
- package/dist/browser.js +78 -36
- package/dist/components/apple.d.ts +47 -0
- package/dist/components/apple.js +59 -0
- package/dist/components/emulate/service.d.ts +126 -0
- package/dist/components/emulate/service.js +153 -0
- package/dist/components/github.d.ts +52 -0
- package/dist/components/github.js +90 -0
- package/dist/components/google.d.ts +57 -0
- package/dist/components/google.js +92 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +5 -0
- package/dist/components/microsoft.d.ts +55 -0
- package/dist/components/microsoft.js +76 -0
- package/dist/components/okta.d.ts +51 -0
- package/dist/components/okta.js +78 -0
- package/dist/daemon.js +76 -46
- package/dist/index.d.ts +55 -13
- package/dist/mobile.d.ts +9 -5
- package/dist/mobile.js +7 -6
- package/dist/recorder.d.ts +10 -0
- package/package.json +1 -1
- package/src/browser.ts +88 -33
- package/src/components/apple.ts +65 -0
- package/src/components/emulate/entry.mjs +244 -0
- package/src/components/emulate/service.ts +235 -0
- package/src/components/github.ts +96 -0
- package/src/components/google.ts +104 -0
- package/src/components/index.ts +14 -0
- package/src/components/microsoft.ts +89 -0
- package/src/components/okta.ts +93 -0
- package/src/daemon.ts +87 -39
- package/src/index.ts +55 -13
- package/src/mobile.ts +10 -5
- package/src/recorder.ts +10 -0
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
|
|
104
|
-
* per-test rrweb recorder; the resulting
|
|
105
|
-
* the dashboard renders a phone bezel.
|
|
106
|
-
* `mobile.close()` destroys the session for
|
|
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,
|