DevExpress / testcafe-hammerhead

A powerful web-proxy used as a core for the TestCafe testing framework. :hammer: :smiley:
https://testcafe.io
MIT License
171 stars 162 forks source link

Testcafe promise bug #2255

Closed Meemaw closed 4 years ago

Meemaw commented 4 years ago

What is your Test Scenario?

Test an application doing HTTP requests using ky-universal.

What is the Current behavior?

Testcafe crashes on what seems to be cloning of a promise.

What is the Expected behavior?

Testcafe should not crash.

Screenshot 2020-02-23 at 18 26 55

Steps to Reproduce:

➜ git clone https://github.com/Meemaw/testcafe-ky-bug.git
➜ cd testcafe-ky-bug
➜ yarn install
➜ yarn start # If you go to http://localhost:3000 you should see list of "comments" being rendered

In a new terminal:

➜ yarn testcafe chrome e2e/specs -f '<TestcafeBug />'

I'm fairly sure you can reproduce this in any setup.

Your Environment details:

AlexSkorkin commented 4 years ago

I've tried to download your sample but my attempts were unsuccessful. How can we access it?

git clone --branch testcafe-bug git@github.com:Meemaw/Insight.git testcafe-ky-bug
Cloning into 'testcafe-ky-bug'...
The authenticity of host 'github.com (140.82.118.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,140.82.118.3' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Meemaw commented 4 years ago

Can you try cloning using the HTTP(S), e.g.:

➜ git clone --branch testcafe-bug https://github.com/Meemaw/Insight.git testcafe-ky-bug
alexey-lin commented 4 years ago

Hi @Meemaw,

I successfully cloned the repo and managed to start the application. Yet, now I get the following error when trying to launch tests:

ERROR Cannot load a client script from ../../node_nodules/@testing-library/dom/d
ist/@testing-library/dom.umd.js.
Meemaw commented 4 years ago

@alexey-lin, @AlexSkorkin I've created a new repo for this and updated the "Steps to reproduce" for a much easier setup.

LavrovArtem commented 4 years ago

I've debugged this issue. It's caused by the fact that Hammerhead incorrectly processes the following piece of your code:

window["%hammerhead%"].processScript(
    'async function f() { result[type] = (await result).clone(); }')

// actual
// async function f() {  __set$(result,type,await (result).clone()); }
// expected
// async function f() {  __set$(result,type,(await result).clone()); }
Meemaw commented 4 years ago

Any estimates on time it will take to fix this? This seems like a quite problematic bug preventing one from using Testcafe at all.

Dmitry-Ostashev commented 4 years ago

Currently, we cannot provide any estimates, however, we would appreciate your PR.

lock[bot] commented 4 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.