|
| 1 | +================= |
| 2 | +Browser internals |
| 3 | +================= |
| 4 | + |
| 5 | +* **CDP** — ``selenium_cdp`` / ``playwright_cdp`` raw passthroughs. |
| 6 | +* **Storage** — ``localStorage`` / ``sessionStorage`` / ``IndexedDB`` get / |
| 7 | + set / clear via injected JS. |
| 8 | +* **Service worker / cache** — unregister / clear caches / |
| 9 | + ``Network.setBypassServiceWorker``. |
| 10 | +* **Console + network capture** — Playwright event listeners with |
| 11 | + assertions (``no console errors`` / ``no 5xx``). |
| 12 | +* **Shadow DOM** — selector chains pierce nested shadow roots. |
| 13 | +* **iframes** — switch chains and Playwright frame-locator chains. |
| 14 | +* **File upload / download** — element ``send_keys`` / ``set_input_files`` |
| 15 | + for upload; ``wait_for_download`` polls a directory for completed files. |
| 16 | +* **Browser extension loaders** — Chrome ``add_extension`` / Playwright |
| 17 | + ``--load-extension``. |
| 18 | + |
| 19 | +Browser & locale |
| 20 | +================ |
| 21 | + |
| 22 | +* ``device_emulation`` — ``available_presets`` / |
| 23 | + ``playwright_kwargs("iPhone 15 Pro")`` / |
| 24 | + ``apply_to_chrome_options(opts, "Desktop 1080p")`` / |
| 25 | + ``cdp_emulation_command(name)``. |
| 26 | +* ``geo_locale.GeoOverride`` — yields both |
| 27 | + ``cdp_payloads(override)`` and ``playwright_context_kwargs(override)``. |
| 28 | +* ``multi_tab.TabChoreographer`` — track tabs by alias; |
| 29 | + ``register_current`` / ``open_new`` / ``switch_to`` / ``with_tab`` / |
| 30 | + ``close``. |
| 31 | +* ``webauthn.enable_virtual_authenticator(driver)`` — CDP |
| 32 | + ``WebAuthn.addVirtualAuthenticator`` for passkey simulation. |
| 33 | + |
| 34 | +Storybook / shadow DOM |
| 35 | +====================== |
| 36 | + |
| 37 | +* ``storybook.discover_stories(index_or_path)`` reads Storybook 7+ |
| 38 | + ``index.json``; |
| 39 | + ``plan_actions_for_stories(stories, base_url, run_a11y=True, |
| 40 | + capture_screenshot=True, extra_per_story=...)`` builds a flat action |
| 41 | + plan that visits each story under ``iframe.html?id=...`` and runs |
| 42 | + axe / screenshot. |
| 43 | +* ``storybook.visual_snapshots.capture_story_snapshots(stories, |
| 44 | + base_url, take_screenshot, navigate, baseline_dir=...)`` — per-story |
| 45 | + PNG capture with byte-level baseline comparison. |
| 46 | +* ``dom_traversal.shadow_pierce.find_first(driver, css_selector)`` / |
| 47 | + ``find_all`` walk open shadow roots recursively. ``execute_script`` |
| 48 | + for Selenium, ``evaluate`` for Playwright; ``assert_pierced_visible`` |
| 49 | + raises if the selector doesn't match anywhere. |
| 50 | + |
| 51 | +CDP tap / cross-browser / state diff |
| 52 | +==================================== |
| 53 | + |
| 54 | +* ``cdp_tap.CdpRecorder(output_path).attach(driver)`` — wraps |
| 55 | + ``execute_cdp_cmd`` so every call is appended to an ndjson log; |
| 56 | + ``CdpReplayer(load_recording(path))`` plays the same sequence back. |
| 57 | +* ``cross_browser.diff_runs([chromium_run, firefox_run, webkit_run])`` |
| 58 | + — buckets findings into ``major`` / ``minor`` (5xx → major, |
| 59 | + screenshot hash → minor); ``assert_parity(report, only_major=True)`` |
| 60 | + is the CI gate. |
| 61 | +* ``state_diff.capture_state(driver)`` snapshots cookies + |
| 62 | + localStorage + sessionStorage; ``diff_states(before, after)`` reports |
| 63 | + added / removed / changed keys per section. |
0 commit comments