Skip to content

4 fork work fix browserautherror crypto nonexistent for firefox upstream issue 8391#8482

Open
Christopher-C-Robinson wants to merge 3 commits intoDevExpress:masterfrom
Christopher-C-Robinson:4-fork-work-fix-browserautherror-crypto_nonexistent-for-firefox-upstream-issue-8391
Open

4 fork work fix browserautherror crypto nonexistent for firefox upstream issue 8391#8482
Christopher-C-Robinson wants to merge 3 commits intoDevExpress:masterfrom
Christopher-C-Robinson:4-fork-work-fix-browserautherror-crypto_nonexistent-for-firefox-upstream-issue-8391

Conversation

@Christopher-C-Robinson
Copy link

Purpose

Fix BrowserAuthError: crypto_nonexistent behavior reported in #8391 for Firefox runs in proxy mode (--disable-native-automation), and add regression coverage.

Approach

References

Validation

  • gulp test-server (local): 809 passing, 1 pending, 3 failing
  • Failures are local-environment related and tied to macOS Screen Recording API access:
    • Runner .src() -> Should accept source files in different forms
    • Runner Regression -> Should not have unhandled rejections in runner (GH-825)
    • Runner after all hook ...
    • error: UnableToAccessScreenRecordingAPIError: The find-window process cannot access the Screen Recording API
  • Focused runner check passes:
    • npx mocha test/server/runner-test.js --timeout 120000 --grep "permission|retry|_checkRequiredPermissions"
    • result: 3 passing

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail (blocked locally by macOS Screen Recording permission/TCC behavior)

@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 19, 2026
Christopher Robinson added 3 commits February 19, 2026 13:24
When running tests in local browsers with native automation disabled, TestCafe previously attempted to resolve a network-accessible hostname. This process can be slow and may fail in environments with restricted or no network access.

This change optimizes this behavior by defaulting the hostname to 'localhost' when all browsers are local and a specific hostname has not been configured. This improves test startup time and enhances reliability for local-only test runs.
@Christopher-C-Robinson Christopher-C-Robinson force-pushed the 4-fork-work-fix-browserautherror-crypto_nonexistent-for-firefox-upstream-issue-8391 branch from ee014a5 to 188a229 Compare February 19, 2026 19:24
@Christopher-C-Robinson Christopher-C-Robinson marked this pull request as ready for review February 19, 2026 19:29
Copilot AI review requested due to automatic review settings February 19, 2026 19:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a Firefox proxy-mode (--disable-native-automation) initialization failure (BrowserAuthError: crypto_nonexistent, #8391) by ensuring TestCafe uses a localhost hostname strategy when all target browsers are local, and adds regression coverage around the scenario.

Changes:

  • Update proxy bootstrap flow to detect when all browsers are local and pass that signal into hostname calculation.
  • Extend hostname calculation logic to prefer localhost for proxy mode when hostname is unset and all browsers are local.
  • Add/extend server- and functional-level regression tests for GH-8391 and the new hostname strategy.

Reviewed changes

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

Show a summary per file
File Description
src/runner/bootstrapper.ts Computes allBrowsersLocal and feeds it into hostname calculation during proxy setup.
src/configuration/testcafe-configuration.ts Adds allBrowsersLocal support to hostname calculation to select localhost in proxy mode when appropriate.
test/server/configuration-test.js Adds unit coverage for the new hostname calculation branch.
test/server/bootstrapper-test.js Adds a unit test asserting proxy setup uses the localhost hostname strategy for local browsers in proxy mode.
test/functional/fixtures/regression/gh-8391/* Adds a functional regression fixture + page for Firefox proxy-mode initialization.
package-lock.json Lockfile refresh reflecting dependency updates (incl. testcafe-hammerhead).

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

Comment on lines +357 to 362
private async _isAllBrowsersLocal (browserInfo: BrowserInfoSource[]): Promise<boolean> {
const isLocalPromises = browserInfo.map(browser => browser.provider.isLocalBrowser(void 0, Bootstrapper._getBrowserName(browser)));
const isLocalBrowsers = await Promise.all(isLocalPromises);

return isLocalBrowsers.every(result => result);
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

_isAllBrowsersLocal calls browser.provider.isLocalBrowser(void 0, ...) for every BrowserInfoSource. When the entry is a BrowserConnection, an id is available (browser.id) and some providers rely on it to determine locality; passing undefined risks misclassifying remote connections as local, which can incorrectly force hostname to localhost in proxy mode. Pass the connection id for BrowserConnection instances (and keep undefined for plain BrowserInfo).

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,5 @@
describe('[Regression](GH-8391)', function () {
it('Should not fail Firefox proxy-mode initialization', function () {
return runTests('testcafe-fixtures/index.js', 'Should run a simple assertion in Firefox proxy mode', { only: 'firefox' });
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This regression test is intended to verify Firefox behavior specifically in proxy mode (--disable-native-automation), but it doesn’t enforce that mode. Since the functional test harness can run with NATIVE_AUTOMATION=true, this test may execute in native automation and fail to cover the reported scenario. Please skip/guard this test when config.nativeAutomation is true (or explicitly run with disableNativeAutomation: true in this test).

Suggested change
return runTests('testcafe-fixtures/index.js', 'Should run a simple assertion in Firefox proxy mode', { only: 'firefox' });
return runTests('testcafe-fixtures/index.js', 'Should run a simple assertion in Firefox proxy mode', { only: 'firefox', disableNativeAutomation: true });

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

STATE: Need response An issue that requires a response or attention from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments