@@ -14,7 +14,7 @@ top, letting you see exactly what was tested and how.
1414- ** Custom highlight & badge colors:** Easily change the highlight and badge colors used in the iframe for different
1515 action types or UI states. Great for tailoring the report to your team's visual style or accessibility needs.
1616- ** No framework lock-in:** Works with any UI testing framework (Playwright, Selenium, etc.) by simply logging actions
17- via the ` track_coverage ()` method.
17+ via the ` trackCoverage ()` method.
1818- ** Element-level statistics:** View detailed statistics by selector: type of action, count of actions, and a timeline
1919 graph of coverage.
2020- ** Global history overview:** Track historical trends of total coverage and action types across time.
@@ -81,20 +81,20 @@ If you have any questions or need assistance, feel free to ask [@Nikita Filonov]
8181
8282There are two separate tools, each with its own purpose, strengths, and philosophy:
8383
84- 🟢 [ ui-coverage-tool] ( https://github.com/Nikita-Filonov/ui-coverage-tool ) — Simple & Instant Coverage
84+ 🟢 [ ui-coverage-tool-js ] ( https://github.com/Nikita-Filonov/ui-coverage-tool-js ) — Simple & Instant Coverage
8585This is the original tool. It’s designed to be:
8686
8787- ** Extremely simple and fast to integrate**
8888- ** Ideal for quick visibility** into which elements your UI tests are interacting with
8989- ** Perfect for prototyping or smoke-checks** , where deep scenario structure isn’t needed
9090
91- Think of [ ui-coverage-tool] ( https://github.com/Nikita-Filonov/ui-coverage-tool ) as the lightweight, no-frills solution
92- for getting instant test coverage insights with minimal setup.
91+ Think of [ ui-coverage-tool-js ] ( https://github.com/Nikita-Filonov/ui-coverage-tool-js ) as the lightweight, no-frills
92+ solution for getting instant test coverage insights with minimal setup.
9393
94- 🔵 [ ui-coverage-scenario-tool] ( https://github.com/Nikita-Filonov/ui-coverage-scenario-tool ) — Scenario-Based & Insightful
95- This is the advanced version of the original tool, built on top of all its features — and more:
94+ 🔵 [ ui-coverage-scenario-tool-js ] ( https://github.com/Nikita-Filonov/ui-coverage-scenario-tool-js ) — Scenario-Based &
95+ Insightful This is the advanced version of the original tool, built on top of all its features — and more:
9696
97- - Includes everything from ` ui-coverage-tool `
97+ - Includes everything from ` ui-coverage-tool-js `
9898- Adds ** scenario-level structure** , so your coverage report shows:
9999 - Which ** scenarios** were executed
100100 - Which ** elements** were used in each scenario
@@ -110,14 +110,14 @@ coverage, [ui-coverage-scenario-tool](https://github.com/Nikita-Filonov/ui-cover
110110
111111## Why Two Tools?
112112
113- While ` ui-coverage-scenario-tool ` is more powerful, the original ` ui-coverage-tool ` still has a place.
113+ While ` ui-coverage-scenario-tool-js ` is more powerful, the original ` ui-coverage-tool-js ` still has a place.
114114
115115They serve different purposes:
116116
117- | Tool | Best For | Strengths |
118- | -----------------------------| -----------------------------------------------| -----------------------------------------------|
119- | ` ui-coverage-tool ` | Quick setup, lightweight testing environments | Easy to integrate, minimal overhead |
120- | ` ui-coverage-scenario-tool ` | Structured E2E scenarios, business test cases | Rich detail, scenario linkage, deeper insight |
117+ | Tool | Best For | Strengths |
118+ | -------------------------------- | -----------------------------------------------| -----------------------------------------------|
119+ | ` ui-coverage-tool-js ` | Quick setup, lightweight testing environments | Easy to integrate, minimal overhead |
120+ | ` ui-coverage-scenario-tool-js ` | Structured E2E scenarios, business test cases | Rich detail, scenario linkage, deeper insight |
121121
122122Keeping them separate allows users to choose based on ** project needs** , ** team maturity** , and ** desired complexity** .
123123
@@ -151,8 +151,9 @@ That’s it. No other setup required. Without this script, the coverage report w
151151
152152## Usage
153153
154- Below are examples of how to use the tool with two popular UI automation frameworks: ` Playwright ` and ` Selenium ` . In
155- both cases, coverage data is automatically saved to the ` ./coverage-results ` folder after each call to ` track_coverage ` .
154+ Below are examples of how to use the tool with popular UI automation
155+ frameworks: ` Playwright ` , ` Puppeteer ` , ` Selenium ` . In both cases, coverage data is automatically saved to
156+ the ` ./coverage-results ` folder after each call to ` await tracker.trackCoverage(...) ` .
156157
157158### Playwright
158159
@@ -174,6 +175,11 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
174175
175176 await page .goto (' https://my-ui-app.com/login' );
176177
178+ // Start a new scenario with metadata:
179+ // - url: a link to the test case in TMS or documentation
180+ // - name: a descriptive scenario name
181+ tracker .startScenario ({ url: ' http://tms.com/test-cases/1' , name: ' Successful login' });
182+
177183 const usernameInput = page .locator (' #username-input' );
178184 await usernameInput .fill (' user@example.com' );
179185
@@ -194,24 +200,28 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
194200 actionType: ActionType .CLICK
195201 });
196202
203+ // End the current scenario.
204+ // This finalizes and saves the coverage data for this test case.
205+ await tracker .endScenario ();
206+
197207 await browser .close ();
198208})();
199209
200210```
201211
202212Quick summary:
203213
204- - Call ` tracker.start_scenario( ) ` to begin a new scenario.
205- - Use ` tracker.track_coverage( ) ` after each user interaction.
214+ - Call ` tracker.startScenario(... ) ` to begin a new scenario.
215+ - Use ` await tracker.trackCoverage(... )` after each user interaction.
206216- Provide the selector, action type, and selector type.
207217- The tool automatically stores tracking data as JSON files.
208- - Once the scenario is complete, call ` tracker.end_scenario () ` to finalize and save it.
218+ - Once the scenario is complete, call ` await tracker.endScenario ()` to finalize and save it.
209219
210220### Puppeteer
211221
212222``` typescript
213223import puppeteer from ' puppeteer' ;
214- import { ActionType , SelectorType , UICoverageTracker } from ' ui-coverage-tool-js' ;
224+ import { ActionType , SelectorType , UICoverageTracker } from ' ui-coverage-scenario- tool-js' ;
215225
216226const tracker = new UICoverageTracker ({ app: ' my-ui-app' });
217227
@@ -221,6 +231,8 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
221231
222232 await page .goto (' https://my-ui-app.com/login' );
223233
234+ tracker .startScenario ({ url: ' http://tms.com/test-cases/1' , name: ' Successful login' });
235+
224236 await page .type (' #username-input' , ' user@example.com' );
225237 await tracker .trackCoverage ({
226238 selector: ' #username-input' ,
@@ -238,6 +250,7 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
238250 });
239251 }
240252
253+ await tracker .endScenario ();
241254 await browser .close ();
242255})();
243256```
@@ -246,7 +259,7 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
246259
247260``` typescript
248261import { Builder , By } from ' selenium-webdriver' ;
249- import { ActionType , SelectorType , UICoverageTracker } from ' ui-coverage-tool-js' ;
262+ import { ActionType , SelectorType , UICoverageTracker } from ' ui-coverage-scenario- tool-js' ;
250263
251264const tracker = new UICoverageTracker ({ app: ' my-ui-app' });
252265
@@ -256,6 +269,8 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
256269 try {
257270 await driver .get (' https://my-ui-app.com/login' );
258271
272+ tracker .startScenario ({ url: ' http://tms.com/test-cases/1' , name: ' Successful login' });
273+
259274 const usernameInput = await driver .findElement (By .css (' #username-input' ));
260275 await usernameInput .sendKeys (' user@example.com' );
261276
@@ -275,6 +290,7 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
275290 });
276291
277292 } finally {
293+ await tracker .endScenario ();
278294 await driver .quit ();
279295 }
280296})();
@@ -283,7 +299,7 @@ const tracker = new UICoverageTracker({ app: 'my-ui-app' });
283299
284300### Coverage Report Generation
285301
286- After every call to ` tracker.track_coverage (...) ` , the tool automatically stores coverage data in
302+ After every call to ` await tracker.trackCoverage (...)` , the tool automatically stores coverage data in
287303the ` ./coverage-results/ ` directory as JSON files. You don’t need to manually manage the folder — it’s created and
288304populated automatically.
289305
@@ -294,9 +310,9 @@ populated automatically.
294310 └── ...
295311```
296312
297- When you call ` tracker.start_scenario (...) ` , a new scenario automatically begins. All subsequent actions, such as
298- ` tracker.track_coverage (...) ` , will be logged within the context of this scenario. To finalize and save the scenario,
299- you need to call ` tracker.end_scenario () ` . This method ends the scenario and saves it to a JSON file.
313+ When you call ` tracker.startScenario (...) ` , a new scenario automatically begins. All subsequent actions, such as
314+ ` await tracker.trackCoverage (...)` , will be logged within the context of this scenario. To finalize and save the
315+ scenario, you need to call ` await tracker.endScenario ()` . This method ends the scenario and saves it to a JSON file.
300316
301317```
302318./coverage-results/
@@ -309,7 +325,7 @@ Once your tests are complete and coverage data has been collected, generate a fi
309325command:
310326
311327``` shell
312- ui-coverage-scenario-tool save-report
328+ npx ui-coverage-scenario-tool save-report
313329```
314330
315331This will generate:
@@ -323,34 +339,34 @@ This will generate:
323339 - Sending metrics to external systems
324340 - Custom integrations or dashboards
325341
326- ** Important!** The ` ui-coverage-scenario-tool save-report ` command must be run from the ** root of your project** , where
327- your config files (` .env ` , ` ui_coverage_scenario_config. yaml` , etc.) are located. Running it from another directory may
328- result in missing data or an empty report.
342+ ** Important!** The ` npx ui-coverage-scenario-tool save-report` command must be run from the ** root of your project** ,
343+ where your config files (` .env ` , ` ui-coverage-scenario.config. yaml` , etc.) are located. Running it from another
344+ directory may result in missing data or an empty report.
329345
330346## Configuration
331347
332348You can configure the UI Coverage Tool using a single file: either a YAML, JSON, or ` .env ` file. By default, the
333349tool looks for configuration in:
334350
335- - ` ui_coverage_scenario_config .yaml`
336- - ` ui_coverage_scenario_config .json`
351+ - ` ui-coverage-scenario.config .yaml`
352+ - ` ui-coverage-scenario.config .json`
337353- ` .env ` (for environment variable configuration)
338354
339355All paths are relative to the current working directory, and configuration is automatically loaded
340- via [ get_settings ()] ( ui_coverage_scenario_tool/ config.py ) .
356+ via [ getSettings ()] ( ./src/ config/core.ts ) .
341357
342358** Important!** Files must be in the project root.
343359
344360### Configuration via ` .env `
345361
346362All settings can be declared using environment variables. Nested fields use dot notation, and all variables must be
347- prefixed with ` UI_COVERAGE_ ` .
363+ prefixed with ` UI_COVERAGE_SCENARIO_ ` .
348364
349365** Example:** [ .env] ( docs/configs/.env.example )
350366
351367``` dotenv
352368# Define the applications that should be tracked. In the case of multiple apps, they can be added in a comma-separated list.
353- UI_COVERAGE_APPS ='[
369+ UI_COVERAGE_SCENARIO_APPS ='[
354370 {
355371 "key": "my-ui-app",
356372 "url": "https://my-ui-app.com/login",
@@ -361,22 +377,22 @@ UI_COVERAGE_APPS='[
361377]'
362378
363379# The directory where the coverage results will be saved.
364- UI_COVERAGE_RESULTS_DIR ="./coverage-results"
380+ UI_COVERAGE_SCENARIO_RESULTS_DIR ="./coverage-results"
365381
366382# The file that stores the history of coverage results.
367- UI_COVERAGE_HISTORY_FILE ="./coverage-history.json"
383+ UI_COVERAGE_SCENARIO_HISTORY_FILE ="./coverage-history.json"
368384
369385# The retention limit for the coverage history. It controls how many historical results to keep.
370- UI_COVERAGE_HISTORY_RETENTION_LIMIT =30
386+ UI_COVERAGE_SCENARIO_HISTORY_RETENTION_LIMIT =30
371387
372388# Optional file paths for the HTML and JSON reports.
373- UI_COVERAGE_HTML_REPORT_FILE ="./index.html"
374- UI_COVERAGE_JSON_REPORT_FILE ="./coverage-report.json"
389+ UI_COVERAGE_SCENARIO_HTML_REPORT_FILE ="./index.html"
390+ UI_COVERAGE_SCENARIO_JSON_REPORT_FILE ="./coverage-report.json"
375391```
376392
377393### Configuration via YAML
378394
379- ** Example:** [ ui_coverage_scenario_config. yaml] ( docs/configs/ui_coverage_scenario_config .yaml )
395+ ** Example:** [ ui-coverage-scenario.config. yaml] ( docs/configs/ui-coverage-scenario.config .yaml )
380396
381397``` yaml
382398apps :
@@ -386,20 +402,20 @@ apps:
386402 tags : [ "UI", "PRODUCTION" ]
387403 repository : " https://github.com/my-ui-app"
388404
389- results_dir : " ./coverage-results"
390- history_file : " ./coverage-history.json"
391- history_retention_limit : 30
392- html_report_file : " ./index.html"
393- json_report_file : " ./coverage-report.json"
405+ resultsDir : " ./coverage-results"
406+ historyFile : " ./coverage-history.json"
407+ historyRetentionLimit : 30
408+ htmlReportFile : " ./index.html"
409+ jsonReportFile : " ./coverage-report.json"
394410` ` `
395411
396412### Configuration via JSON
397413
398- **Example:** [ui_coverage_scenario_config. json](docs/configs/ui_coverage_scenario_config .json)
414+ **Example:** [ui-coverage-scenario.config. json](docs/configs/ui-coverage-scenario.config .json)
399415
400416` ` ` json
401417{
402- " services " : [
418+ " apps " : [
403419 {
404420 " key " : " my-ui-app" ,
405421 " url " : " https://my-ui-app.com/login" ,
@@ -411,29 +427,29 @@ json_report_file: "./coverage-report.json"
411427 " repository " : " https://github.com/my-ui-app"
412428 }
413429 ],
414- " results_dir " : " ./coverage-results" ,
415- " history_file " : " ./coverage-history.json" ,
416- " history_retention_limit " : 30,
417- " html_report_file " : " ./index.html" ,
418- " json_report_file " : " ./coverage-report.json"
430+ " resultsDir " : " ./coverage-results" ,
431+ " historyFile " : " ./coverage-history.json" ,
432+ " historyRetentionLimit " : 30,
433+ " htmlReportFile " : " ./index.html" ,
434+ " jsonReportFile " : " ./coverage-report.json"
419435}
420436```
421437
422438### Configuration Reference
423439
424- | Key | Description | Required | Default |
425- | --------------------------- | ---------------------------------------------------------------------------| ----------| ---------------------------|
426- | ` apps ` | List of applications to track. Each must define ` key ` , ` name ` , and ` url ` . | ✅ | — |
427- | ` services[].key ` | Unique internal identifier for the service. | ✅ | — |
428- | ` services[].url ` | Entry point URL of the app. | ✅ | — |
429- | ` services[].name ` | Human-friendly name for the service (used in reports). | ✅ | — |
430- | ` services[].tags ` | Optional tags used in reports for filtering or grouping. | ❌ | — |
431- | ` services[].repository ` | Optional repository URL (will be shown in report). | ❌ | — |
432- | ` results_dir ` | Directory to store raw coverage result files. | ❌ | ` ./coverage-results ` |
433- | ` history_file ` | File to store historical coverage data. | ❌ | ` ./coverage-history.json ` |
434- | ` history_retention_limit ` | Maximum number of historical entries to keep. | ❌ | ` 30 ` |
435- | ` html_report_file ` | Path to save the final HTML report (if enabled). | ❌ | ` ./index.html ` |
436- | ` json_report_file ` | Path to save the raw JSON report (if enabled). | ❌ | ` ./coverage-report.json ` |
440+ | Key | Description | Required | Default |
441+ | -------------------------| ---------------------------------------------------------------------------| ----------| ---------------------------|
442+ | ` apps ` | List of applications to track. Each must define ` key ` , ` name ` , and ` url ` . | ✅ | — |
443+ | ` services[].key ` | Unique internal identifier for the service. | ✅ | — |
444+ | ` services[].url ` | Entry point URL of the app. | ✅ | — |
445+ | ` services[].name ` | Human-friendly name for the service (used in reports). | ✅ | — |
446+ | ` services[].tags ` | Optional tags used in reports for filtering or grouping. | ❌ | — |
447+ | ` services[].repository ` | Optional repository URL (will be shown in report). | ❌ | — |
448+ | ` resultsDir ` | Directory to store raw coverage result files. | ❌ | ` ./coverage-results ` |
449+ | ` historyFile ` | File to store historical coverage data. | ❌ | ` ./coverage-history.json ` |
450+ | ` historyRetentionLimit ` | Maximum number of historical entries to keep. | ❌ | ` 30 ` |
451+ | ` htmlReportFile ` | Path to save the final HTML report (if enabled). | ❌ | ` ./index.html ` |
452+ | ` jsonReportFile ` | Path to save the raw JSON report (if enabled). | ❌ | ` ./coverage-report.json ` |
437453
438454### How It Works
439455
@@ -457,29 +473,13 @@ data stored in the `coverage-results` directory and generate an HTML report.
457473** Usage:**
458474
459475``` shell
460- ui-coverage-scenario-tool save-report
476+ npx ui-coverage-scenario-tool save-report
461477```
462478
463479- This is the main command to generate a coverage report. After executing UI tests and collecting coverage data, use
464480 this command to aggregate the results into a final report.
465481- The report is saved as an HTML file, typically named index.html, which can be opened in any browser.
466482
467- ### Command: ` copy-report `
468-
469- This is an internal command mainly used during local development. It updates the report template for the generated
470- coverage reports. It is typically used to ensure that the latest report template is available when you generate new
471- reports.
472-
473- ** Usage:**
474-
475- ``` shell
476- ui-coverage-scenario-tool copy-report
477- ```
478-
479- - This command updates the internal template used by the save-report command. It's useful if the template structure or
480- styling has changed and you need the latest version for your reports.
481- - This command is typically only used by developers working on the tool itself.
482-
483483### Command: ` print-config `
484484
485485Prints the resolved configuration to the console. This can be useful for debugging or verifying that the configuration
@@ -488,10 +488,10 @@ file has been loaded and parsed correctly.
488488** Usage:**
489489
490490``` shell
491- ui-coverage-scenario-tool print-config
491+ npx ui-coverage-scenario-tool print-config
492492```
493493
494- - This command reads the configuration file (` ui_coverage_scenario_config. yaml` , ` ui_coverage_scenario_config .json` ,
494+ - This command reads the configuration file (` ui-coverage-scenario.config. yaml` , ` ui-coverage-scenario.config .json` ,
495495 or ` .env ` )
496496 and prints the final configuration values to the console.
497497- It helps verify that the correct settings are being applied and is particularly useful if something is not working as
@@ -501,9 +501,9 @@ ui-coverage-scenario-tool print-config
501501
502502### The report is empty or missing data
503503
504- - Ensure that ` start_scenario ()` is called before the test.
505- - Ensure that ` end_scenario ()` is called after the test.
506- - Ensure that ` track_coverage ()` is called during your test.
507- - Make sure you run ` ui-coverage-scenario-tool save-report ` from the root directory.
504+ - Ensure that ` startScenario ()` is called before the test.
505+ - Ensure that ` endScenario ()` is called after the test.
506+ - Ensure that ` trackCoverage ()` is called during your test.
507+ - Make sure you run ` npx ui-coverage-scenario-tool save-report` from the root directory.
508508- Make sure to setup configuration correctly.
509509- Check that the ` coverage-results ` directory contains ` .json ` files.
0 commit comments