lib-e2e-cypress-for-dummys-ts 0.2.0 → 0.3.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 CHANGED
@@ -89,10 +89,15 @@ import 'lib-e2e-cypress-for-dummys-ts/dist/index.js';
89
89
  ```html
90
90
  <!-- Only render in non-production environments -->
91
91
  @if (!isProduction) {
92
- <lib-e2e-recorder></lib-e2e-recorder>
92
+ <!-- start-hidden: widget is invisible on load; press Ctrl+Shift+E to reveal it -->
93
+ <lib-e2e-recorder start-hidden></lib-e2e-recorder>
93
94
  }
94
95
  ```
95
96
 
97
+ > The included **example project** (`ejemplo/`) uses `start-hidden` so the floating button does not interfere with the app UI during development. Remove the attribute if you prefer the widget to be visible immediately.
98
+ >
99
+ > The `start-hidden` attribute **overrides** the value stored in the settings panel. See [Start hidden](#start-hidden-invisible-mode) for the full precedence rules.
100
+
96
101
  **4. Control it programmatically** (optional):
97
102
 
98
103
  ```typescript
@@ -294,12 +299,86 @@ The last **5 recordings** are automatically saved to `localStorage` so you never
294
299
 
295
300
  | Shortcut | Action |
296
301
  |---|---|
302
+ | `Ctrl + Shift + E` | **Show / hide the widget** (works even when it is invisible) |
297
303
  | `Ctrl + R` | Start / stop recording |
298
304
  | `Ctrl + P` | Pause / resume recording |
299
305
  | `Ctrl + 1` | Open saved tests panel |
300
306
  | `Ctrl + 2` | Open command previewer |
301
307
  | `Ctrl + 3` | Open settings |
302
308
 
309
+ > `Ctrl + R` / `Ctrl + P` and the panel shortcuts only fire when the widget is **visible**. `Ctrl + Shift + E` always works regardless of visibility state.
310
+
311
+ ---
312
+
313
+ ### Invisible mode — record in production, stay hidden from users
314
+
315
+ Most test recorders force you to choose: use them in a safe dev environment, or ship to real users and lose the tool. **Not this one.**
316
+
317
+ With `start-hidden`, you can deploy the recorder to **any environment — including production** — and it stays completely invisible to your users. No floating button, no visual clutter, no accidental clicks. When *you* need to record a test against the real app, with real data, real API responses, and real edge cases that are impossible to reproduce locally, just press the secret shortcut and the widget appears. Record, save, hide. Nobody saw a thing.
318
+
319
+ ```
320
+ Ctrl + Shift + E → show / hide the widget (works even when invisible)
321
+ ```
322
+
323
+ This means you can:
324
+ - **Record against production data** — capture flows that only happen with real users and real back-ends.
325
+ - **Debug flaky tests in the wild** — reproduce the exact sequence of events that broke your CI pipeline.
326
+ - **Onboard QA teams without a local setup** — testers open the live app, hit the shortcut, and record directly.
327
+ - **Keep staging clean** — no visible dev tooling leaked to clients or stakeholders reviewing the environment.
328
+
329
+ #### Option A — HTML attribute (deploy-time, recommended)
330
+
331
+ Add `start-hidden` to the element. This takes **precedence over the settings panel** and is the right choice for environment-level control:
332
+
333
+ ```html
334
+ <!-- Production / staging: invisible by default -->
335
+ <lib-e2e-recorder start-hidden></lib-e2e-recorder>
336
+
337
+ <!-- Dev: always visible (or omit the attribute entirely) -->
338
+ <lib-e2e-recorder start-hidden="false"></lib-e2e-recorder>
339
+ ```
340
+
341
+ Works in every framework:
342
+
343
+ ```html
344
+ <!-- Angular -->
345
+ <lib-e2e-recorder start-hidden></lib-e2e-recorder>
346
+
347
+ <!-- React (JSX) -->
348
+ <lib-e2e-recorder start-hidden="true" />
349
+
350
+ <!-- Vue -->
351
+ <lib-e2e-recorder start-hidden />
352
+ ```
353
+
354
+ A typical Angular setup driven by an environment variable:
355
+
356
+ ```typescript
357
+ // app.component.ts
358
+ get startHidden(): boolean {
359
+ return environment.production; // invisible in prod, visible in dev
360
+ }
361
+ ```
362
+
363
+ ```html
364
+ <!-- app.component.html -->
365
+ <lib-e2e-recorder [attr.start-hidden]="startHidden ? '' : null"></lib-e2e-recorder>
366
+ ```
367
+
368
+ #### Option B — Settings panel (runtime, per user)
369
+
370
+ Enable **⚙️ Config → 👁 Widget visibility → Start hidden**. The preference is stored in IndexedDB and persists across sessions. Useful when individual team members want to tailor the behaviour without a redeployment.
371
+
372
+ ---
373
+
374
+ **Either way, when the widget is hidden:**
375
+ - Zero DOM rendered, zero event listeners added beyond the keyboard shortcut — it is truly invisible and inert.
376
+ - Your Cypress selectors are never blocked by a floating element.
377
+ - Press **`Ctrl + Shift + E`** to reveal it instantly, no page reload needed.
378
+ - Hide it again with the same shortcut when you are done.
379
+
380
+ > **Running under Cypress?** The widget auto-disables itself when `window.Cypress` is detected — it does not render at all, regardless of the `start-hidden` attribute or the settings panel value. No extra setup, no `beforeEach` cleanup, no risk of the widget covering a selector mid-test.
381
+
303
382
  ---
304
383
 
305
384
  ### Import / Export