Skip to content

Automatic download and overall Firefox use brokenย #12322

@nextlevelbeard

Description

@nextlevelbeard

As title says, Firefox cannot be used currently with WDIO.
The download URL for Chrome is used and it needs to be updated for Firefox.

Today I used patch-package to patch @wdio/utils@8.32.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@wdio/utils/build/node/utils.js b/node_modules/@wdio/utils/build/node/utils.js
index 3493376..e77f137 100644
--- a/node_modules/@wdio/utils/build/node/utils.js
+++ b/node_modules/@wdio/utils/build/node/utils.js
@@ -11,6 +11,7 @@ import { download as downloadEdgedriver } from 'edgedriver';
 import { locateChrome, locateFirefox, locateApp } from 'locate-app';
 const log = logger('webdriver');
 const CHROMEDRIVER_BASE_URL = 'https://storage.googleapis.com/chrome-for-testing-public';
+const FIREFOX_BASE_URL = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central';
 const EXCLUDED_PARAMS = ['version', 'help'];
 /**
  * Helper utility to check file access
@@ -182,7 +183,10 @@ export async function setupPuppeteerBrowser(cacheDir, caps) {
         : caps.browserVersion || 'latest';
     const buildId = await resolveBuildId(browserName, platform, tag);
     const installOptions = {
-        baseUrl: CHROMEDRIVER_BASE_URL,
+        baseUrl: {
+            [Browser.CHROME]: CHROMEDRIVER_BASE_URL,
+            [Browser.FIREFOX]: FIREFOX_BASE_URL,
+        }[browserName],
         unpack: true,
         cacheDir,
         platform,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug ๐Ÿ›help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions