diff --git a/README.md b/README.md index 2cdff86..72b68e5 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,14 @@ Works with **WebdriverIO**, **[Nightwatch.js](./packages/nightwatch-devtools/REA > For setup, configuration options, and prerequisites see the **[service README](./packages/service/README.md#screencast-recording)**. +### ๐ Preserve & Rerun (Compare) +- **When the bug icon appears**: Only on test/suite rows in a `failed` state and the icon sits next to โถ on hover, available wherever a plain rerun is supported (e.g. Cucumber scenarios at the scenario row, Mocha tests at the test or suite row) +- **Side-by-side diff**: Click the bug-play icon on a failed test to snapshot the failing run and rerun in one action and the Compare tab shows the two runs aligned by command, with the failure point and assertion error (Expected vs Received) called out +- **Diagnose flaky tests**: See exactly which command differed between a pass and a fail without re-reading logs +- **Pop out**: Open the comparison in a separate, themed window for a roomier view + +> **Note:** Preserve & Rerun is currently supported for **WebdriverIO only**. Nightwatch.js and Selenium support is planned for a future release. + ### ๐๏ธ TestLens - **Code Intelligence**: View test definitions directly in your editor - **Run/Debug Actions**: Execute individual tests or suites with inline CodeLens actions diff --git a/packages/app/package.json b/packages/app/package.json index 9bd409a..5ab423d 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@wdio/devtools-app", - "version": "1.4.1", + "version": "1.4.2", "description": "Browser devtools extension for debugging WebdriverIO tests.", "type": "module", "repository": { diff --git a/packages/app/src/app.ts b/packages/app/src/app.ts index 1f1c190..1852322 100644 --- a/packages/app/src/app.ts +++ b/packages/app/src/app.ts @@ -6,17 +6,49 @@ import { TraceType, type TraceLog } from '@wdio/devtools-service/types' import { Element } from '@core/element' import { DataManagerController } from './controller/DataManager.js' import { DragController, Direction } from './utils/DragController.js' -import { SIDEBAR_MIN_WIDTH } from './controller/constants.js' +import { SIDEBAR_MIN_WIDTH, DARK_MODE_KEY } from './controller/constants.js' +import { POPOUT_QUERY } from './components/workbench/compare/constants.js' + +// Bootstrap the dark-mode class on
as early as possible so popout +// windows (which don't render the header) still get themed consistently +// with the main dashboard. The header still owns the toggle. +const darkModeInit = localStorage.getItem(DARK_MODE_KEY) +const isDarkMode = + typeof darkModeInit === 'string' + ? darkModeInit === 'true' + : window.matchMedia('(prefers-color-scheme: dark)').matches +if (isDarkMode) { + document.body.classList.add('dark') +} +// Cross-window sync: when the user toggles dark mode in the main dashboard, +// the storage event fires in OTHER windows (popouts) and we mirror the +// theme change there too. +window.addEventListener('storage', (e) => { + if (e.key === DARK_MODE_KEY) { + document.body.classList.toggle('dark', e.newValue === 'true') + } +}) import './components/header.js' import './components/sidebar.js' import './components/workbench.js' import './components/onboarding/start.js' +import './components/workbench/compare.js' @customElement('wdio-devtools') export class WebdriverIODevtoolsApplication extends Element { dataManager = new DataManagerController(this) + // Popout mode: when opened via the Compare tab's "โ Pop out" button the + // URL carries ?view=compare&uid=