Testcafe-hammerhead: TestCafe fails to load page styles / CSS

Created on 14 Dec 2018  路  14Comments  路  Source: DevExpress/testcafe-hammerhead

What is your Test Scenario?


Download the provided test repo and execute the tests with node v10.14.2 (LTS)

What is the Current behavior?


After TestCafe executes the test "Clicking a News, Entertainment and Sports link opens the correct page" in desktop/404.js (line 49), all subsequent tests fail because TestCafe fails to load the page style/CSS. (see attached screenshot)

What is the Expected behavior?


TestCafe should always load the page styles/CSS

What is聽your web application and聽your TestCafe聽test code?


Download this repo - https://github.com/sijosyn/testcafe-syntests and run the test suite.

Your website URL (or attach your complete example):


Your complete test code (or attach your test files):

 Above provided repo contains all the test code.


Your complete test report:



Screenshots:

bug

screen shot 2018-12-14 at 1 31 40 pm

Steps to Reproduce:

Please read the README provided in the repo - https://github.com/sijosyn/testcafe-syntests .
Run the full test suite. After TestCafe executes line 56 in 404.js file, TestCafe fails to load the page styles in all subsequent tests.

Your Environment details:

  • testcafe version: 0.23.2
  • node.js version: v10.14.2
  • command-line arguments: npm run aperture or testcafe chrome desktop -e
  • browser name and version: Chrome 70
  • platform and version: macOS 10.13
  • other:
Need clarification

Most helpful comment

Thank you for the provided information. I see that some requests (including the stylesheet request from the http://aperture.synacor.com/sports page) fail with the net::ERR_EMPTY_RESPONSE error. I need additional time to find the cause of the problem.

All 14 comments

I can't reproduce the issue using Mac Book Pro 2012, macOS 10.14.1, TestCafe 0.23.2 and Chrome 70. Please, try to provide a browser network activity report, capture screenshot or record a screencast that shows the Network tab in the Chrome DevTools window.

You can perform test steps manually to be sure that the issue is not caused by your environment or machine configuration. Also, you can try to run the latest TestCafe alpha version (0.23.3-alpha.4).

@AndreyBelym I can still reproduce the issue with latest TestCafe alpha version (0.23.3-alpha.4). I believe the issue happens with Node v8.14.0 & higher. Screencast is provided below. You can see the issue happen when you get to 1:53 min mark -https://www.dropbox.com/s/nzmb9knjrnk9tg1/TestCafe_StylesNotLoading.mov?dl=0

HAR file - https://www.dropbox.com/s/jd3mgbcds561fsf/192.168.0.14.har?dl=0

Thank you for the provided information. I see that some requests (including the stylesheet request from the http://aperture.synacor.com/sports page) fail with the net::ERR_EMPTY_RESPONSE error. I need additional time to find the cause of the problem.

@sijosyn,

I didn't reproduce this issue on Chrome 71.0.3578 / Firefox 64.0.0 聽/ Mac OS X 10.14.1 (TestCafe 0.23.3 / 1.0.0).

Please note that you can pass retryTestPages as the sixth (undocumented) parameter to the createTestCafe function when you create a TestCafe server from JavaScript API:

const createTestCafe = require('testcafe');
聽
createTestCafe('localhost', 1337, 1338, null, false, true)
聽 聽 .then(testcafe => {
聽 聽 聽 聽 const runner = testcafe.createRunner();
聽 聽 聽 聽 /* ... */
聽 聽 });

This flag was designed to make TestCafe work stable in harsh network conditions.聽

Can you please try to run your tests using [email protected] and the retryTestPages parameter and tell us the results?

@Farfurix,

It's fairly easy to reproduce this issue and can be consistently reproduced if you are using the Node LTS v10.15.1 (or 10.14.2). Can you please test it with latest Node LTS and you should be able see this issue?. I can still reproduce this on Chrome 72.0.3626 / Mac OS X 10.14.2 and Node v10.15.1 (TestCafe v1.0.0 & v0.23.3)
Note: There is another issue that I logged where TestCafe hangs when running with Node LTS - https://github.com/DevExpress/testcafe/issues/3436 . If TestCafe hangs during execution, please quit & restart again to reproduce the page styles/CSS loading issue.

Attached video links showing the page styles/CSS loading issue:-
https://gyazo.com/c48d8add74299c7e48d6057c5518fbb3
https://gyazo.com/d234fd765e06bf78082ab939442e9d48

BTW, I'm not using programming API to run the tests. Is there a way I can pass retryTestPages via TestCafe CLI?

@sijosyn,

I've reproduced this issue for the desktop tests run (testcafe firefox desktop -e):

  • Win 10 / macOS / Firefox / [email protected] / Node v10.15.1
  • Win 10 / Firefox / [email protected] / Node v10.15.1
    testcafe1 0 0-firefox-1
  • Win 10 / Chrome / [email protected] / Node v10.15.1:
    ERROR The Chrome 72.0.3626 / Windows 10.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.

Our team will research it and check for a suitable solution.

@Farfurix - I'm curious if the root cause of this issue is the same that would cause the Cannot read property 'callsite' of undefined error that is filed in DevExpress/testcafe#3441? After upgrading from 0.19.2 to 1.1.0, we are getting these errors when running in our CI environment.

What's odd is that I can run all tests locally and they all pass. But running in our Jenkins CI in Browserstack, we get the callsite error. Both local and CI run node v8.12.0.

I'm hoping there's some workaround we can do because we really need the new --test-meta options 馃槃

@green-arrow the DevExpress/testcafe#3441 issue is a different issue. Since it is closed, please create a new bug report and provide a page and a test that can be used to reproduce the problem.

Hi @LavrovArtem @Farfurix Do you suggest any workaround for this until this bug is fixed ? I am running into the same issue as @sijosyn

Hi @vijaydandu
Unfortunately we can't provide a workaround at the moment. We are working on this issue. Thank you for your patience.

Hello @sijosyn,

Could you please share your repository with us? I wasn't able to reach out to it by using your URL.

Hello @vijaydandu,

Could you create a separate issue with a complete example? We will examine it and check for a suitable solution.

@Farfurix - Sorry that I deleted the repository. After updating the node version to v12.13.1, I'm not seeing this issue happen very often but it does happen sometimes. I can't consistently reproduce this issue now. Our pages are quite heavy with lots of ads. I think that's when this issue occurs. I'll share the URL's here for now and then try to provide reproducible test script later.

https://start.toshiba.com/
https://wowway.net/
https://centurylink.net/

Thank you for the update, @sijosyn

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Was this page helpful?
0 / 5 - 0 ratings