DevExpress / testcafe

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

testcafe hangs on pages with server sent event subscriptions #1458

Closed yusinto closed 7 years ago

yusinto commented 7 years ago

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

Tests hang on pages with server sent event subscriptions.

What is the expected behavior?

Tests should not hang and should continue to finish even with server sent event subscriptions.

How would you reproduce the current behavior (if this is a bug)?

A page with more than one server sent event subscriptions will suffer from this hang. Please run the supplied test below against the supplied url to reproduce the problem. Also I have attached devtools network tab errors and their details in screenshots, please refer to them below

The first screenshot is the server sent event connection timeout (57df4354dd79c70721bcb507). We use launch darkly as our feature flag provider, and these are subscribing to launch darkly servers for feature flag updates.

After the hang, testcafe output: ERROR The Chrome 57.0.2987 / Mac OS X 10.12.2 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.

network error details 3 network error details 2 network error details 1 network connection erros

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://testcafe-spike.qantasassure.com/health-insurance/quote

Test code

import { Selector } from 'testcafe';

fixture `Enter Your Details`
  .page `https://testcafe-spike.qantasassure.com/health-insurance/quote`;

test('Verify FrequentFlyer page is displayed after details are entered', async t => {
  await t
    .typeText('input[name="firstName"]', 'Yus')
    .click('label[for="scale-Single"]')
    .click('label[for="countryState-NSW"]')
    .click('label[for="rebateTier-Tier0"]')
    .typeText('input[name="day"]', '18')
    .typeText('input[name="month"]', '06')
    .typeText('input[name="year"]', '1977')
    .click('label[for="isSwitching-false"]')
    .click('button[type="button"]')
    .click(Selector('button[type="button"]').nth(1))
    .click(Selector('.Ht2Nhh button'));
});

Specify your

AlexanderMoskovkin commented 7 years ago

Hi Yusinto,

I've reproduced the issue and we will investigate it.

yusinto commented 7 years ago

Thanks, let me know if I can do anything to help. I was trying to debug it myself but not sure where to start.

AlexanderMoskovkin commented 7 years ago

I've found that something is broken in our proxy (https://github.com/DevExpress/testcafe-hammerhead/issues/1106) in your case. If we will need some additional information from you we'll let you know, thanks.

AlexanderMoskovkin commented 7 years ago

Hi @yusinto,

We've fixed the issue. You can check it with the latest alpha version (v0.16.0-alpha1). You can install it via

npm install testcafe@alpha
lock[bot] commented 5 years ago

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.