The `wdio-mocha-framework` package, specifically version 0.6.4, served as an adapter to integrate the Mocha testing framework with WebdriverIO. Released many years ago, it allowed users to write their automated browser tests using Mocha's BDD (Behavior Driven Development) or TDD (Test Driven Development) interfaces within the WebdriverIO test runner. Its primary function was to parse Mocha tests, execute them via WebdriverIO's browser automation capabilities, and report results. Key configurations included `mochaOpts` for passing options directly to Mocha, and `require`/`compilers` for custom setup files or transpilers. This standalone package has since been abandoned; its last stable version, 0.6.4, was published in 2017. Modern WebdriverIO projects (v5+) utilize `@wdio/mocha-framework`, which is part of the main WebdriverIO monorepo and receives active maintenance and updates, reflecting a continuous release cadence in alignment with WebdriverIO's own major versions.
npm install wdio-mocha-frameworkNo compatibility data collected yet for this library.
Demonstrates the basic `wdio.conf.js` setup for using the `wdio-mocha-framework` with WebdriverIO v4. It shows how to specify Mocha as the framework, configure `mochaOpts`, and includes a basic runnable Mocha test file.
Migrate your WebdriverIO setup to use WebdriverIO v5 or newer and replace `wdio-mocha-framework` with `@wdio/mocha-framework` in your `package.json` and `wdio.conf.js`. This will involve updating WebdriverIO itself and potentially other plugins, requiring adjustments to configuration and test code.
Ensure your WebdriverIO version matches the framework adapter's compatibility. For current WebdriverIO versions, use `@wdio/mocha-framework`. If you are stuck on WebdriverIO v4, ensure all your `wdio-*` packages are also v4 compatible.
When using `mochaOpts.require` for setup scripts, ensure they are written using CommonJS syntax. If ESM is strictly required, explore transpilation options or consider upgrading to a modern WebdriverIO setup that offers better ESM support.
Verify that `wdio-mocha-framework` is listed in your `devDependencies` in `package.json` and that you have run `npm install`. If using a modern WebdriverIO (v5+), you should instead install and configure `@wdio/mocha-framework`.
Check your `wdio.conf.js` to ensure `framework: 'mocha'` is correctly specified. Confirm `wdio-mocha-framework` (for WDIO v4) or `@wdio/mocha-framework` (for modern WDIO) is installed in your `node_modules` directory and listed in your `package.json`.