DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 671 forks source link

TestCafe fails with latest chrome version 127.0.6533.89 #8246

Closed Notebloc closed 2 months ago

Notebloc commented 2 months ago

What is your Scenario?

Running testcafe with chrome:headless and the latest version of chrome installed

What is the Current behavior?

ERROR Unable to open the "chrome:headless" browser due to the following error:

Error: WebSocket connection closed
    at C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:94:35
    at Chrome._handleConnectionClose (C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:256:13)
    at WebSocket.<anonymous> (C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:243:22)
    at WebSocket.emit (node:events:519:28)
    at WebSocket.emit (node:domain:488:12)
    at WebSocket.emitClose (C:\Projecten\<company>\<company_service>\node_modules\ws\lib\websocket.js:246:10)
    at Receiver.receiverOnFinish (C:\Projecten\<company>\<company_service>\node_modules\ws\lib\websocket.js:1060:20)
    at Receiver.emit (node:events:519:28)
    at Receiver.emit (node:domain:488:12)
    at finish (node:internal/streams/writable:946:10)

What is the Expected behavior?

Tests run

What is the public URL of the test page? (attach your complete example)

google.com

What is your TestCafe test code?

fixture("my-test-fixture");

test("Test", async (t) => {
  await t.setPageLoadTimeout(50000);
  await t.expect(true).ok();
});

Your complete configuration file

let os = require("os"); 

module.exports = {
  // Settings go inside the module.exports statement.
  src: [
    "./src/tests/**/pages/**/test.ts",
  ],
  browsers: ["chrome:headless --start-maximized --disable-multiple-windows"],

  baseUrl: "https://www.google.com",
  hostname: os.hostname(), // Node.js dynamically calculates the value of this parameter.
  skipJsErrors: false, 
};

Your complete test report

S C:\Projecten\<company>\<company_service>\TestCafe> npm run tests-on-test-for-chrome
Debugger attached.

> tests-on-test-for-chrome
> testcafe --config-file test-chrome.testcaferc.js --reporter spec,xunit:..\reports\report.xml

Debugger attached.
Debugger attached.
(node:11896) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ERROR Unable to open the "chrome:headless --start-maximized --disable-multiple-windows" browser due to the following error:

Error: WebSocket connection closed
    at C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:94:35
    at Chrome._handleConnectionClose (C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:256:13)
    at WebSocket.<anonymous> (C:\Projecten\<company>\<company_service>\node_modules\chrome-remote-interface\lib\chrome.js:243:22)
    at WebSocket.emit (node:events:519:28)
    at WebSocket.emit (node:domain:488:12)
    at WebSocket.emitClose (C:\Projecten\<company>\<company_service>\node_modules\ws\lib\websocket.js:246:10)
    at Receiver.receiverOnFinish (C:\Projecten\<company>\<company_service>\node_modules\ws\lib\websocket.js:1060:20)
    at Receiver.emit (node:events:519:28)
    at Receiver.emit (node:domain:488:12)
    at finish (node:internal/streams/writable:946:10)

Type "testcafe -h" for help.
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
PS C:\Projecten\<company>\<company_service>\TestCafe> 

Screenshots

No response

Steps to Reproduce

1.1.Run testcafe with latest chrome

TestCafe version

3.6.2

Node.js version

21.5.0

Command-line arguments

npm run tests-on-test-for-chrome

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

I expect this has to do with the Chrome security patches, and I'm really not sure this is a stable Chrome version. I was just curious if a) I am the only one experiencing this problem, b) if you expect this to be fixed by a Chrome patch

mantljosh commented 2 months ago

https://github.com/DevExpress/testcafe/issues/8240

Notebloc commented 2 months ago

Ah, sorry for the duplicate! And thanks for the reply