{"id":42293,"library":"wdio-lambdatest-test-case-analytics-service","title":"LambdaTest Test Case Analytics Service for WebDriverIO","description":"A WebDriver.IO service that captures it() block test case names and logs them in the browser console using browser.execute(). This is useful for tracking test progress on LambdaTest's platform. Current stable version is 2.0.3. It is maintained by LambdaTest and releases follow their internal cadence. The key differentiator is that it automates test name reporting without manual instrumentation, specifically tailored for LambdaTest's analytics. Compared to generic logging, it integrates tightly with WebDriverIO's service lifecycle and requires minimal configuration.","status":"active","version":"2.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/LambdaTest/test-case-analytics","tags":["javascript","lambdatest","webdriver","webdriverio","it","test","case","typescript"],"install":[{"cmd":"npm install wdio-lambdatest-test-case-analytics-service","lang":"bash","label":"npm"},{"cmd":"yarn add wdio-lambdatest-test-case-analytics-service","lang":"bash","label":"yarn"},{"cmd":"pnpm add wdio-lambdatest-test-case-analytics-service","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for TypeScript type definitions and compatibility with WebDriverIO service types.","package":"@wdio/types","optional":true}],"imports":[{"note":"The package is ESM-only since v2. Use dynamic import or configure TypeScript for ESM.","wrong":"const service = require('wdio-lambdatest-test-case-analytics-service')","symbol":"default","correct":"import wdioLambdatestTestCaseAnalyticsService from 'wdio-lambdatest-test-case-analytics-service'"},{"note":"The named export is available in addition to default export. Use named export to be explicit.","wrong":"import LambdatestTestCaseAnalyticsService from 'wdio-lambdatest-test-case-analytics-service'","symbol":"LambdatestTestCaseAnalyticsService","correct":"import { LambdatestTestCaseAnalyticsService } from 'wdio-lambdatest-test-case-analytics-service'"},{"note":"TypeScript users can import types for better IntelliSense and type checking.","wrong":null,"symbol":"ServicePluginCapabilities","correct":"import type { ServicePluginCapabilities } from 'wdio-lambdatest-test-case-analytics-service'"}],"quickstart":{"code":"// wdio.conf.ts\nimport { Launcher } from '@wdio/cli';\n\nexport const config = {\n    user: process.env.LAMBDATEST_USERNAME ?? '',\n    key: process.env.LAMBDATEST_ACCESS_KEY ?? '',\n    services: [\n        ['lambdatest-test-case-analytics', {}]\n    ],\n    specs: ['./test/specs/**/*.ts'],\n    capabilities: [{\n        platformName: 'Windows 10',\n        browserName: 'Chrome',\n        browserVersion: 'latest'\n    }],\n    logLevel: 'info',\n    baseUrl: 'https://www.example.com',\n    framework: 'mocha',\n    mochaOpts: {\n        ui: 'bdd',\n        timeout: 60000\n    }\n};\n\nconst launcher = new Launcher(config, process.argv.slice(2));\nlauncher.run().then(\n    (exitCode) => process.exit(exitCode ?? 0),\n    (error) => { console.error(error); process.exit(1); }\n);","lang":"typescript","description":"Example wdio.conf.ts configuration showing how to enable the LambdaTest Test Case Analytics service with authentication and minimal setup."},"warnings":[{"fix":"Use import() or configure your project for ESM (e.g., set type: 'module' in package.json).","message":"Package is ESM-only from v2. CommonJS require() will not work without dynamic import.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Stay updated with changelog and update the service string accordingly.","message":"The service name in config ('lambdatest-test-case-analytics') may change in future versions to match other LambdaTest services.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Install @wdio/types as a dev dependency: npm install --save-dev @wdio/types","message":"Requires @wdio/types package for TypeScript projects. Missing types will cause compilation errors.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure your project uses WebdriverIO as the test runner, not just as a browser automation library.","message":"The service captures it() block names only if test is run with WebDriverIO. It does not work with standalone WebDriver or other frameworks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If your application has strict CSP, configure the policy to allow 'unsafe-eval' or use a custom logging method.","message":"Service uses browser.execute() to log names; this may interfere with strict CSP headers in some environments.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2.0.3':42 'analyt':4,72 'autom':60 'block':14 'browser':23 'browser.execute':26 'cadenc':53 'captur':12 'case':3,16,95 'compar':73 'configur':88 'consol':24 'current':38 'differenti':56 'follow':50 'generic':75 'instrument':66 'integr':78 'intern':52 'javascript':89 'key':55 'lambdatest':1,35,47,70,90 'lifecycl':84 'log':19,76 'maintain':45 'manual':65 'minim':87 'name':17,62 'platform':37 'progress':33 'releas':49 'report':63 'requir':86 'servic':5,10,83 'specif':67 'stabl':39 'tailor':68 'test':2,15,32,61,94 'tight':79 'track':31 'typescript':96 'use':25,29 'version':40 'webdriv':91 'webdriver.io':9 'webdriverio':7,81,92 'without':64","created_at":"2026-06-04T18:56:33.512113+00:00","updated_at":"2026-06-04T18:56:33.512113+00:00","problems":[{"fix":"Run 'npm install wdio-lambdatest-test-case-analytics-service' and ensure node_modules is in the correct directory.","cause":"The package is not installed or is installed but not in the correct node_modules.","error":"Module not found: Error: Can't resolve 'wdio-lambdatest-test-case-analytics-service'"},{"fix":"Check that the service string 'lambdatest-test-case-analytics' is correctly added in the services array in wdio.conf.","cause":"The browser object is not available in the service context, possibly because the service is not loaded correctly.","error":"TypeError: Cannot read properties of undefined (reading 'execute')"},{"fix":"Install @wdio/types as a dev dependency: npm install --save-dev @wdio/types","cause":"@wdio/types is required for TypeScript support but is not installed.","error":"Cannot find module '@wdio/types' or its corresponding type declarations"},{"fix":"Run 'npm install wdio-lambdatest-test-case-analytics-service' and ensure the service string matches exactly.","cause":"The service is not registered properly or the package is not installed.","error":"Command 'lambdatest-test-case-analytics' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/LambdaTest/test-case-analytics#readme","github":"https://github.com/LambdaTest/test-case-analytics","docs":null,"changelog":null,"pypi":null,"npm":"wdio-lambdatest-test-case-analytics-service","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}