GithubHelp home page GithubHelp logo

Comments (5)

christian-bromann avatar christian-bromann commented on June 15, 2024

I expected to be able to run my tests locally, while being offline due to being on the train or other reasons.

As per our documentation this works if:

If you omit browserVersion, WebdriverIO will first try to locate and use an existing installation with locate-app, otherwise it will download and install the current stable browser release.

So I assume that this application look up has failed which caused WebdriverIO to try to download the binary and driver.

Additionally, why is chrome labs being checked when only using Firefox?

I am not sure why you are experiencing this, I can't reproduce it on my side as I am getting Error: getaddrinfo ENOTFOUND product-details.mozilla.org

Do you have Firefox installed on your OS? If so which path is it on? What OS are you using?

from webdriverio.

step21 avatar step21 commented on June 15, 2024

Thanks for the quick reply. I copied a more readable error message now, somehow it copied weirdly formatted on my phone.
I definitely did not specify a browser version. (should I paste my wdio.conf.js somewhere?)
This is on macOS, and I use Firefox everyday. Also when I am online, it doesn't seem to always redownload.
I just ran locate-app manually, and that gave '/Applications/Firefox.app/Contents/MacOS/Firefox' as a path. This was on node v18 (in my test environment I use both)
Does any of that help?

from webdriverio.

christian-bromann avatar christian-bromann commented on June 15, 2024

@step21 thanks for further details, it seems that WebdriverIO unnecessarily tries to resolve the Firefox version, even though it has all required information to run the test. This causes an unnecessary network hop. A possible fix would be the following:

diff --git a/packages/wdio-utils/src/node/utils.ts b/packages/wdio-utils/src/node/utils.ts
index 93459fe61..8be7bbd84 100644
--- a/packages/wdio-utils/src/node/utils.ts
+++ b/packages/wdio-utils/src/node/utils.ts
@@ -190,16 +190,16 @@ export async function setupPuppeteerBrowser(cacheDir: string, caps: WebdriverIO.
                     linuxWhich: 'chromium-browser'
                 }).catch(() => undefined)
                 : await locateFirefox().catch(() => undefined)
-        const tag = isChromeOrChromium
+        const browserVersion = isChromeOrChromium
             ? getBuildIdByChromePath(executablePath)
             : await getBuildIdByFirefoxPath(executablePath)
         /**
          * verify that we have a valid Chrome/Firefox browser installed
          */
-        if (tag) {
+        if (browserVersion) {
             return {
                 executablePath,
-                browserVersion: await resolveBuildId(browserName, platform, tag)
+                browserVersion
             }
         }
     }

Feel free to raise a PR with the change set.

from webdriverio.

wdio-bot avatar wdio-bot commented on June 15, 2024

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

from webdriverio.

step21 avatar step21 commented on June 15, 2024

@step21 thanks for further details, it seems that WebdriverIO unnecessarily tries to resolve the Firefox version, even though it has all required information to run the test. This causes an unnecessary network hop. A possible fix would be
...
Feel free to raise a PR with the change set.

Oh wow thanks, that is very helpful, will try to make a PR.

from webdriverio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.