DevExpress / testcafe

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

Browser hangs and disconnects when testing against a url that contains a symbol and while using an experimental proxyless mode #7470

Closed ayemelyanenko-chegg closed 1 year ago

ayemelyanenko-chegg commented 1 year ago

What is your Scenario?

I am running a simple test against a url which contains a question mark and I am using the --experimental-proxyless parameter. The test hangs and browser disconnects in this case.

What is the Current behavior?

Upon running the test with experimental proxyless mode, the page loads but then the browser hangs and eventually disconnects.

Upon running the test without the experimental proxyless mode, the test succeeds each time.

What is the Expected behavior?

The expected behavior would be for the browser to not hang and then disconnect when running a test against a url that contains a symbol and while using proxyless mode

What is your public website URL? (or attach your complete example)

https://www.chegg.com/auth?login

What is your TestCafe test code?

fixture`Login page test`.meta({ fixtureID: 'f-0001', author: 'GDG', app: '' });

test.meta({
  priority: 'p1',
  testID: 't-0001',
  testType: 'Smoke',
  testRailCaseId: '267753',
})(
  'Login page test',
  async (t) => {
    await t.navigateTo(`https://www.chegg.com/auth?login`);
  }
);

Your complete configuration file

No response

Your complete test report

ERROR The Chrome 109.0.5414.74 / Linux 0.0 browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault. Type "testcafe -h" for help. error Command failed with exit code 1.

Screenshots

No response

Steps to Reproduce

Steps 4 and 5 highlight the issue. The other steps are shows for comparison that urls that do not contains symbols appear to be working fine

  1. Testcafe version should be 2.2
  2. Run the sample code without the --experimental-proxyless option
  3. Test passes as expected
  4. Run the sample code with --experimental-proxyless option
  5. Test hangs and eventually the browser disconnects
  6. Run the sample code with --experimental-proxyless but adjust the url to not contain the question mark (https://www.chegg.com)
  7. Test passes as expected

TestCafe version

2.2.0

Node.js version

14.20.1

Command-line arguments

yarn testcafe chrome testcafe/tests/sampleTest.ts --experimental-proxyless or yarn testcafe chrome testcafe/tests/sampleTest.ts --experimental-proxyless -L

Browser name(s) and version(s)

Version 109.0.5414.87 (Official Build) (x86_64)

Platform(s) and version(s)

No response

Other

No response

Artem-Babich commented 1 year ago

Hello,

I did not manage to reproduce TestCafe hanging using your test code, however I get a JavaScript error when running TestCafe with the experimental-proxyless flag. Uncaught ReferenceError: __set$ is not defined     No stack trace available I just checked this usage scenario in v2.3.0-rc.1 and it works as expected there. Would you please check this on your side and let us know if this issue is reproducible in v2.3.0-rc.1 on your side?

ayemelyanenko-chegg commented 1 year ago

@Artem-Babich Hello, thanks for replying back to me.

I wasn't able to check because I ran into an issue during installing version 2.3.0-rc.1. I am using node 14.20.1

error babel-plugin-module-resolver@5.0.0: The engine "node" is incompatible with this module. Expected version ">= 16". Got "14.20.1" error Found incompatible module.

Does the upcoming version 2.3 mean that users will have to switch to node version >=16? Or should I file another issue for this?

Artem-Babich commented 1 year ago

Hello @ayemelyanenko-chegg,

Officially, NodeJS 14 maintenance will end on April 30, 2023. However, we had to update babel-plugin-module-resolver to v5 due to a vulnerability: babel-plugin-module-resolver#441. This version only supports NodeJS version >=16. So, yes, we are ending support for NodeJS 14 in v2.3.0.

By the way, we already released v2.3.0-rc.2, which includes some fixes. Please check if the test hanging issue is reproducible in this version and let me know your results.

ayemelyanenko-chegg commented 1 year ago

Hello @Artem-Babich, it's odd but I installed the recommended RC version to my repo (using yarn) and it still doesn't work

My package.json has the below version "testcafe": "2.3.0-rc.2"

I also updated my node version to 18.13.0 which is the latest recommended stable version. I tried node 16.16.0 as well just in case.

I am trying to run my sample code with --experimental-proxyless and node 18.13.0 (also tried with 16.16.0) and the Chrome browser 109.0.5414.87 (Official Build) (x86_64) just sits at about:blank and doesn't open the page at all. When I run without experimental proxyless option, the test runs fine on either node version.

Here are the command lines with --experimental-proxyless and without. Also attaching videos of how it looks like:

yarn testcafe chrome testcafe/tests/sampleTest.ts --experimental-proxyless -L Video of above command run: https://recordit.co/6rC1U4KF7Y

yarn testcafe chrome testcafe/tests/sampleTest.ts -L Video of above command run: https://recordit.co/GDzS5wXUyG

Artem-Babich commented 1 year ago

Hello,

Thank you for the clarification and video. I'm happy to hear that the issue is resolved in newer versions. Regarding our proxyless mode, it is still experimental, but we are actively working on it to improve user experience. Would you please send us a simple working project so we can reproduce this issue locally and fix it in a proxyless mode?

ayemelyanenko-chegg commented 1 year ago

Thank you @Artem-Babich. I'm going to close this issue for now and pull in latest version of TestCafe into my repository and run with experimental proxyless and a newer version of node. If I still see this issue, I will try to get it to reproduce it in a simple project and will reopen this issue.