Skip to content

Migrate browser test runner from karma to webdriverio#4183

Open
MichaelAJay wants to merge 8 commits into
bitpay:masterfrom
MichaelAJay:update-browser-tests
Open

Migrate browser test runner from karma to webdriverio#4183
MichaelAJay wants to merge 8 commits into
bitpay:masterfrom
MichaelAJay:update-browser-tests

Conversation

@MichaelAJay

@MichaelAJay MichaelAJay commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Update packages which do not call startGulp with skipBrowser: true option to use webdriverio for browser testing instead of karma. Updated wdio conf with test filepath resolver & bumped mocha timeout.

Changelog

  • wdio.conf.js - add test filepath resolver
  • wdio.conf.js - update mochaOpts.timeout - 1m -> 4m (fixes test failure which did not indicate test timeout)
  • wdio.conf.js - update capabilities. Of note, 'wdio:enforceWebDriverClassic': true mitigates a test runner error in which the test runner tries to connect to a BiDi server
  • update bitcore-lib (and derivatives) and bitcore-mnemonic packages' gulpfile to use webdriverio explicitly (default is karma)

Testing Notes

Ensure CI tests execute successfully for the following packages:

  • bitcore-lib (and its derivatives)
  • bitcore-mnemonic

Review the CircleCI test output for successfully run tests. Hunt the area at the top of the section with lines [chrome 148...] or Find/Search for "wdio/browser-runner".


Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

@MichaelAJay MichaelAJay changed the title Update browser tests Migrate browser test runner from karma to webdriverio Jun 9, 2026
@MichaelAJay MichaelAJay marked this pull request as ready for review June 9, 2026 16:56
@kajoseph kajoseph requested a review from Copilot June 9, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates browser/unit test execution for selected packages from Karma to WebdriverIO by explicitly selecting the WDIO browser runner in their gulp tasks, and updates the shared WDIO configuration to better match how tests are generated/executed in this monorepo.

Changes:

  • Switch browser test runner selection to webdriverio for bitcore-lib (and derivatives) plus bitcore-mnemonic via startGulp(..., { browserRunner: 'webdriverio' }).
  • Update @bitpay-labs/bitcore-build’s wdio.conf.js to resolve the generated tests.js from the consuming package’s CWD.
  • Adjust WDIO runtime settings (Chrome args/capabilities) and increase Mocha timeout from 60s to 240s.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/bitcore-mnemonic/gulpfile.js Explicitly selects WebdriverIO as the browser runner for mnemonic package browser tests.
packages/bitcore-lib/gulpfile.js Explicitly selects WebdriverIO as the browser runner for bitcore-lib browser tests.
packages/bitcore-lib-ltc/gulpfile.js Explicitly selects WebdriverIO as the browser runner for LTC lib browser tests.
packages/bitcore-lib-doge/gulpfile.js Explicitly selects WebdriverIO as the browser runner for DOGE lib browser tests.
packages/bitcore-lib-cash/gulpfile.js Explicitly selects WebdriverIO as the browser runner for BCH lib browser tests.
packages/bitcore-build/wdio.conf.js Updates WDIO configuration to find generated tests.js in CWD, adjusts Chrome capabilities, and increases Mocha timeout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +12
const cwdTests = path.join(process.cwd(), 'tests.js');
if (fs.existsSync(cwdTests)) return [cwdTests];
console.error('[wdio] tests.js not found. Tried: ' + cwdTests);
return [cwdTests];
'--disable-web-security',
'--no-sandbox',
'--disable-dev-shm-usage',
'--user-data-dir=/tmp/chrome-test-profile'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants