New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: have a switch to allow offline mode, and don’t check chrome labs when not using chrome #12705
Comments
As per our documentation this works if:
So I assume that this application look up has failed which caused WebdriverIO to try to download the binary and driver.
I am not sure why you are experiencing this, I can't reproduce it on my side as I am getting Do you have Firefox installed on your OS? If so which path is it on? What OS are you using? |
Thanks for the quick reply. I copied a more readable error message now, somehow it copied weirdly formatted on my phone. |
@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. |
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! |
Oh wow thanks, that is very helpful, will try to make a PR. |
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
Latest
Node.js Version
20
Mode
Standalone Mode
Which capabilities are you using?
What happened?
I expected to be able to run my tests locally, while being offline due to being on the train or other reasons. Additionally, why is chrome labs being checked when only using Firefox?
What is your expected behavior?
I expected the test to run if it has all the necessary browsers available. It is not an option for me to harcode as mentioned here #10965 as I only need it when offline and do not have custom images. Also imo Firefox should not require a call to chrome labs.
How to reproduce the bug.
Just turn off your internet, have only Firefox in capabilities. Run any test. It will still check chromelabs and not work.
Relevant log output
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: