Registry / testing / wdio-performancetotal-service

wdio-performancetotal-service

JSON →
library4.0.7jsnpmunverified

The `wdio-performancetotal-service` is a WebdriverIO plugin designed for integrating performance analysis directly into automated test flows. It enables developers to measure the response times of various procedures—whether UI-based, API-driven, or a combination—to identify and address application bottlenecks. The current stable version is 4.0.7, which offers compatibility with WebdriverIO v9 and includes features like the `recentDays` option. The service generally updates its major versions to align with WebdriverIO's major releases, ensuring ongoing compatibility with the ecosystem. Its key differentiator lies in its seamless integration with WebdriverIO tests, providing `sampleStart` and `sampleEnd` methods to precisely delineate performance measurement spans within test scripts. It also offers configurable options for result aggregation, file naming, directory customization, and analysis by browser, facilitating comprehensive performance monitoring and reporting.

npm install wdio-performancetotal-service
INSTALL
IMPORT
SIG · WDIO-PERFORMANCETO
W
wdio-performancetotal-service
testingjavascriptv4.0.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

performancetotal
import { performancetotal } from 'wdio-performancetotal-service'
import performancetotal from 'wdio-performancetotal-service'
The primary `performancetotal` object is a named export. Attempting a default import will result in undefined or type errors in TypeScript.
performancetotal
import { performancetotal } from 'wdio-performancetotal-service'
const { performancetotal } = require('wdio-performancetotal-service')
ESM imports (`import ... from '...'`) are the preferred and most idiomatic way to use this service in modern WebdriverIO projects, especially when TypeScript is involved. While CommonJS `require` might work, types might not be correctly inferred without specific TypeScript configuration.

Demonstrates how to import and use the `performancetotal` object's `sampleStart` and `sampleEnd` methods within a WebdriverIO test to measure the startup performance of two different websites. Configuration for the service itself is done in `wdio.conf.js`.

import { performancetotal } from "wdio-performancetotal-service"; describe("Website Startup Performance", () => { it("should measure github and sourceforge startup performance", async () => { // Start a new performance measurement for Github performancetotal.sampleStart("GH-Startup"); // Navigate to Github await browser.url("https://github.com/"); // Wait for a key element to ensure page is loaded await $('[aria-label="Homepage"]').waitForDisplayed(); // End the Github measurement and save the results performancetotal.sampleEnd("GH-Startup"); // Start a new performance measurement for SourceForge performancetotal.sampleStart("SF-Startup"); // Navigate to SourceForge await browser.url("https://sourceforge.net/"); // Wait for a key element to ensure page is loaded await $('[aria-label="SourceForge Home"]').waitForDisplayed(); // End the SourceForge measurement and save the results performancetotal.sampleEnd("SF-Startup"); }); });
Debug
Known issues
breakingMajor versions of `wdio-performancetotal-service` are tightly coupled to WebdriverIO major versions. Ensure you install the correct service version for your WebdriverIO setup (e.g., v4.x.x for WebdriverIO v9, v3.x.x for WebdriverIO v8).
fix
Check the README or documentation for the correct service version compatible with your installed WebdriverIO version and update `wdio-performancetotal-service` accordingly.
affects: >=1.0.0
gotchaSetting `disableAppendToExistingFile: true` in your service options will permanently delete all previously collected performance data upon each new test run. This action cannot be undone.
fix
Ensure you have backed up any critical performance data before enabling `disableAppendToExistingFile`. If you wish to aggregate results over time, keep this option as `false` (default).
affects: >=1.0.0
gotchaBy default, `performanceResultsFileName` will overwrite the existing file if it has the same name. If you need to retain historical data, you must implement a unique naming strategy, such as including a timestamp.
fix
Configure `performanceResultsFileName` with a dynamic value, for example: `performanceResultsFileName: `performance-results_${new Date().getTime()}` to ensure unique files are generated for each run.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Service 'performancetotal' could not be initialized.
This usually indicates that the service is not correctly listed in the `services` array in `wdio.conf.js`, or the package is not installed.
fix
Verify that `wdio-performancetotal-service` is installed (`npm install wdio-performancetotal-service --save-dev`) and that 'performancetotal' (or ['performancetotal', options]) is correctly added to the `services` array in your `wdio.conf.js`.
TypeError: performancetotal.sampleStart is not a function
The `performancetotal` object was either not imported correctly, or the service failed to initialize, meaning the methods are not available.
fix
Ensure you have `import { performancetotal } from 'wdio-performancetotal-service';` at the top of your test file and that the service is properly configured and initialized in `wdio.conf.js`.
Upgrade
Version history
4.0.7latest on npm
Audit
Dependencies
webdriveriorequiredRequired as a peer dependency for the service to function within the WebdriverIO test runner.
Agent activity
34 hits · last 30 days
node
28
OpenAI (training)
1
Resources
wdio-performancetotal-service — npm install wdio-performancetotal-service · libregistry