diff --git a/CHANGELOG.md b/CHANGELOG.md index 45653303..0a3e6c1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Update repo GH action dependencies - Update WDIO to v8.32 to fix Chromedriver download URL (thanks @seanpoulter) - Fix property check that broke compatibility with WDIO versions before v6.10 +- Fix issue with unit test concurrency by removing unnecessary use of WebdriverIO `remote` ### [ [>](https://github.com/webdriverio-community/wdio-intercept-service/tree/v4.3.0) ] 4.4.0 / 24.02.2023 - Promptly throw if the user passes an invalid "index" parameter to `getRequest` diff --git a/test/spec/plugin_test.js b/test/spec/plugin_test.js index 8fe5f48b..388455a3 100644 --- a/test/spec/plugin_test.js +++ b/test/spec/plugin_test.js @@ -2,7 +2,6 @@ 'use strict'; const assert = require('assert'); -const { remote } = require('webdriverio'); const WebdriverAjax = require('../../index').default; const { TestHeaders } = require('../utils/header-parser'); // Since we serve the content from a file, the content-length depends on if the host is @@ -42,18 +41,16 @@ describe('webdriverajax', function testSuite() { describe('before hook', function () { it('registers service methods with specific browser instance when provided', async function () { - const browser = await remote({ - capabilities: { - browserName: 'chrome', - 'goog:chromeOptions': { - args: ['--headless', '--disable-gpu'], - }, - }, - }); + const commands = []; + const instanceBrowser = { addCommand: (name) => commands.push(name) }; - new WebdriverAjax().before(null, null, browser); + new WebdriverAjax().before(null, null, instanceBrowser); - assert.strictEqual(typeof browser.setupInterceptor, 'function'); + assert.strictEqual( + commands.some((name) => name === 'setupInterceptor'), + true, + 'should add commands to specific browser instance', + ); }); it('registers service methods on the global browser when not provided a specific instance', async function () {